> -----Original Message-----
> From: Xen-devel <xen-devel-boun...@lists.xenproject.org> On Behalf Of Paul 
> Durrant
> Sent: 25 July 2019 11:08
> To: Roger Pau Monne <roger....@citrix.com>
> Cc: xen-devel@lists.xenproject.org; Wei Liu <w...@xen.org>; Jan Beulich 
> <jbeul...@suse.com>; Andrew
> Cooper <andrew.coop...@citrix.com>
> Subject: Re: [Xen-devel] [PATCH 3/6] x86/hvm/domain: remove the 'hap_enabled' 
> flag
> 
> > -----Original Message-----
> > From: Roger Pau Monne <roger....@citrix.com>
> > Sent: 25 July 2019 10:44
> > To: Paul Durrant <paul.durr...@citrix.com>
> > Cc: xen-devel@lists.xenproject.org; Jan Beulich <jbeul...@suse.com>; Andrew 
> > Cooper
> > <andrew.coop...@citrix.com>; Wei Liu <w...@xen.org>
> > Subject: Re: [PATCH 3/6] x86/hvm/domain: remove the 'hap_enabled' flag
> >
> > On Tue, Jul 23, 2019 at 05:06:06PM +0100, Paul Durrant wrote:
> > > -#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->createflags & XEN_DOMCTL_CDF_hap))
> >
> > You could make this an inline function while at it AFAICT.
> 
> Yeah, that's not a bad idea.
> 

Alas this turns out to be a can of worms. As an inline function I cannot call 
is_hvm_domain() from here which, I guess, is why it’s a macro at the moment. 
Also I cannot dereference d->createflags (a.k.a. options) as the definition of 
struct domain is not available.

  Paul

>   Paul
> 
> >
> > Thanks, Roger.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to