WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] No need to emulate WBINVD when VT-d force snoopi

To: Sheng Yang <sheng@xxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] No need to emulate WBINVD when VT-d force snooping feature available
From: Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>
Date: Mon, 5 Jul 2010 10:36:39 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 05 Jul 2010 02:38:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <201007051146.01796.sheng@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <201007051146.01796.sheng@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acsb9SnzbyaJWLr0QXaNyjR+PIRE5QAL3Ghw
Thread-topic: [Xen-devel] [PATCH] No need to emulate WBINVD when VT-d force snooping feature available
> There is no cache coherency issue if VT-d engine's force snooping feature
> available.

Isn't it also necessary to explicitly set the SNP bit in each VTd PTE to force 
snooping? I don't believe we do this today, but since we ignore guest PAT 
settings on RAM we should do so.

Thanks,
Ian

 
> Signed-off-by: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
> 
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1064,8 +1064,10 @@
>           *  1: flushing cache (wbinvd) when the guest is scheduled out if
>           *     there is no wbinvd exit, or
>           *  2: execute wbinvd on all dirty pCPUs when guest wbinvd exits.
> +         * If VT-d engine can force snooping, we don't need to do these.
>           */
> -        if ( has_arch_pdevs(v->domain) && !cpu_has_wbinvd_exiting )
> +        if ( has_arch_pdevs(v->domain) && !iommu_snoop
> +                && !cpu_has_wbinvd_exiting )
>          {
>              int cpu = v->arch.hvm_vmx.active_cpu;
>              if ( cpu != -1 )
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2089,6 +2089,9 @@
>      if ( !has_arch_mmios(current->domain) )
>          return;
> 
> +    if ( iommu_snoop )
> +        return;
> +
>      if ( cpu_has_wbinvd_exiting )
>          on_each_cpu(wbinvd_ipi, NULL, 1);
>      else

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>