From: "Jan Beulich" Subject: [PATCH] x86: eliminate has_arch_mmios() Date: Tue, 12 Nov 2013 13:18:16 +0000 Message-ID: <528238A9020000780010257F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1A29C788.0__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgDrK-000722-Mi for xen-devel@lists.xenproject.org; Tue, 12 Nov 2013 13:18:22 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part1A29C788.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... as being generally insufficient: Either has_arch_pdevs() or cache_flush_permitted() should be used (in particular, it is insufficient to consider MMIO ranges alone - I/O port ranges have the same requirements if available to a guest). Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -1973,7 +1974,7 @@ static void wbinvd_ipi(void *info) =20 static void svm_wbinvd_intercept(void) { - if ( has_arch_mmios(current->domain) ) + if ( cache_flush_permitted(current->domain) ) on_each_cpu(wbinvd_ipi, NULL, 1); } =20 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -2236,10 +2237,7 @@ static void wbinvd_ipi(void *info) =20 static void vmx_wbinvd_intercept(void) { - if ( !has_arch_mmios(current->domain) ) - return; - - if ( iommu_snoop ) + if ( !cache_flush_permitted(current->domain) || iommu_snoop ) return; =20 if ( cpu_has_wbinvd_exiting ) --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -316,7 +316,6 @@ struct arch_domain } __cacheline_aligned; =20 #define has_arch_pdevs(d) (!list_empty(&(d)->arch.pdev_list)) -#define has_arch_mmios(d) (!rangeset_is_empty((d)->iomem_caps)) =20 #define gdt_ldt_pt_idx(v) \ ((v)->vcpu_id >> (PAGETABLE_ORDER - GDT_LDT_VCPU_SHIFT)) --=__Part1A29C788.0__= Content-Type: text/plain; name="x86-drop-has_arch_mmios.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-drop-has_arch_mmios.patch" x86: eliminate has_arch_mmios()=0A=0A... as being generally insufficient: = Either has_arch_pdevs() or=0Acache_flush_permitted() should be used (in = particular, it is=0Ainsufficient to consider MMIO ranges alone - I/O port = ranges have the=0Asame requirements if available to a guest).=0A=0ASigned-o= ff-by: Jan Beulich =0A=0A--- a/xen/arch/x86/hvm/svm/svm.= c=0A+++ b/xen/arch/x86/hvm/svm/svm.c=0A@@ -40,6 +40,7 @@=0A #include = =0A #include =0A #include =0A+#inclu= de =0A #include =0A #include =0A #include =0A@@ -1973,7 +1974,7 @@ static void = wbinvd_ipi(void *info)=0A =0A static void svm_wbinvd_intercept(void)=0A = {=0A- if ( has_arch_mmios(current->domain) )=0A+ if ( cache_flush_per= mitted(current->domain) )=0A on_each_cpu(wbinvd_ipi, NULL, 1);=0A = }=0A =0A--- a/xen/arch/x86/hvm/vmx/vmx.c=0A+++ b/xen/arch/x86/hvm/vmx/vmx.c= =0A@@ -28,6 +28,7 @@=0A #include =0A #include = =0A #include =0A+#include =0A #include = =0A #include =0A #include =0A@@ = -2236,10 +2237,7 @@ static void wbinvd_ipi(void *info)=0A =0A static void = vmx_wbinvd_intercept(void)=0A {=0A- if ( !has_arch_mmios(current->domain= ) )=0A- return;=0A-=0A- if ( iommu_snoop )=0A+ if ( !cache_flu= sh_permitted(current->domain) || iommu_snoop )=0A return;=0A =0A = if ( cpu_has_wbinvd_exiting )=0A--- a/xen/include/asm-x86/domain.h=0A+++ = b/xen/include/asm-x86/domain.h=0A@@ -316,7 +316,6 @@ struct arch_domain=0A = } __cacheline_aligned;=0A =0A #define has_arch_pdevs(d) (!list_empty(&(d= )->arch.pdev_list))=0A-#define has_arch_mmios(d) (!rangeset_is_empty((d)= ->iomem_caps))=0A =0A #define gdt_ldt_pt_idx(v) \=0A ((v)->vcpu_id = >> (PAGETABLE_ORDER - GDT_LDT_VCPU_SHIFT))=0A --=__Part1A29C788.0__= 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.xen.org http://lists.xen.org/xen-devel --=__Part1A29C788.0__=--