[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] xen/cmdline: Work around some specific command line warnings
commit 68cda62e50c34f938747c1558117ee2c37134b30 Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> AuthorDate: Tue Jan 29 19:07:40 2019 +0000 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Wed Jan 30 17:27:44 2019 +0000 xen/cmdline: Work around some specific command line warnings 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@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Juergen Gross <jgross@xxxxxxxx> Release-acked-by: Juergen Gross <jgross@xxxxxxxx> --- xen/arch/x86/pv/shim.c | 5 ++++- xen/arch/x86/setup.c | 6 ++++++ xen/common/kernel.c | 2 ++ xen/include/xen/init.h | 8 +++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c index 636a9d6a10..324ca27f93 100644 --- a/xen/arch/x86/pv/shim.c +++ b/xen/arch/x86/pv/shim.c @@ -40,7 +40,10 @@ #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 diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 06eb483cb4..92da060915 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -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" */ diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 053c31d391..612575430f 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -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; diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h index c6b453adfe..d0f3a007d0 100644 --- a/xen/include/xen/init.h +++ b/xen/include/xen/init.h @@ -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) -- generated by git-patchbot for /home/xen/git/xen.git#staging _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |