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

Re: [Xen-devel] [PATCH v2 3/6] x86/hvm/domain: remove the 'hap_enabled' flag



> -----Original Message-----
> From: Jan Beulich <JBeulich@xxxxxxxx>
> Sent: 29 July 2019 15:36
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; Andrew Cooper 
> <Andrew.Cooper3@xxxxxxxxxx>; Roger Pau Monne
> <roger.pau@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>
> Subject: Re: [PATCH v2 3/6] x86/hvm/domain: remove the 'hap_enabled' flag
> 
> On 25.07.2019 15:39, Paul Durrant wrote:
> > @@ -195,11 +194,9 @@ struct hvm_domain {
> >       };
> >   };
> >
> > -#ifdef CONFIG_HVM
> > -#define hap_enabled(d)  (is_hvm_domain(d) && (d)->arch.hvm.hap_enabled)
> > -#else
> > -#define hap_enabled(d)  ({(void)(d); false;})
> > -#endif
> > +#define hap_enabled(d) \
> > +    (hvm_hap_supported() && is_hvm_domain(d) && \
> > +     evaluate_nospec(d->options & XEN_DOMCTL_CDF_hap))
> 
> Rather than adding yet another && here I think you want to
> reject XEN_DOMCTL_CDF_hap in arch_sanitise_domain_config()
> when !hvm_hap_supported(). Similarly the is_hvm_domain()
> could then also be eliminated by checking that CDF_hap is
> set only together with CDF_hvm (or by clearing CDF_hap if
> CDF_hvm is clear - depends on what compatibility needs
> there are.
> 
> This would then also eliminate the double evaluation of
> "d".

Oh yes, that's neater. I'll do that, and also fix up patch #2.

  Paul

> 
> Jan
_______________________________________________
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®.