All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: "Liu, Yi L" <yi.l.liu@intel.com>
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: Tue, 5 Jan 2021 17:23:49 +0000	[thread overview]
Message-ID: <20210105172348.GA12032@willie-the-truck> (raw)
In-Reply-To: <DM5PR11MB1435E814408F19A947263C07C3D10@DM5PR11MB1435.namprd11.prod.outlook.com>

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?

Thanks,

Will

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: "Liu, Yi L" <yi.l.liu@intel.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	"Tian, Jun J" <jun.j.tian@intel.com>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Sun, Yi Y" <yi.y.sun@intel.com>
Subject: Re: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices
Date: Tue, 5 Jan 2021 17:23:49 +0000	[thread overview]
Message-ID: <20210105172348.GA12032@willie-the-truck> (raw)
In-Reply-To: <DM5PR11MB1435E814408F19A947263C07C3D10@DM5PR11MB1435.namprd11.prod.outlook.com>

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?

Thanks,

Will
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2021-01-05 17:24 UTC|newest]

Thread overview: 26+ 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 ` 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  3:25   ` Liu Yi L
2020-12-29  8:34   ` Lu Baolu
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  3:25   ` Liu Yi L
2020-12-29  8:38   ` Lu Baolu
2020-12-29  8:38     ` Lu Baolu
2021-01-05  5:58     ` Liu, Yi L
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  3:25   ` Liu Yi L
2020-12-29  8:41   ` Lu Baolu
2020-12-29  8:41     ` Lu Baolu
2021-01-05  5:50     ` Liu, Yi L
2021-01-05  5:50       ` Liu, Yi L
2021-01-05 17:23       ` Will Deacon [this message]
2021-01-05 17:23         ` Will Deacon
2021-01-07  5:22         ` Liu, Yi L
2021-01-07  5:22           ` Liu, Yi L
2021-01-05 12:14   ` Dan Carpenter
2021-01-05 12:14     ` Dan Carpenter
2021-01-05 12:14     ` Dan Carpenter
2020-12-29  8:42 kernel test robot

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=20210105172348.GA12032@willie-the-truck \
    --to=will@kernel.org \
    --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=yi.l.liu@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.