|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5 4/5] x86/mm: put HVM only code under CONFIG_HVM
On Mon, Sep 24, 2018 at 04:58:23PM +0100, George Dunlap wrote:
> On 09/21/2018 04:54 PM, Wei Liu wrote:
> > Going through the code, HAP, EPT, PoD and ALTP2M depend on HVM code.
> > Put these components under CONFIG_HVM. This further requires putting
> > one of the vm event under CONFIG_HVM.
> >
> > Altp2m requires a bit more attention because its code is embedded in
> > generic x86 p2m code.
> >
> > Also make hap_enabled evaluate to false when !CONFIG_HVM. Make sure it
> > evaluate its parameter to avoid unused variable warnings in its users.
> >
> > Also sort items in Makefile while at it.
> >
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> > Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
> > Acked-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
>
> One comment...
>
> > diff --git a/xen/include/asm-x86/altp2m.h b/xen/include/asm-x86/altp2m.h
> > index 64c7618..41fdd82 100644
> > --- a/xen/include/asm-x86/altp2m.h
> > +++ b/xen/include/asm-x86/altp2m.h
> > @@ -18,12 +18,14 @@
> > #ifndef __ASM_X86_ALTP2M_H
> > #define __ASM_X86_ALTP2M_H
> >
> > +#ifdef CONFIG_HVM
> > +
> > #include <xen/types.h>
> > #include <xen/sched.h> /* for struct vcpu, struct domain */
> > #include <asm/hvm/vcpu.h> /* for vcpu_altp2m */
> >
> > /* Alternate p2m HVM on/off per domain */
> > -static inline bool_t altp2m_active(const struct domain *d)
> > +static inline bool altp2m_active(const struct domain *d)
> > {
> > return d->arch.altp2m_active;
> > }
> > @@ -37,5 +39,14 @@ static inline uint16_t altp2m_vcpu_idx(const struct vcpu
> > *v)
> > {
> > return vcpu_altp2m(v).p2midx;
> > }
> > +#else
> > +
> > +static inline bool altp2m_active(const struct domain *d)
> > +{
> > + return false;
> > +}
> > +
> > +uint16_t altp2m_vcpu_idx(const struct vcpu *v);
>
> Hmm, this looks like another, "I assume calls to this function will be
> optimized out in the !CONFIG_HVM case"?
Yes.
>
> I'd appreciate at least a comment when you do that sort of thing. :-)
Will do.
>
> With a comment added:
>
> Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>
Thanks.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |