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

Re: [Xen-devel] [PATCH v3] VT-d PI: disable VT-d PI when APICv is disabled



>>> On 09.06.17 at 08:22, <chao.gao@xxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -351,6 +351,13 @@ static int vmx_init_vmcs_config(void)
>            || !(_vmx_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT) )
>          _vmx_pin_based_exec_control  &= ~ PIN_BASED_POSTED_INTERRUPT;
>  
> +    if ( iommu_intpost && !cpu_has_vmx_posted_intr_processing )
> +    {
> +        printk("Intel VT-d Posted Interrupt is disabled for CPU-side Posted "
> +               "Interrupt is not enabled\n");
> +        iommu_intpost = 0;
> +    }

So simply clearing iommu_intpost here indeed looks to be fine (at
least for all current uses of the flag). However, previously you
had a dependency on APIC-V being enabled, and there not longer
is such a dependency with the check above -
posted_intr_processing is being forced to off only when
!vmx_virtual_intr_delivery or ACK_INTR_ON_EXIT not being set
(the latter btw is strange as a check, as that feature is being
requested as "minimum", not "optional").

And then I have a flow question here:
cpu_has_vmx_posted_intr_processing expands to a reference to
vmx_pin_based_exec_control, yet that variable is being written
only later in the function, so it would seem to me that now you
turn off iommu_intpost unconditionally. Am I overlooking anything?
Otherwise I think you need to use _vmx_pin_based_exec_control
here instead, just like the code visible in context does.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.