public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	 linux-doc@vger.kernel.org, oss@malat.biz, paulmck@kernel.org,
	rostedt@goodmis.org,  kernel-team@meta.com
Subject: Re: [PATCH v2] bootconfig: Apply early options from embedded config
Date: Wed, 1 Apr 2026 08:01:48 -0700	[thread overview]
Message-ID: <ac0wz_eW5Zgi4t45@gmail.com> (raw)
In-Reply-To: <20260401224853.d8ed517a344c4be51d371a9c@kernel.org>

On Wed, Apr 01, 2026 at 10:48:53PM +0900, Masami Hiramatsu wrote:

> > The challenge extends beyond that. There are numerous early_parameter()
> > definitions scattered throughout the kernel that may or may not be
> > utilized by setup_arch().
> >
> > For example, consider `early_param("mitigations", ..)` in
> > ./kernel/cpu.c. This modifies the cpu_mitigations global variable, which
> > is referenced in various locations across different architectures.
> >
> > It's worth noting that we have over 300 early_parameter() instances in
> > the kernel.
> >
> > Given this, analyzing all these early parameters and examining each one
> > individually represents a substantial amount of work.
>
> Yes, that may require a substantial amount of work. But to improve
> the kernel framework around the parameter handling, eventually we
> need to examine each early parameter.

I'm still uncertain about this approach. The goal is to identify and
categorize the early parameters that are parsed prior to bootconfig
initialization.

Moreover, this work could become obsolete if bootconfig's initialization
point shifts earlier or later in the boot sequence, necessitating
another comprehensive analysis.

Conversely, if we successfully move bootconfig initialization earlier
by breaking the dependency of memblock (assuming this is feasible), the
vast majority of early parameters would execute after bootconfig is
configured, eliminating the need for this extensive categorization work.

Please, feel free to tell what approach might be better for the project.

> > Are there alternative approaches? At this point, I'm leaning toward
> > breaking bootconfig's dependency on memblock, allowing us to invoke it
> > before setup_arch(). Is this the only practical solution available?!
>
> Basically, the memblock dependency comes from allocating copy of data.
> Only for the embedded bootconfig, we can just pass copy memory block
> to the xbc_init(). Something like;
>
> xbc_init() {
>  xbc_data = memblock_alloc();
>  memcpy(xbc_data, data);
>  __xbc_init(xbc_data);
> }
>
> embedded_xbc_init() {
>   __xbc_init(embedded_bootconfig_data);
> }
>
> Afterwards, we can pass mixture of embedded bootcofnigt and initrd
> bootconfig data to parser again.
>
> (But in this case, we must be careful not to override the early
>  parameters that we have already applied.)

Do you have any additional recommendations if I proceed with this
approach?

Thank you for your detailed responses and insights.
--breno

  reply	other threads:[~2026-04-01 15:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 10:05 [PATCH v2] bootconfig: Apply early options from embedded config Breno Leitao
2026-03-25 14:22 ` Masami Hiramatsu
2026-03-26 14:30   ` Masami Hiramatsu
2026-03-27 10:18     ` Breno Leitao
2026-03-27 14:16       ` Masami Hiramatsu
2026-03-27 16:11         ` Breno Leitao
2026-03-27 10:06   ` Breno Leitao
2026-03-27 13:37     ` Masami Hiramatsu
2026-03-30 13:15       ` Breno Leitao
2026-03-30 15:04         ` Breno Leitao
2026-03-31  3:58           ` Masami Hiramatsu
2026-03-31 15:27             ` Breno Leitao
2026-04-01 13:48               ` Masami Hiramatsu
2026-04-01 15:01                 ` Breno Leitao [this message]
2026-04-03  2:45                   ` Masami Hiramatsu
2026-03-31  0:00         ` Masami Hiramatsu
2026-03-31 10:18   ` Kiryl Shutsemau
2026-04-01  1:02     ` Masami Hiramatsu
2026-04-01  9:40       ` Kiryl Shutsemau

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=ac0wz_eW5Zgi4t45@gmail.com \
    --to=leitao@debian.org \
    --cc=corbet@lwn.net \
    --cc=kernel-team@meta.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=oss@malat.biz \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.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