From patchwork Wed Nov 16 13:19:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 13045201 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 75689C433FE for ; Wed, 16 Nov 2022 13:19:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE9456B0072; Wed, 16 Nov 2022 08:19:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C99D36B0073; Wed, 16 Nov 2022 08:19:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B130B8E0002; Wed, 16 Nov 2022 08:19:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9C0AF6B0072 for ; Wed, 16 Nov 2022 08:19:43 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 25FC08049F for ; Wed, 16 Nov 2022 13:19:43 +0000 (UTC) X-FDA: 80139362646.29.B0E134C Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf23.hostedemail.com (Postfix) with ESMTP id B16F714000C for ; Wed, 16 Nov 2022 13:19:41 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id z18so26490810edb.9 for ; Wed, 16 Nov 2022 05:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cu4Pj0/g3wVyHJOh6XAPI11RLacw08jC/qauyL0wdeU=; b=cetpZgc842pmN6uwgb0ABFm8EiYtQl9ogkQdutUrZ/sr3Uuluqt2l3XPLfgfocSZFK 39BEg8DmghIoghB+7mmw77x0F1KEzT266S1ouXMRxCZ79tYTQFA0hefzNaBZguX14ynn xiNglk1uy+vxm0nVIovVKs00SxCL1cgCLgPKv2Q5SssS0fw8uEOvN1xgHnDGKgcpRs51 FcS8EXqvfKnq1+fM4oq4/KUnngxyaoy+SMUo/4cbT1n5/6XxukAOfKwLuIYQk003Q5xx LYSmfd6t0CHoU2p0zccA7Yi4Ta68WZA63Q5aLg5PhOXETKjjRkACG0RHWs9RtpOjdI6F PJvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cu4Pj0/g3wVyHJOh6XAPI11RLacw08jC/qauyL0wdeU=; b=faIR1xigVnCi+kKhZzb6LnvuIXzHhaKIfLGnpDdsZcXdlyNoztm88EOCGvHF5eEt0x MQ/ti7cFMATC31Aa1ZfsgLTH1R8Irs4B4vsUkcBXcrIERd8y6F8oG2Drvc5hqQQIMG+i KCJZ+DRq0TzQpn4qcFtIiwr0g2hJYJb0xwr3A6/xrtZmryrTdD1qd4g/Cl4ZYAuypywf 2g//IfhSnOIoqBf3SVd/YxB9lURJgmeUU1irYULetiqUWFiTBhUWGDxMclv8EH8Mx/V+ ijSYWXvLZogMWVHULLQrqk+hkN3HHFQ0lVtzoZseG7p9ryndueeNG8qu+MhwmbFLD9Vf aLcA== X-Gm-Message-State: ANoB5pnSVohC7l1lgmi0CsHaWVgli39LUC0l0nAdWoEBIsqwu8XR7Nol VGT1RGVe1xJjbPJQPMthSYk= X-Google-Smtp-Source: AA0mqf49H2mM4LmigWtuW0lZRPV8K/bjrHWkfrhJ5zGrgfca0PZCw5vWAvPSS1BdgVMJfGcQ7MNWGg== X-Received: by 2002:a05:6402:b63:b0:460:6194:d293 with SMTP id cb3-20020a0564020b6300b004606194d293mr19607886edb.331.1668604780144; Wed, 16 Nov 2022 05:19:40 -0800 (PST) Received: from felia.fritz.box (200116b826c55000c59461cca0b9a159.dip.versatel-1u1.de. [2001:16b8:26c5:5000:c594:61cc:a0b9:a159]) by smtp.gmail.com with ESMTPSA id z10-20020a170906714a00b00738795e7d9bsm6818276ejj.2.2022.11.16.05.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 05:19:39 -0800 (PST) From: Lukas Bulwahn To: Andrew Morton , linux-mm@kvack.org Cc: Mike Rapoport , Masahiro Yamada , Arnd Bergmann , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH RESEND] mm: Kconfig: make config SECRETMEM visible with EXPERT Date: Wed, 16 Nov 2022 14:19:22 +0100 Message-Id: <20221116131922.25533-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668604781; a=rsa-sha256; cv=none; b=EkpC22CaO/jUT6AGeW+PY4oLamDYdyahT5INry68d+xWNDmDD76709PdIiW/zzkLrqglHm ezFrDaBqQr/z+DnIJy8JhIk7McE1AbltwhqG6f27mrY6yixKMw/FgDCZloiTvIXq1Ub2JS hRbiRAndXtUPW2RUQmL46kgJ0lke2YY= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cetpZgc8; spf=pass (imf23.hostedemail.com: domain of lukas.bulwahn@gmail.com designates 209.85.208.45 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=1668604781; 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:references:dkim-signature; bh=cu4Pj0/g3wVyHJOh6XAPI11RLacw08jC/qauyL0wdeU=; b=fXl/no29GEoGoMo1h4Z3f6eUBmGnvMZYtw6t9KA+jI3C43Nb0+LbiYPMpweqXblbDK97H7 Yy3JcToac4weQqKe/6B6tZOcOriwNmM7FfERM93RLLqlGJxq+TbbyJj2yndX5oH4CR923V O8gUdhIWsbAetgGmbuxGmf+l8PXKcqE= X-Rspam-User: X-Stat-Signature: 4j4pu6o58rerhtdoin4pjamn1n88cppu X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B16F714000C Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cetpZgc8; spf=pass (imf23.hostedemail.com: domain of lukas.bulwahn@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=lukas.bulwahn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1668604781-216972 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 Acked-by: Arnd Bergmann Reviewed-by: Masahiro Yamada --- v1: https://lore.kernel.org/lkml/20220908104337.11940-6-lukas.bulwahn@gmail.com/ v1 -> resend: - no change of the commit itself - added tags from Mike, Arnd and Masahiro-san Andrew, please pick this minor clean-up patch for mm. mm/Kconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index c7e06b507965..6a9a7657b470 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1074,7 +1074,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"