From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: [PATCH] No need to emulate WBINVD when VT-d force snooping feature available Date: Mon, 5 Jul 2010 11:46:01 +0800 Message-ID: <201007051146.01796.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_5VVMM5IUR4vKSvA" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --Boundary-00=_5VVMM5IUR4vKSvA Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit There is no cache coherency issue if VT-d engine's force snooping feature available. Signed-off-by: Sheng Yang 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 --Boundary-00=_5VVMM5IUR4vKSvA Content-Type: text/x-patch; charset="UTF-8"; name="iommu_snp_wbinvd.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iommu_snp_wbinvd.patch" 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 --Boundary-00=_5VVMM5IUR4vKSvA Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_5VVMM5IUR4vKSvA--