linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM64: Add back and fix support for CMDLINE_EXTEND
@ 2025-03-28 10:22 Yeking
  2025-03-28 12:30 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: Yeking @ 2025-03-28 10:22 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: 谢致邦 (XIE Zhibang), Catalin Marinas,
	Will Deacon, Marc Zyngier, Oliver Upton, Mark Brown,
	Andrea della Porta, Ard Biesheuvel, linux-kernel

From: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>

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) <Yeking@Red54.com>
---
 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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-31  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28 10:22 [PATCH] ARM64: Add back and fix support for CMDLINE_EXTEND Yeking
2025-03-28 12:30 ` Russell King (Oracle)
2025-03-31  8:31   ` 谢致邦 (XIE Zhibang)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).