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.l...@citrix.com>
> Acked-by: Jan Beulich <jbeul...@suse.com>
> Acked-by: Tamas K Lengyel <ta...@tklengyel.com>

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"?

I'd appreciate at least a comment when you do that sort of thing. :-)

With a comment added:

Reviewed-by: George Dunlap <george.dun...@citrix.com>

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

Reply via email to