From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86: eliminate has_arch_mmios() Date: Tue, 12 Nov 2013 13:37:15 +0000 Message-ID: References: <528238A9020000780010257F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgE9q-0008Sb-CT for xen-devel@lists.xenproject.org; Tue, 12 Nov 2013 13:37:30 +0000 Received: by mail-we0-f180.google.com with SMTP id q59so5866721wes.25 for ; Tue, 12 Nov 2013 05:37:28 -0800 (PST) In-Reply-To: <528238A9020000780010257F@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On 12/11/2013 13:18, "Jan Beulich" wrote: > ... 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 Acked-by: Keir Fraser > --- 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) > > 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); > } > > --- 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) > > 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; > > 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; > > #define has_arch_pdevs(d) (!list_empty(&(d)->arch.pdev_list)) > -#define has_arch_mmios(d) (!rangeset_is_empty((d)->iomem_caps)) > > #define gdt_ldt_pt_idx(v) \ > ((v)->vcpu_id >> (PAGETABLE_ORDER - GDT_LDT_VCPU_SHIFT)) > > >