[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 for-4.12] xen/cmdline: Work around some specific command line warnings



On Wed, Jan 30, 2019 at 05:16:47PM +0000, Andrew Cooper wrote:
> On 30/01/2019 17:07, Andrew Cooper wrote:
> > On 30/01/2019 16:31, Juergen Gross wrote:
> >> On 30/01/2019 16:55, Andrew Cooper wrote:
> >>> 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
> >>> warning the user is the wrong course of action to take.
> >>>
> >>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> >>> ---
> >>> CC: Jan Beulich <JBeulich@xxxxxxxx>
> >>> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> >>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> >>> CC: Juergen Gross <jgross@xxxxxxxx>
> >>>
> >>> v2:
> >>>  * Rewrite from scratch, following Juergen's suggestion
> >>>
> >>> An implementation detail of ignore_param() is that it can only be used 
> >>> once
> >>> per translation unit, which is fine for now.  Two options to fix this are 
> >>> to
> >>> tokenise __LINE__ in (requires some extreme preprocessor magic to make 
> >>> work,
> >>> as ## inhibits expansion, and may cause livepatching issues), or to 
> >>> retain the
> >>> _val parameter and require callers to just pass in a unique string.
> >> Or make the unique string an optional parameter via:
> >>
> >> #define ignore_param(_name, uniq...)                \
> >>     __setup_str __setup_str_ign ## uniq[] = _name;  \
> >>     __kparam __setup_ign ## uniq =                  \
> >>         { .name = __setup_str_ign ## uniq,          \
> >>           .type = OPT_IGNORE }
> >>
> >> With or without that change:
> >>
> >> Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
> >> Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
> > Actually I like this as an option.
> 
> Sadly, it doesn't work, as you end up with:
> 
> __setup_str setup_str_ign_ ## [] = "pv-shim";
> 
> and ## is a binary operator.
> 
> I'll leave it as-was and we can figure this out in the future if necessary.

Sigh. This means you can't have two ignore_param in the same CU.

I was trying to use this for "flask" and "silo" and (re)discovered this
issue in the hard way.

Wei.

> 
> ~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.