lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Jan 2021 17:23:49 +0000
From:   Will Deacon <will@...nel.org>
To:     "Liu, Yi L" <yi.l.liu@...el.com>
Cc:     Lu Baolu <baolu.lu@...ux.intel.com>,
        "joro@...tes.org" <joro@...tes.org>,
        "Tian, Kevin" <kevin.tian@...el.com>,
        "jacob.jun.pan@...ux.intel.com" <jacob.jun.pan@...ux.intel.com>,
        "Raj, Ashok" <ashok.raj@...el.com>,
        "Tian, Jun J" <jun.j.tian@...el.com>,
        "Sun, Yi Y" <yi.y.sun@...el.com>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation
 for subdevices

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ