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

Re: [Xen-devel] [PATCH] memory: fix XSA-158 fix



On Wed, 2015-12-09 at 03:53 -0700, Jan Beulich wrote:
> For one the uses of domu_max_order and ptdom_max_order were swapped.

> And then gcc warns about an unused result of a __must_check function
> in the control part of a conditional expression when both other
> expressions can be determined by the compiler to produce the same value
> (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68039), which happens
> when HAS_PASSTHROUGH is undefined (i.e. for ARM on 4.4 and older).

Should we issue an updated 158 for all this?

> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> 
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -55,8 +55,6 @@ static unsigned int __read_mostly ctldom
> Âstatic unsigned int __read_mostly hwdom_max_order = CONFIG_HWDOM_MAX_ORDER;
> Â#ifdef HAS_PASSTHROUGH
> Âstatic unsigned int __read_mostly ptdom_max_order = CONFIG_PTDOM_MAX_ORDER;
> -#else
> -# define ptdom_max_order domu_max_order
> Â#endif
> Âstatic void __init parse_max_order(const char *s)
> Â{
> @@ -75,8 +73,12 @@ custom_param("memop-max-order", parse_ma
> Â
> Âstatic unsigned int max_order(const struct domain *d)
> Â{
> -ÂÂÂÂunsigned int order = cache_flush_permitted(d) ? domu_max_order
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ: ptdom_max_order;
> +ÂÂÂÂunsigned int order = domu_max_order;
> +
> +#ifdef HAS_PASSTHROUGH
> +ÂÂÂÂif ( cache_flush_permitted(d) && order < ptdom_max_order )
> +ÂÂÂÂÂÂÂÂorder = ptdom_max_order;
> +#endif
> Â
> ÂÂÂÂÂif ( is_control_domain(d) && order < ctldom_max_order )
> ÂÂÂÂÂÂÂÂÂorder = ctldom_max_order;
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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