From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [PATCH 1/3] xen/vt-d: need barriers to workaround CLFLUSH Date: Wed, 06 May 2015 14:47:02 +0800 Message-ID: <5549B8E6.20802@intel.com> References: <1430705771-6744-1-git-send-email-tiejun.chen@intel.com> <55474F790200007800076334@mail.emea.novell.com> <55474C7C.4000909@intel.com> <554769870200007800076468@mail.emea.novell.com> <55482ED9.8050208@intel.com> <5548A86B02000078000768CD@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5548A86B02000078000768CD@mail.emea.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 Cc: kevin.tian@intel.com, keir@xen.org, jinsong.liu@alibaba-inc.com, xen-devel@lists.xen.org, andrew.cooper3@citrix.com, yang.z.zhang@intel.com, boris.ostrovsky@oracle.com List-Id: xen-devel@lists.xenproject.org On 2015/5/5 17:24, Jan Beulich wrote: >>>> On 05.05.15 at 04:45, wrote: >> Does this work for everyone? > > Please first of all explain why the interfaces in asm/flushtlb.h can't > be used here (at least when flushing entire pages). Because - as I also don't understand any reason we didn't use this previously on IOMMU side... > said before - for a complete fix you'd need to deal with the CLFLUSH > use(s) elsewhere in the system too. Looks we need to do this in xen/arch/x86/flushtlb.c:flush_area_local(). > > Btw, isn't the !iommus_incoherent check in that function inverted? > I.e. why would we _not_ need to flush caches when IOMMUs > are not coherent (and why would flushing be needed when they're > coherent anyway)? > I guess you're misunderstanding this if ( !ecap_coherent(iommu->ecap) ) iommus_incoherent = 1; So here !iommus_incoherent means IOMMU is coherent and then we don't need to flush cache in this case. Thanks Tiejun