]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/setup: Ignore early boot parameters like no-real-mode
authorTrammell Hudson <hudson@trmm.net>
Wed, 12 Aug 2020 17:42:48 +0000 (17:42 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 13 Aug 2020 11:42:24 +0000 (12:42 +0100)
There are parameters in xen/arch/x86/boot/cmdline.c that
are only used early in the boot process, so handlers are
necessary to avoid an "Unknown command line option" in
dmesg.

This also updates ignore_param() to generate a temporary
variable name so that the macro can be used more than once
per file.

Signed-off-by: Trammell hudson <hudson@trmm.net>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
[Leave note to stop TEMP_NAME() finding more general use]
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/setup.c
xen/include/xen/param.h

index c9b6af826da0ac18bab9d07d696f12fe371f8b87..4b15e067fa1bfa3b1a2010f016bfd7af75bad0d9 100644 (file)
@@ -679,6 +679,15 @@ static void __init noreturn reinit_bsp_stack(void)
     reset_stack_and_jump_nolp(init_done);
 }
 
+/*
+ * x86 early command line parsing in xen/arch/x86/boot/cmdline.c
+ * has options that are only used during the very initial boot process,
+ * so they can be ignored now.
+ */
+ignore_param("no-real-mode");
+ignore_param("edd");
+ignore_param("edid");
+
 /*
  * Some scripts add "placeholder" to work around a grub error where it ate the
  * first parameter.
index c2fd075dd0018aec8d54d8185fe74929294da139..f4be944248df3b679e09e3d363ee5c9d1cf75a27 100644 (file)
@@ -35,6 +35,11 @@ extern const struct kernel_param __setup_start[], __setup_end[];
     __attribute__((__aligned__(1))) char
 #define __kparam          __param(__initsetup)
 
+/* Only for use with .init data, to avoid creating livepatch problems. */
+#define __TEMP_NAME(base, line) base ## _ ## line
+#define _TEMP_NAME(base, line) __TEMP_NAME(base, line)
+#define TEMP_NAME(base) _TEMP_NAME(base, __LINE__)
+
 #define custom_param(_name, _var) \
     __setup_str __setup_str_##_var[] = _name; \
     __kparam __setup_##_var = \
@@ -71,9 +76,9 @@ extern const struct kernel_param __setup_start[], __setup_end[];
           .len = sizeof(_var), \
           .par.var = &_var }
 #define ignore_param(_name)                 \
-    __setup_str setup_str_ign[] = _name;    \
-    __kparam setup_ign =                    \
-        { .name = setup_str_ign,            \
+    __setup_str TEMP_NAME(__setup_str_ign)[] = _name;    \
+    __kparam TEMP_NAME(__setup_ign) =                    \
+        { .name = TEMP_NAME(__setup_str_ign),            \
           .type = OPT_IGNORE }
 
 #ifdef CONFIG_HYPFS