[PATCH] ARM64: Add back and fix support for CMDLINE_EXTEND

Subsystems: arm64 port (aarch64 architecture), the rest

STALE559d

3 messages, 2 authors, 2025-03-31 · open the first message on its own page

[PATCH] ARM64: Add back and fix support for CMDLINE_EXTEND

From: <hidden>
Date: 2025-03-28 10:31:06

From: 谢致邦 (XIE Zhibang) <redacted>

After commit e6384c398459 ("efi/libstub: Parse builtin command line
after bootloader provided one"), the behavior of EFI has been consistent
with FDT.

So add back and fix support for CMDLINE_EXTEND.

Fixes: cae118b6acc3 ("arm64: Drop support for CMDLINE_EXTEND")
Signed-off-by: 谢致邦 (XIE Zhibang) <redacted>
---
 arch/arm64/Kconfig                    | 6 ++++++
 arch/arm64/kernel/pi/idreg-override.c | 8 +++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a182295e6f08..736280eb0251 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2427,6 +2427,12 @@ config CMDLINE_FROM_BOOTLOADER
 	  the boot loader doesn't provide any, the default kernel command
 	  string provided in CMDLINE will be used.
 
+config CMDLINE_EXTEND
+	bool "Extend bootloader kernel arguments"
+	help
+	  The default kernel command string will be appended to the
+	  command-line arguments provided by the boot loader.
+
 config CMDLINE_FORCE
 	bool "Always use the default kernel command string"
 	help
diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c
index c6b185b885f7..cff403477ff5 100644
--- a/arch/arm64/kernel/pi/idreg-override.c
+++ b/arch/arm64/kernel/pi/idreg-override.c
@@ -382,11 +382,13 @@ static __init void parse_cmdline(const void *fdt, int chosen)
 	static char const cmdline[] __initconst = CONFIG_CMDLINE;
 	const u8 *prop = get_bootargs_cmdline(fdt, chosen);
 
-	if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop)
-		__parse_cmdline(cmdline, true);
-
 	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop)
 		__parse_cmdline(prop, true);
+
+	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||
+	    IS_ENABLED(CONFIG_CMDLINE_FORCE) ||
+	    !prop)
+		__parse_cmdline(cmdline, true);
 }
 
 void __init init_feature_override(u64 boot_status, const void *fdt,
-- 
2.43.0

Re: [PATCH] ARM64: Add back and fix support for CMDLINE_EXTEND

From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2025-03-28 12:30:59

On Fri, Mar 28, 2025 at 10:22:34AM +0000, Yeking@Red54.com wrote:
From: 谢致邦 (XIE Zhibang) <redacted>

After commit e6384c398459 ("efi/libstub: Parse builtin command line
after bootloader provided one"), the behavior of EFI has been consistent
with FDT.

So add back and fix support for CMDLINE_EXTEND.

Fixes: cae118b6acc3 ("arm64: Drop support for CMDLINE_EXTEND")
Signed-off-by: 谢致邦 (XIE Zhibang) <redacted>
This breaks the ability for the user (via the boot loader) to override
built-in arguments.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Re: Re: [PATCH] ARM64: Add back and fix support for CMDLINE_EXTEND

From: 谢致邦 (XIE Zhibang) <hidden>
Date: 2025-03-31 08:33:00

This breaks the ability for the user (via the boot loader) to override
built-in arguments.
How does a non-default configuration break the ability you're talking about? If
you insist, why not remove the non-default CMDLINE_FORCE as well?

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help