Re: [PATCH RESEND] x86/boot: Add option to append to the cmdline

From: Brian Mak
Date: Thu Oct 02 2025 - 13:31:00 EST


On Oct 1, 2025, at 5:13 PM, Dave Hansen <dave.hansen@xxxxxxxxx> wrote:

> On 10/1/25 16:04, Brian Mak wrote:
>> To solve this limitation, we add CONFIG_CMDLINE_EXTEND, which is already
>> available on several other architectures, to make the built-in command
>> line append to the bootloader-provided command line.
>
> I'd really rather not have another copy-and-paste of another
> architecture's Kconfig bits into x86.
>
> At the _very_ least, we'd get a boolean ARCH_HAS_CMDLIND_EXTEND which
> would then expose an arch-independent CMDLINE_EXTEND option. Literally
> duplicating Kconfig options just isn't scalable.

Hi Dave,

Thanks for your comments!

Sure, I'll introduce an arch-independent (ARCH_HAS_)CMDLINE_EXTEND option
in v2.

> I also cringe every time I see code like this get added to arch/x86 that
> really doesn't have anything to do with x86 and really only gets dumped
> in to arch/ because there's never been a proper refactoring of all the
> copy-and-pasted code.
>
> In the end, refactoring Kconfig is dirt simple. Refactoring
> builtin_cmdline[] into arch-independent code would be a lot harder.

In the past, there have been efforts to add arch-independent cmdline
processing [1] (CC: Daniel Walker). These efforts have been stalled for a
long time now though.

[1] https://lore.kernel.org/lkml/20231110013817.2378507-1-danielwa@xxxxxxxxx/

Thanks,
Brian