[PATCH RFC v2 04/54] s390/boot: stop parsing the command line at "--"

Mike Rapoport (Microsoft) rppt at kernel.org
Thu Nov 26 03:14:17 PST 2026


The kernel parses its parameters up to "--" and passes everything after it
to init. The decompressor parses the whole command line, so an argument
meant for init still takes effect in the decompressor if it has the name of
a parameter the decompressor knows, like "mem=".

Stop at "--", like parse_args() does.

Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
---
 arch/s390/boot/ipl_parm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/s390/boot/ipl_parm.c b/arch/s390/boot/ipl_parm.c
index 8bbd102fa50f..ed28ea2fc1d1 100644
--- a/arch/s390/boot/ipl_parm.c
+++ b/arch/s390/boot/ipl_parm.c
@@ -268,6 +268,10 @@ void parse_boot_command_line(void)
 	while (*args) {
 		args = next_arg(args, &param, &val);
 
+		/* The arguments after "--" are for init */
+		if (!val && !strcmp(param, "--"))
+			break;
+
 		if (!strcmp(param, "mem") && val)
 			memory_limit = round_down(memparse(val, NULL), PAGE_SIZE);
 

-- 
2.53.0




More information about the linux-riscv mailing list