From: "Jan Beulich" Subject: Re: [PATCH v3] IOMMU: Prevent VT-d device IOTLB operations on wrong IOMMU Date: Tue, 17 Jun 2014 16:06:17 +0100 Message-ID: <53A07589020000780001B253@mail.emea.novell.com> References: <0ec71ff08df1f10b1d41.1403015866@malcolmc.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0ec71ff08df1f10b1d41.1403015866@malcolmc.uk.xensource.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: Malcolm Crossley Cc: kevin.tian@intel.com, andrew.cooper3@citrix.com, xen-devel@lists.xen.org, paul.durrant@citrix.com, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 17.06.14 at 16:37, wrote: > --- a/xen/drivers/passthrough/vtd/x86/ats.c > +++ b/xen/drivers/passthrough/vtd/x86/ats.c > @@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *i > { > sid = (pdev->bus << 8) | pdev->devfn; > > + /* Only invalidate devices that belong to this IOMMU */ > + if ( !pdev->iommu || pdev->iommu != iommu ) > + continue; I meant to ask before and then forgot: What is the first half of this condition good/needed for? Jan