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

Re: [Xen-devel] [RFC v2 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor



>>> On 08.05.15 at 11:07, <feng.wu@xxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/hvm/vmx/vmx.h
> +++ b/xen/include/asm-x86/hvm/vmx/vmx.h
> @@ -28,6 +28,9 @@
>  #include <asm/hvm/support.h>
>  #include <asm/hvm/trace.h>
>  #include <asm/hvm/vmx/vmcs.h>
> +#include <asm/apic.h>
> +
> +extern uint8_t posted_intr_vector;
>  
>  typedef union {
>      struct {
> @@ -125,6 +128,22 @@ static inline unsigned long pi_get_pir(struct pi_desc 
> *pi_desc, int group)
>      return xchg(&pi_desc->pir[group], 0);
>  }
>  
> +#define PI_xAPIC_NDST_MASK   0xFF00
> +
> +static inline void pi_desc_init(struct vcpu *v)
> +{
> +    uint32_t dest;
> +
> +    v->arch.hvm_vmx.pi_desc.nv = posted_intr_vector;
> +
> +    dest = cpu_physical_id(v->processor);
> +
> +    if ( x2apic_enabled )
> +        v->arch.hvm_vmx.pi_desc.ndst = dest;
> +    else
> +        v->arch.hvm_vmx.pi_desc.ndst = MASK_INSR(dest, PI_xAPIC_NDST_MASK);
> +}

Unless this is going to be needed outside of vmcs.c this shouldn't
be in a header file (and probably also not be inline).

> @@ -244,7 +263,6 @@ static inline unsigned long pi_get_pir(struct pi_desc 
> *pi_desc, int group)
>  #define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
>  
>  extern u64 vmx_ept_vpid_cap;
> -extern uint8_t posted_intr_vector;

Which then also eliminates the need to move this declaration.

Jan


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