Re: [PATCH v2] bootconfig: Apply early options from embedded config

From
Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date
2026-03-31 00:00:03
Also in
linux-doc, lkml
Reply to
Breno Leitao, 2026-03-30
On Mon, 30 Mar 2026 06:15:17 -0700
Breno Leitao [off-list ref] wrote:
On Fri, Mar 27, 2026 at 10:37:44PM +0900, Masami Hiramatsu wrote:
quoted
On Fri, 27 Mar 2026 03:06:41 -0700
Breno Leitao [off-list ref] wrote:
quoted
quoted
quoted
To fix this, we need to change setup_arch() for each architecture so
that it calls this bootconfig_apply_early_params().
Could we instead integrate this into parse_early_param() itself? That
approach would avoid the need to modify each architecture individually.
Ah, indeed. 
I investigated integrating bootconfig into parse_early_param() and hit a
blocker: xbc_init() and xbc_make_cmdline() depend on memblock_alloc(), but on
most architectures (x86, arm64, arm, s390, riscv) parse_early_param() is called
from setup_arch() _before_ memblock is initialized.
Yeah, that's right.
So, bootconfig will not be available as early as parse_early_param(). 

An alternative is replace memblock allocations in lib/bootconfig.c with static
__initdata buffers, similar to Petr's approach in 2023:

	https://lore.kernel.org/all/20231121231342.193646-3-oss@malat.biz/ (local)

But, there was concerns about the allocation size:

	Petr Malat [off-list ref] wrote: 
	> To allow handling of early options, it's necessary to eliminate allocations
	> from embedded bootconfig handling

	"Hm, my concern is that this can introduce some sort of overhead to parse the bootconfig."
As far as we can correctly handle the early params and it is limited only
with the embedded bootconfig, I think it is OK to allocate it statically.

Thank you,


-- 
Masami Hiramatsu (Google) [off-list ref]
Thread (22 messages) 22 messages, 3 authors, last reply 2026-04-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help