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

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



>>> On 01.06.17 at 18:00, <chao.gao@xxxxxxxxx> wrote:
> From the context calling pi_desc_init(), we can conclude the current
> implementation of VT-d PI depends on CPU-side PI. If we disable APICv
> but enable VT-d PI explicitly in xen boot command line, we would get
> an assertion failure.
> 
> This patch disables VT-d PI when APICv is disabled and adds some
> related description to docs.

There's no S-o-b here.

> --- a/docs/misc/xen-command-line.markdown
> +++ b/docs/misc/xen-command-line.markdown
> @@ -1001,7 +1001,8 @@ debug hypervisor only).
>  > Default: `false`
>  
>  >> Control the use of interrupt posting, which depends on the availability of
> ->> interrupt remapping.
> +>> interrupt remapping and CPU-side interrupt posting which requires APIC
> +>> Virtualization Extension is enabled.

"... interrupt posting, which in turn requires ..."?

Also APIC-V is default on, so maybe it would be better to say "is
not disabled" and perhaps even cross reference the other command
line option.

> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -47,7 +47,7 @@ boolean_param("vpid", opt_vpid_enabled);
>  static bool_t __read_mostly opt_unrestricted_guest_enabled = 1;
>  boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled);
>  
> -static bool_t __read_mostly opt_apicv_enabled = 1;
> +bool_t __read_mostly opt_apicv_enabled = 1;

If you touch such code, please switch to bool/true/false at once.

> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -41,6 +41,8 @@
>  #include "vtd.h"
>  #include "../ats.h"
>  
> +extern bool_t opt_apicv_enabled;

No. Declarations need to go into a header which is being included
by both producer and consumer(s).

> @@ -2266,8 +2268,10 @@ int __init intel_vtd_setup(void)
>           * We cannot use posted interrupt if X86_FEATURE_CX16 is
>           * not supported, since we count on this feature to
>           * atomically update 16-byte IRTE in posted format.
> +         * VT-d PI implementation relies on VMX PI. Thus, disable
> +         * VT-d PI when VMX PI is disabled.
>           */
> -        if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 )
> +        if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 || 
> !opt_apicv_enabled )
>              iommu_intpost = 0;

Comment and code seem out of sync (talking about PI but
checking APIC-V).

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