]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen/cmdline: Work around some specific command line warnings
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Jan 2019 19:07:40 +0000 (19:07 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 30 Jan 2019 17:27:44 +0000 (17:27 +0000)
Xen will warn when an unknown parameter is found in the command line.  e.g.

  (d8) [ 1556.334664] (XEN) parameter "pv-shim" unknown!

One case where this goes wrong is a workaround for an old grub bug, which
resulted in "placeholder" being prepended to the command line.

Another case is when booting a CONFIG_PV_SHIM_EXCLUSIVE build, in which the
parsing for the "pv-shim" parameter is discarded.

Introduce ignore_param() and OPT_IGNORE to cope with known cases, where
issuing a warning is the wrong course of action to take.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/pv/shim.c
xen/arch/x86/setup.c
xen/common/kernel.c
xen/include/xen/init.h

index 636a9d6a10daefea1c7ac73ed7b20ec548903312..324ca27f93acbf6f6df1b629068e2b31ba32f0f2 100644 (file)
 #undef virt_to_mfn
 #define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#ifdef CONFIG_PV_SHIM_EXCLUSIVE
+/* Tolerate "pv-shim" being passed to a CONFIG_PV_SHIM_EXCLUSIVE hypervisor. */
+ignore_param("pv-shim");
+#else
 bool pv_shim;
 boolean_param("pv-shim", pv_shim);
 #endif
index 06eb483cb48b63db4a41a291ff363b909563fd5e..92da060915ed55a9294caa08b2748aea6b7c32c7 100644 (file)
@@ -639,6 +639,12 @@ static void __init noreturn reinit_bsp_stack(void)
     reset_stack_and_jump(init_done);
 }
 
+/*
+ * Some scripts add "placeholder" to work around a grub error where it ate the
+ * first parameter.
+ */
+ignore_param("placeholder");
+
 static bool __init loader_is_grub2(const char *loader_name)
 {
     /* GRUB1="GNU GRUB 0.xx"; GRUB2="GRUB 1.xx" */
index 053c31d39158a5e894444f68c15cb84a316171b5..612575430f1ce7faf5bd66e7a99f1758c63fb3cb 100644 (file)
@@ -162,6 +162,8 @@ static int parse_params(const char *cmdline, const struct kernel_param *start,
                 }
                 rctmp = param->par.func(optval);
                 break;
+            case OPT_IGNORE:
+                break;
             default:
                 BUG();
                 break;
index c6b453adfe2fc57bd542c459e85ba19cbd37e9f9..d0f3a007d0f441464b97b06f3bd228daae755281 100644 (file)
@@ -81,7 +81,8 @@ struct kernel_param {
         OPT_UINT,
         OPT_BOOL,
         OPT_SIZE,
-        OPT_CUSTOM
+        OPT_CUSTOM,
+        OPT_IGNORE,
     } type;
     unsigned int len;
     union {
@@ -136,6 +137,11 @@ extern const struct kernel_param __param_start[], __param_end[];
           .type = OPT_STR, \
           .len = sizeof(_var), \
           .par.var = &_var }
+#define ignore_param(_name)                 \
+    __setup_str setup_str_ign[] = _name;    \
+    __kparam setup_ign =                    \
+        { .name = setup_str_ign,            \
+          .type = OPT_IGNORE }
 
 #define __rtparam         __param(__dataparam)