linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Liu, Yi L" <yi.l.liu@intel.com>
To: Will Deacon <will@kernel.org>
Cc: Lu Baolu <baolu.lu@linux.intel.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"jacob.jun.pan@linux.intel.com" <jacob.jun.pan@linux.intel.com>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	"Tian, Jun J" <jun.j.tian@intel.com>,
	"Sun, Yi Y" <yi.y.sun@intel.com>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices
Date: Thu, 7 Jan 2021 05:22:12 +0000	[thread overview]
Message-ID: <DM5PR11MB1435DA1E9AEE9F25AB06ED9AC3AF0@DM5PR11MB1435.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210105172348.GA12032@willie-the-truck>

Hi Will,

> From: Will Deacon <will@kernel.org>
> Sent: Wednesday, January 6, 2021 1:24 AM
> 
> On Tue, Jan 05, 2021 at 05:50:22AM +0000, Liu, Yi L wrote:
> > > > +static void __iommu_flush_dev_iotlb(struct device_domain_info
> *info,
> > > > +				    u64 addr, unsigned int mask)
> > > > +{
> > > > +	u16 sid, qdep;
> > > > +
> > > > +	if (!info || !info->ats_enabled)
> > > > +		return;
> > > > +
> > > > +	sid = info->bus << 8 | info->devfn;
> > > > +	qdep = info->ats_qdep;
> > > > +	qi_flush_dev_iotlb(info->iommu, sid, info->pfsid,
> > > > +			   qdep, addr, mask);
> > > > +}
> > > > +
> > > >   static void iommu_flush_dev_iotlb(struct dmar_domain *domain,
> > > >   				  u64 addr, unsigned mask)
> > > >   {
> > > > -	u16 sid, qdep;
> > > >   	unsigned long flags;
> > > >   	struct device_domain_info *info;
> > > > +	struct subdev_domain_info *sinfo;
> > > >
> > > >   	if (!domain->has_iotlb_device)
> > > >   		return;
> > > >
> > > >   	spin_lock_irqsave(&device_domain_lock, flags);
> > > > -	list_for_each_entry(info, &domain->devices, link) {
> > > > -		if (!info->ats_enabled)
> > > > -			continue;
> > > > +	list_for_each_entry(info, &domain->devices, link)
> > > > +		__iommu_flush_dev_iotlb(info, addr, mask);
> > > >
> > > > -		sid = info->bus << 8 | info->devfn;
> > > > -		qdep = info->ats_qdep;
> > > > -		qi_flush_dev_iotlb(info->iommu, sid, info->pfsid,
> > > > -				qdep, addr, mask);
> > > > +	list_for_each_entry(sinfo, &domain->subdevices, link_domain) {
> > > > +		__iommu_flush_dev_iotlb(get_domain_info(sinfo->pdev),
> > > > +					addr, mask);
> > > >   	}
> > >
> > > Nit:
> > > 	list_for_each_entry(sinfo, &domain->subdevices, link_domain) {
> > > 		info = get_domain_info(sinfo->pdev);
> > > 		__iommu_flush_dev_iotlb(info, addr, mask);
> > > 	}
> >
> > you are right. this should be better.
> 
> Please can you post a v4, with Lu's acks and the issue reported by Dan fixed
> too?

sure, will send out later.

Regards,
Yi Liu

> Thanks,
> 
> Will

      reply	other threads:[~2021-01-07  5:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29  3:25 [PATCH v3 0/3] iommu/vt-d: Misc fixes on scalable mode Liu Yi L
2020-12-29  3:25 ` [PATCH v3 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev Liu Yi L
2020-12-29  8:34   ` Lu Baolu
2020-12-29  3:25 ` [PATCH v3 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info Liu Yi L
2020-12-29  8:38   ` Lu Baolu
2021-01-05  5:58     ` Liu, Yi L
2020-12-29  3:25 ` [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices Liu Yi L
2020-12-29  8:41   ` Lu Baolu
2021-01-05  5:50     ` Liu, Yi L
2021-01-05 17:23       ` Will Deacon
2021-01-07  5:22         ` Liu, Yi L [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR11MB1435DA1E9AEE9F25AB06ED9AC3AF0@DM5PR11MB1435.namprd11.prod.outlook.com \
    --to=yi.l.liu@intel.com \
    --cc=ashok.raj@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=joro@8bytes.org \
    --cc=jun.j.tian@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=yi.y.sun@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).