From patchwork Thu Sep 8 10:43:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 12969922 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 A6A8FC38145 for ; Thu, 8 Sep 2022 10:43:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3FA886B007B; Thu, 8 Sep 2022 06:43:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 383A56B007D; Thu, 8 Sep 2022 06:43:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FCDA8D0002; Thu, 8 Sep 2022 06:43:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 108A06B007B for ; Thu, 8 Sep 2022 06:43:58 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E5305C1A21 for ; Thu, 8 Sep 2022 10:43:57 +0000 (UTC) X-FDA: 79888582914.28.AE45AFB Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by imf16.hostedemail.com (Postfix) with ESMTP id 904A118007D for ; Thu, 8 Sep 2022 10:43:57 +0000 (UTC) Received: by mail-wm1-f52.google.com with SMTP id m17-20020a7bce11000000b003a5bedec07bso1401344wmc.0 for ; Thu, 08 Sep 2022 03:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date; bh=RDfo3bMr+JPT0XwUqpEkdXAA/w6q2WGGKmvqZnqv+TQ=; b=Fw4IKH8ap4pumBI12Nq1Lfh9UtKeAcIDpwe+b1cX00pCYnpLbbi+7TinfG2yAn37L8 04V+5lVNVeT7IoxTbICeOOJhv1i6FAQCJB08146+bhoKQNtIDt3xvNsvk6HTXCBqHFM3 N6LDDtIOq8qwPGklXmHEsyu6FkeprRxH3Exu5bKLnJaqtWALAamiEythWkn8NzQQ+8NC txG9S13vwDKVmWy390YKikVWb8EjCqwWoURsQoLOsRXaO5r05Xy2D3/TxKFA1vhOwV5l k/pfHLouALbI5XPTSW97BlFXSnjAB6iK1gfU5LBfKvbTddVEbjqCmqVKQqCV+KQvE2Gq knlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=RDfo3bMr+JPT0XwUqpEkdXAA/w6q2WGGKmvqZnqv+TQ=; b=s10M3lIhkDx9+wwyDvJwAQK6RYAKBRdC0RpUD3xCrzTHbXfrAWy2wTpBEX2mE5Z6cx s9HCAQXlpJZg61wu/4pr0JryGS6zaWoIMTGFTfwlKQg+cFD4W1ot6qiErReW9A/6FhtH qiME6GPwng6FP+ruaGxJrK0izK5eHWSa2Xz6WiW3ySDFXplfD2jLOvjoJTwt3elxHaj7 9CkH2e5m813Spmg2PYQ25QogE+wrejesPKQIgBl31O2I4XS23NJLVldb7moIMutUB23s DssLGgrbigJaS96H9AHTKUJsm5Hy7MmIgkM9ADTxgeokazLxhHwAICsObR7obyvsZt6O PJUg== X-Gm-Message-State: ACgBeo2FaXpKLQEHLaCfUM3hDAlm0MHYU4xnyzWA3EcwG7OKeRQdAoFR YhxEgBs4bA99E6fla5qLE/k= X-Google-Smtp-Source: AA6agR6LWwrUGGfoOSbVk9oxNX8imZLStpZ8izPiLHM9p+m8rli2GQHNjyDS5uL1kEKQueemyub1Qg== X-Received: by 2002:a1c:6a0a:0:b0:3a5:bcad:f2cc with SMTP id f10-20020a1c6a0a000000b003a5bcadf2ccmr1823007wmc.74.1662633836389; Thu, 08 Sep 2022 03:43:56 -0700 (PDT) Received: from felia.fritz.box (200116b826f77600d0640cc051af4288.dip.versatel-1u1.de. [2001:16b8:26f7:7600:d064:cc0:51af:4288]) by smtp.gmail.com with ESMTPSA id bu3-20020a056000078300b0022863395912sm17227486wrb.53.2022.09.08.03.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 03:43:56 -0700 (PDT) From: Lukas Bulwahn To: Russell King , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org, Peter Chen , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Andrew Morton , Mike Rapoport , linux-mm@kvack.org, Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH 5/6] mm: Kconfig: make config SECRETMEM visible with EXPERT Date: Thu, 8 Sep 2022 12:43:36 +0200 Message-Id: <20220908104337.11940-6-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908104337.11940-1-lukas.bulwahn@gmail.com> References: <20220908104337.11940-1-lukas.bulwahn@gmail.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662633837; a=rsa-sha256; cv=none; b=YLdmJ8CjkIAonYdrs4zxtla2lzF7gImTJW5ut47nzoJhhe4/EeHzph18Nd2THmivuj5rUB GozT+b4kbMnEqQUbUq1K/ZMi8gxr8vB8qptbWoFr3SpBLOYYQVuzeoGd2BAdUYg8nkEwyY zngrGRTq9LWQr+XovphDPgLVmy/j3J8= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fw4IKH8a; spf=pass (imf16.hostedemail.com: domain of lukas.bulwahn@gmail.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=lukas.bulwahn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662633837; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=RDfo3bMr+JPT0XwUqpEkdXAA/w6q2WGGKmvqZnqv+TQ=; b=WsItDiKQm8rLbpXj1OljCjawpJBGa8CLb1kaver8VXZ7kynY7eLRo+Y0npSpCC1rBWQMZo 7RkRtURZl3x0b8EnS9919HQdt0F67zTDmT409Sfp66oggbD3qrbTit8Npb9oCqyEt3j18I dFtTo62tB/THmdGu/g9q5MQ0iCudn4Q= X-Rspamd-Queue-Id: 904A118007D Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fw4IKH8a; spf=pass (imf16.hostedemail.com: domain of lukas.bulwahn@gmail.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=lukas.bulwahn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: wx8dn5b5azeux5i3a1ut7nx3ohcungco X-HE-Tag: 1662633837-634070 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: Commit 6a108a14fa35 ("kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT") introduces CONFIG_EXPERT to carry the previous intent of CONFIG_EMBEDDED and just gives that intent a much better name. That has been clearly a good and long overdue renaming, and it is clearly an improvement to the kernel build configuration that has shown to help managing the kernel build configuration in the last decade. However, rather than bravely and radically just deleting CONFIG_EMBEDDED, this commit gives CONFIG_EMBEDDED a new intended semantics, but keeps it open for future contributors to implement that intended semantics: A new CONFIG_EMBEDDED option is added that automatically selects CONFIG_EXPERT when enabled and can be used in the future to isolate options that should only be considered for embedded systems (RISC architectures, SLOB, etc). Since then, this CONFIG_EMBEDDED implicitly had two purposes: - It can make even more options visible beyond what CONFIG_EXPERT makes visible. In other words, it may introduce another level of enabling the visibility of configuration options: always visible, visible with CONFIG_EXPERT and visible with CONFIG_EMBEDDED. - Set certain default values of some configurations differently, following the assumption that configuring a kernel build for an embedded system generally starts with a different set of default values compared to kernel builds for all other kind of systems. Considering the second purpose, note that already probably arguing that a kernel build for an embedded system would choose some values differently is already tricky: the set of embedded systems with Linux kernels is already quite diverse. Many embedded system have powerful CPUs and it would not be clear that all embedded systems just optimize towards one specific aspect, e.g., a smaller kernel image size. So, it is unclear if starting with "one set of default configuration" that is induced by CONFIG_EMBEDDED is a good offer for developers configuring their kernels. Also, the differences of needed user-space features in an embedded system compared to a non-embedded system are probably difficult or even impossible to name in some generic way. So it is not surprising that in the last decade hardly anyone has contributed changes to make something default differently in case of CONFIG_EMBEDDED=y. Currently, in v6.0-rc4, SECRETMEM is the only config switched off if CONFIG_EMBEDDED=y. As long as that is actually the only option that currently is selected or deselected, it is better to just make SECRETMEM configurable at build time by experts using menuconfig instead. Make SECRETMEM configurable when EXPERT is set and otherwise default to yes. Further, SECRETMEM needs ARCH_HAS_SET_DIRECT_MAP. This allows us to remove CONFIG_EMBEDDED in the close future. Signed-off-by: Lukas Bulwahn Acked-by: Mike Rapoport Reviewed-by: Masahiro Yamada --- mm/Kconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index ceec438c0741..aa154c20b129 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1068,7 +1068,13 @@ config IO_MAPPING bool config SECRETMEM - def_bool ARCH_HAS_SET_DIRECT_MAP && !EMBEDDED + default y + bool "Enable memfd_secret() system call" if EXPERT + depends on ARCH_HAS_SET_DIRECT_MAP + help + Enable the memfd_secret() system call with the ability to create + memory areas visible only in the context of the owning process and + not mapped to other processes and other kernel page tables. config ANON_VMA_NAME bool "Anonymous VMA name support"