From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B083C6FD1D for ; Thu, 30 Mar 2023 22:27:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47AFB6B0071; Thu, 30 Mar 2023 18:27:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42B116B0072; Thu, 30 Mar 2023 18:27:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CB866B0074; Thu, 30 Mar 2023 18:27:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1D7C76B0071 for ; Thu, 30 Mar 2023 18:27:15 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DB6AB1601FF for ; Thu, 30 Mar 2023 22:27:14 +0000 (UTC) X-FDA: 80627001588.01.8F1FC56 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id BEDF5180011 for ; Thu, 30 Mar 2023 22:27:12 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RBVN+n5e; spf=pass (imf24.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680215232; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Yrg7gd+3buI58FtTknCRM1CGb3Q5tRIhU3QrztqGTxw=; b=n7O1ic3uxWG78fFixdn4mA6OBd0aJdaNrrRZn1ts9xZMW/wf6n2UlTW3BkO9X+/59HFwff gUJ90IIU52nK/+cUMk422m6gF/1xGOqxYMy6bEonMkvAC4jaeWw9WrZ4VnaSC9Hw/Rt/U0 ySuzbPFG4gAd7XVaLrWPGvGSOHFAIzo= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RBVN+n5e; spf=pass (imf24.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680215232; a=rsa-sha256; cv=none; b=PNMR5GQO+vrib4KBv92c3GZfceYgr9AWcWkoE4efB1Iowk6sGf5EhCMH8DI+9eU0r9XCGD ktLOlbHJ5NyXlVBqxm+cKW1YSK1dA/gmml2Lww+6mnZeCk6NaP8eRQlB4/V1QTDIyePMl2 jkEzsqF8q/Mip9PbjbLUcQU5kv2OgZ0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680215232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yrg7gd+3buI58FtTknCRM1CGb3Q5tRIhU3QrztqGTxw=; b=RBVN+n5eyCaqGAe57n6zJwjUClG9NdwrydHJzx3P4ObvfHwBh0ThJ9Y2KiMl7N85IkO9OA j3CwfWMpRYfaEJ0w5kj765Noa3bDGKPJ4Er5YPQ71rz0ARpOxwzX654to0YuZQZ3J1FdI8 Fx+EYQxHvraqRfHfcNMIMpx07LJCk9U= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-rNuiWMGDMK-oLEpSetUrcw-1; Thu, 30 Mar 2023 18:27:10 -0400 X-MC-Unique: rNuiWMGDMK-oLEpSetUrcw-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-74678af9349so65604085a.0 for ; Thu, 30 Mar 2023 15:27:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680215230; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Yrg7gd+3buI58FtTknCRM1CGb3Q5tRIhU3QrztqGTxw=; b=5dDTPwa9B05R1LowoSAtyHVB397g3HSjL0qKeA4xZVJQlTNlCsAIkzE13SMMlnJaFW sg7367qTvLpQoixN7I5WXoxQTHDOZFPsIZaFiIGK87hBK0qF8GJEbmio0ssT+6O/9bNl G7DzIeW1WnP3QIr5I8rOXfYpWZrZCZvZ7RGwe7Mt0hBEzrfkyQExDhSfZGuJaU+J3AuA 4mdP6R0pbG2O4BPKlXIkWE13eexPqSV6biWCr3JQoLI6tUy1heu537q445qL81LXWc5o Xf2zmutjNHpf0q20jWvrmBc2Srzbx5WsWlb+pXeqUv5NbhbN8QDojI8i0XBlgSD7Fjxx wKTg== X-Gm-Message-State: AAQBX9dQE1KzgcwjSQzd/f2cXbsWFgveijwRgI2VmwXuJOuAp/qQtm5Q XTGmwT2oR7pzEIakUwqLExhlljdm+OSASG2AKlBovNgerRthGrgueb6DBLjgUoLf4j8uFpSl7Mg K/WoB3OnqqWUSakEJTpE= X-Received: by 2002:a05:622a:1a0a:b0:3e3:7ed0:d6df with SMTP id f10-20020a05622a1a0a00b003e37ed0d6dfmr6427802qtb.6.1680215229924; Thu, 30 Mar 2023 15:27:09 -0700 (PDT) X-Google-Smtp-Source: AKy350bGOjNmUVk9T+eZ7zs/ZYSmIplExG8QnhHyqHyNy/4pL14K7OcrvahsGGY40TBYdu4lZVEzjQ== X-Received: by 2002:a05:622a:1a0a:b0:3e3:7ed0:d6df with SMTP id f10-20020a05622a1a0a00b003e37ed0d6dfmr6427778qtb.6.1680215229676; Thu, 30 Mar 2023 15:27:09 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-40-70-52-229-124.dsl.bell.ca. [70.52.229.124]) by smtp.gmail.com with ESMTPSA id k19-20020ac84753000000b003dffd3d3df5sm191625qtp.2.2023.03.30.15.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 15:27:09 -0700 (PDT) Date: Thu, 30 Mar 2023 18:27:07 -0400 From: Peter Xu To: Axel Rasmussen Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Kravetz , Andrew Morton , Andrea Arcangeli , Mike Rapoport , Nadav Amit , Leonardo Bras Soares Passos , David Hildenbrand , linux-stable Subject: Re: [PATCH 01/29] Revert "userfaultfd: don't fail on unrecognized features" Message-ID: References: <20230330155707.3106228-1-peterx@redhat.com> <20230330155707.3106228-2-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: BEDF5180011 X-Rspam-User: X-Stat-Signature: f66giiwnq1d7tkwrtzbxcneafytuy3o9 X-HE-Tag: 1680215232-460051 X-HE-Meta: U2FsdGVkX1+Y+HqmuqzX5sNr8S06QCEQmBc6IuufRPNlv+SAPVw7uPAF/Kmzr1CQuoCwVwEpFI2+aGUqr3X8fRMP75vhkRvPjMeNshcoyyDqAaA4nl9EnRFJR160oAyVnp0u0BOqBBMENLGmPQ0xC5W6x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X+C4XpLAt2yEygPmj6SLOPdSZ22lHDVS3eiGVUhOd9UOHecNBAtL0CjXIJNemm+xXliMy4vkTGMKkiPs1USQdre2euIJMGRcYkOOYExivIhAon7gTtwVUsLGWafeKP7hAFiT4lGsHCm25618GxQyiVXGgcogN0H3PLPW6JBglAzKGwO0+/z+T2Muyj3zMFJO4rCtLaGZ3ozUEBufFcBoTM05m7E6U7q6vKJnK X-Bogosity: Ham, tests=bogofilter, spamicity=0.016269, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 30, 2023 at 12:04:09PM -0700, Axel Rasmussen wrote: > On Thu, Mar 30, 2023 at 8:57 AM Peter Xu wrote: > > > > This is a proposal to revert commit 914eedcb9ba0ff53c33808. > > > > I found this when writting a simple UFFDIO_API test to be the first unit > > test in this set. Two things breaks with the commit: > > > > - UFFDIO_API check was lost and missing. According to man page, the > > kernel should reject ioctl(UFFDIO_API) if uffdio_api.api != 0xaa. This > > check is needed if the api version will be extended in the future, or > > user app won't be able to identify which is a new kernel. > > 100% agreed, this was a mistake. > > > > > - Feature flags checks were removed, which means UFFDIO_API with a > > feature that does not exist will also succeed. According to the man > > page, we should (and it makes sense) to reject ioctl(UFFDIO_API) if > > unknown features passed in. > > I still strongly disagree with reverting this part, my feeling is > still that doing so makes things more complicated for no reason. > > Re: David's point, it's clearly wrong to change semantics so a thing > that used to work now fails. But this instead makes it more permissive > - existing userspace programs continue to work as-is, but *also* one > can achieve the same thing more simply (combine probing + > configuration into one step). I don't see any problem with that, > generally. > > But, if David and others don't find my argument convincing, it isn't > the end of the world. It just means I have to go update my userspace > code to be a bit more complicated. :) I'd say it's fine if it's your own program that you can in full control easily. :) Sorry again for not noticing that earlier. There's one reason that we may consider keeping the behavior. IMHO it is when there're major softwares that uses the "wrong" ABI (let's say so; because it's not following the man pages). If you're aware any such major softwares (especially open sourced) will break due to this revert patch, please shoot. > > I also still think the man page is incorrect or at least incomplete no > matter what we do here; we should be sure to update it as a follow-up. So far it looks still fine if with this revert. Maybe I overlooked somewhere? I'll add this into my todo, but with low priority. If you have suggestion already on how to improve the man page please do so before me! -- Peter Xu