From: "Jan Beulich" Subject: Re: [PATCH 1/3] xen/vt-d: need barriers to workaround CLFLUSH Date: Wed, 06 May 2015 08:14:23 +0100 Message-ID: <5549DB6F0200007800076EF3@mail.emea.novell.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> <5549B8E6.20802@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5549B8E6.20802@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tiejun Chen 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 06.05.15 at 08:47, wrote: > On 2015/5/5 17:24, Jan Beulich wrote: >> 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. Ah, indeed - I overlooked the "in" in the variable name (together with the thus resulting double negation in the expression). Sorry for the noise. Jan