From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] bootconfig: Skip printing early params to cmdline from bootconfig
Date: Thu, 2 Apr 2026 12:52:38 +0900 [thread overview]
Message-ID: <20260402125238.a470f6fa5497c55f3484f72d@kernel.org> (raw)
In-Reply-To: <ac0-rrQk8BoS9B5k@gmail.com>
On Wed, 1 Apr 2026 08:51:48 -0700
Breno Leitao <leitao@debian.org> wrote:
> On Wed, Apr 01, 2026 at 11:02:55PM +0900, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >
> > If user configures `kernel.key` in bootconfig, the 'key' is shown
> > in kernel cmdline (/proc/cmdline) and kernel boot parameter
> > handler associated with 'key' is invoked. However, since the
> > bootconfig does not support the parameter defined with early_param,
> > those keys are shown in '/proc/cmdline' but not handled by kernel.
> >
> > This could easily mislead users who expected to be able to specify
> > early parameters via the boot configuration, leading them to wonder
> > why it doesn't work.
> >
> > Let's skip printing out early params to cmdline buffer, and warn
> > if there is such parameters in bootconfig.
> >
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> Reviewed-by: Breno Leitao <leitao@debian.org>
Thanks, but sashiko found a problem.
https://sashiko.dev/#/patchset/177505217508.1807250.22866077077504564.stgit%40mhiramat.tok.corp.google.com
| Will this inadvertently filter out parameters that have both early and
| normal handlers?
| For example, "console" is defined as both an early parameter and a normal
| parameter. If a user configures kernel.console in bootconfig, this loop
| will find the early_param entry and return true.
Let me update it. I need to check (is_early_param() && !is_normal_param()).
Thanks!
>
> > +static bool __init is_early_param(const char *param)
> > +{
> > + const struct obs_kernel_param *p;
> > +
> > + for (p = __setup_start; p < __setup_end; p++) {
> > + if (p->early && parameq(param, p->str))
> > + return true;
> > + }
>
> nit: I don't think you need the parenthesis ({) for the ifs in here.
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
prev parent reply other threads:[~2026-04-02 3:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 14:02 [PATCH] bootconfig: Skip printing early params to cmdline from bootconfig Masami Hiramatsu (Google)
2026-04-01 15:51 ` Breno Leitao
2026-04-02 3:52 ` Masami Hiramatsu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260402125238.a470f6fa5497c55f3484f72d@kernel.org \
--to=mhiramat@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox