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>
#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
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" */
}
rctmp = param->par.func(optval);
break;
+ case OPT_IGNORE:
+ break;
default:
BUG();
break;
OPT_UINT,
OPT_BOOL,
OPT_SIZE,
- OPT_CUSTOM
+ OPT_CUSTOM,
+ OPT_IGNORE,
} type;
unsigned int len;
union {
.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)