From patchwork Wed Apr 20 14:48:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12820391 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 A5118C433EF for ; Wed, 20 Apr 2022 14:48:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1A546B0071; Wed, 20 Apr 2022 10:48:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA2316B0072; Wed, 20 Apr 2022 10:48:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C42E26B0074; Wed, 20 Apr 2022 10:48:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id AF6146B0071 for ; Wed, 20 Apr 2022 10:48:30 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 6D5FE801B1 for ; Wed, 20 Apr 2022 14:48:30 +0000 (UTC) X-FDA: 79377538380.25.D5183D1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 97CCA140011 for ; Wed, 20 Apr 2022 14:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650466109; 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; bh=UvQ+ujOD64o3fA7j/+EhfRaQUiew201ThgumvAAsSZc=; b=S1nB7dIrmB7Medv98ksQ2gTji8D+Kybbw6Gd7u8pduzYwAbh16rws7O/DM1uDCVpnN3oiI XRcNzIM9gBhlSPuKtvlgYZtdhRcqlOu6oVaXANHk3/Vr2/jpw60JcvPL/3cMRq4cSRODjM UUUBksS4cAgIYulk/U1/M9YVBfyn980= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-163-eFrsJtS0OHSlRWHBDSMxag-1; Wed, 20 Apr 2022 10:48:27 -0400 X-MC-Unique: eFrsJtS0OHSlRWHBDSMxag-1 Received: by mail-io1-f72.google.com with SMTP id k20-20020a5e9314000000b00649d55ffa67so1342388iom.20 for ; Wed, 20 Apr 2022 07:48:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UvQ+ujOD64o3fA7j/+EhfRaQUiew201ThgumvAAsSZc=; b=e2Hik9BWV9qi5vcBaHPAPp7MqLBxm0m98AlUIdqVDxSHOTVowFt8pG5adOzXbSQiok KeOIq2V/MmVqud9ofiAvWEKhBSf7tEo+fdWu2Btng1eVz/PHggo6gS//yjaAZqHsnUW3 7TCvuTM8PMMyvWb60PCm7Gkhi2FvyY0J9LyMs1zKN2noT+gdepUOIpCpwON+AjRKr4NJ Av4vApT5fnrl+icRfTwm2oppUAdX4V/psDSPB2KCcMps/jH7HmDF4H6dJATK8D0rSFAA ZWEVm9O5wE8TYR4eopW52yORjeXhF4FE7Yv9cLFHB4/Dj9MMomG5z97b+Hsjw/wZa6ry 0XOg== X-Gm-Message-State: AOAM530SFVW4JSCBRBbHBMfANYsf30LqBIZgiu8NPmfIAlRQFqAHuh2d 1b3pNRKA279/5s9jxsCTmHFTHPI8Z3uF9QCt8jcAaIrlpXM/kWiKwAnievfg86e8kC4wguv3etX D92c8t+g1xIk= X-Received: by 2002:a92:d212:0:b0:2cb:7635:9940 with SMTP id y18-20020a92d212000000b002cb76359940mr8695280ily.132.1650466106726; Wed, 20 Apr 2022 07:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9j2+Hln2x2AYB7+/I4WrIZvyf7PX0+qPLIv0pD0jCSCKrDa/Ss/xapAxD8Cx/If6Puo2s1w== X-Received: by 2002:a92:d212:0:b0:2cb:7635:9940 with SMTP id y18-20020a92d212000000b002cb76359940mr8695263ily.132.1650466106474; Wed, 20 Apr 2022 07:48:26 -0700 (PDT) Received: from localhost.localdomain (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id c15-20020a5d8b4f000000b00648f75d0289sm11447866iot.6.2022.04.20.07.48.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 20 Apr 2022 07:48:26 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Andrea Arcangeli , peterx@redhat.com, Alistair Popple , Johannes Weiner , Axel Rasmussen , Mike Rapoport , Mike Kravetz , Nadav Amit Subject: [PATCH] mm/uffd: Move USERFAULTFD configs into mm/ Date: Wed, 20 Apr 2022 10:48:23 -0400 Message-Id: <20220420144823.35277-1-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 97CCA140011 X-Stat-Signature: gaxnxpucnso7j7sheup6o4zh3x1y6ww8 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S1nB7dIr; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf26.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com X-HE-Tag: 1650466108-95749 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We used to have USERFAULTFD configs stored in init/. It makes sense as a start because that's the default place for storing syscall related configs. However userfaultfd evolved a bit in the past few years and some more config options were added. They're no longer related to syscalls and start to be not suitable to be kept in the init/ directory anymore, because they're pure mm concepts. But it's not ideal either to keep the userfaultfd configs separate from each other. Hence this patch moves the userfaultfd configs under init/ to be under mm/ so that we'll start to group all userfaultfd configs together. We do have quite a few examples of syscall related configs that are not put under init/Kconfig: FTRACE_SYSCALLS, SWAP, FILE_LOCKING, MEMFD_CREATE.. They all reside in the dir where they're more suitable for the concept. So it seems there's no restriction to keep the role of having syscall related CONFIG_* under init/ only. Suggested-by: Johannes Weiner Signed-off-by: Peter Xu Acked-by: Johannes Weiner Reviewed-by: Axel Rasmussen --- NOTE: there's a light dependency to patch "mm/uffd: Hide PTE_MARKER option". --- init/Kconfig | 17 ----------------- mm/Kconfig | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index 6a32b466dad1..0a358fc858cd 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1685,16 +1685,6 @@ config ADVISE_SYSCALLS applications use these syscalls, you can disable this option to save space. -config HAVE_ARCH_USERFAULTFD_WP - bool - help - Arch has userfaultfd write protection support - -config HAVE_ARCH_USERFAULTFD_MINOR - bool - help - Arch has userfaultfd minor fault support - config MEMBARRIER bool "Enable membarrier() system call" if EXPERT default y @@ -1759,13 +1749,6 @@ config KALLSYMS_BASE_RELATIVE # syscall, maps, verifier -config USERFAULTFD - bool "Enable userfaultfd() system call" - depends on MMU - help - Enable the userfaultfd() system call that allows to intercept and - handle page faults in userland. - config ARCH_HAS_MEMBARRIER_CALLBACKS bool diff --git a/mm/Kconfig b/mm/Kconfig index d740e1ff3b2f..f268ba545e02 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -909,6 +909,23 @@ config ANON_VMA_NAME area from being merged with adjacent virtual memory areas due to the difference in their name. +config USERFAULTFD + bool "Enable userfaultfd() system call" + depends on MMU + help + Enable the userfaultfd() system call that allows to intercept and + handle page faults in userland. + +config HAVE_ARCH_USERFAULTFD_WP + bool + help + Arch has userfaultfd write protection support + +config HAVE_ARCH_USERFAULTFD_MINOR + bool + help + Arch has userfaultfd minor fault support + config PTE_MARKER bool