Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp249150rwb; Fri, 4 Aug 2023 12:04:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5LWcsf8HEBGQatq/KmRlIgTH83i/A7oO+CPoirDRRPPOm1mXWSyODhnI3JKF9fszqZs8w X-Received: by 2002:a17:907:2cce:b0:993:c48f:184c with SMTP id hg14-20020a1709072cce00b00993c48f184cmr2018144ejc.10.1691175863053; Fri, 04 Aug 2023 12:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691175863; cv=none; d=google.com; s=arc-20160816; b=SOsTRGZAOw8ItVr9BHUgdi8u4XbTeolrPrIF4sjpVR6vGIdjNKjWOnvKWG1Bu39yMf z/3JccBgAdGGbyDMEpDTa6mOy1G8WI6feZvWP9WBvcIpA46uNds2Md5gKZZ+NBdjKA63 YCt6Wxjs+Ywr1Lc0gWM2G4CP1xVracQmDiDZbAYH+EJrRx3/QMdZSf8dRVGQRbjzUb+e ZgdB8LUC9nwENUVpQD5F8YBHv3X57aCkwlEvctA/25OVNvV6zaT/M0lGdzJHtmHE6YBB eNvlyU+ID77BgYGN+0nfNLcDE6+NCEJDA/LiJ8dbUgnFE3Q2Gzssoc4I+q64SdmpGNeD DlVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=X3UQxfMm+TpDCImrRZ6XU1/y6T2MDQvmQQMDPUayKLo=; fh=4tSvR71olhj1p5H1QMAZuOiFDdwKSZoMYuPwp/uivDo=; b=fCOYyLfKtv1SHnKvWHjXBofLcOUWI5TMSqzmrmUQrGNKVXdR5LiS84iWwYD+qFhJCS 4V0NoElnKKzYg4P1e+VYhjdaysQ28O2IHlUgVR8m1VM1acaFUAgXw5b2chJuf23SWNAd 3qRfpT1b5LVjdScHXOVTX4jRHNyXVixFYPsWv5a+n2iKO1cuWypoZ/WaMhMC166OG6nG fnB8yXb7dSXSU0ZIilc/gGzk2IlciwXgfi/ko62rSJCHKLpZiCT9C74Yh47LUttCVOw+ CG/VkJFpn7RRRoZdjrmWzxIi1GWGYlBz6l2T/2uZG56PjI/EgVzwlYYQw1MHg/pRzWnS snlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KSmW57I6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a170906141400b0099bcc0ad6fasi1770557ejc.782.2023.08.04.12.03.44; Fri, 04 Aug 2023 12:04:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KSmW57I6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231733AbjHDRgu (ORCPT + 99 others); Fri, 4 Aug 2023 13:36:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbjHDRgm (ORCPT ); Fri, 4 Aug 2023 13:36:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE484C06; Fri, 4 Aug 2023 10:36:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0F486620D6; Fri, 4 Aug 2023 17:36:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68CBFC433C7; Fri, 4 Aug 2023 17:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691170578; bh=A7U/6JtnabxCvs2EpKPnYwrCm3XqYfEuZUCCQ5NXh9E=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=KSmW57I6UjMcgaghRqRhCarWDOYt9dXCsftU5VK/k14bBsoNMCtiZfhtasFo3C5Os dAb4q+Rq4IDG0wsdN+O0oa1syHb0JprXklO4SOD4mmf3fyCAXZ9D460ceGgQMN/DpZ EYPLh4ZQKVPfUjkyi4AD96i/VHXHmbcuomZwMM3j4IOqpeipNWPzrS0rxvJWIGxL4m rGja3FtGQcSNdrmaU8ys/cK0OpxuHQEb3XiBkxsrMQ77vLPGX7DBsRF4vGXVW8XyEb 3ipmmRMjzE/OjoCohJ28MDIlyBgrTzhnO9KPNmRv9mHJA/fQFkMMImS9EwSZUTaW7V qFCGFmwQsARYg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id EE685CE0591; Fri, 4 Aug 2023 10:36:17 -0700 (PDT) Date: Fri, 4 Aug 2023 10:36:17 -0700 From: "Paul E. McKenney" To: Alexey Dobriyan Cc: akpm@linux-foundation.org, mhiramat@kernel.org, arnd@kernel.org, ndesaulniers@google.com, sfr@canb.auug.org.au, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH RFC bootconfig] 1/2] fs/proc: Add /proc/cmdline_load for boot loader arguments Message-ID: <9a42de2a-7d9f-4be3-b6c8-9f3e8a092c4d@paulmck-laptop> Reply-To: paulmck@kernel.org References: <197cba95-3989-4d2f-a9f1-8b192ad08c49@paulmck-laptop> <20230728033701.817094-1-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 04, 2023 at 08:23:20PM +0300, Alexey Dobriyan wrote: > On Thu, Jul 27, 2023 at 08:37:00PM -0700, Paul E. McKenney wrote: > > In kernels built with CONFIG_BOOT_CONFIG_FORCE=y, /proc/cmdline will > > show all kernel boot parameters, both those supplied by the boot loader > > and those embedded in the kernel image. This works well for those who > > just want to see all of the kernel boot parameters, but is not helpful to > > those who need to see only those parameters supplied by the boot loader. > > This is especially important when these parameters are presented to the > > boot loader by automation that might gather them from diverse sources. > > > > Therefore, provide a /proc/cmdline_load file that shows only those kernel > > boot parameters supplied by the boot loader. > > > +static int cmdline_load_proc_show(struct seq_file *m, void *v) > > +{ > > + seq_puts(m, boot_command_line); > > + seq_putc(m, '\n'); > > + return 0; > > +} > > + > > static int __init proc_cmdline_init(void) > > { > > struct proc_dir_entry *pde; > > @@ -19,6 +27,11 @@ static int __init proc_cmdline_init(void) > > pde = proc_create_single("cmdline", 0, NULL, cmdline_proc_show); > > pde_make_permanent(pde); > > pde->size = saved_command_line_len + 1; > > + if (IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE)) { > > + pde = proc_create_single("cmdline_load", 0, NULL, cmdline_load_proc_show); > > + pde_make_permanent(pde); > > + pde->size = strnlen(boot_command_line, COMMAND_LINE_SIZE) + 1; > > + } > > Please add it as separate fs/proc/cmdline_load.c file so that name of > the file matches name of the /proc file. Thank you, will do! > The name "cmdline_load" is kind of non-descriptive. Mentioning "bootloader" > somewhere should improve things. If we can all quickly come to agreement on a name, I can of course easily change it. /proc/cmdline_bootloader? Better than /proc/cmdline_from_bootloader, I suppose. /proc/cmdline_bootldr? /proc/bootloader by analogy with /proc/bootconfig? Something else? Thanx, Paul