lkml.org 
[lkml]   [2022]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 06/10] iommu/sva: Refactoring iommu_sva_bind/unbind_device()
On Tue, May 24, 2022 at 10:22:28AM +0000, Tian, Kevin wrote:
> > From: Lu Baolu <baolu.lu@linux.intel.com>
> > Sent: Thursday, May 19, 2022 3:21 PM
> >
> > The existing iommu SVA interfaces are implemented by calling the SVA
> > specific iommu ops provided by the IOMMU drivers. There's no need for
> > any SVA specific ops in iommu_ops vector anymore as we can achieve
> > this through the generic attach/detach_dev_pasid domain ops.
>
> set/block_pasid_dev, to be consistent.
>
> > +
> > + mutex_lock(&iommu_sva_lock);
> > + /* Search for an existing domain. */
> > + domain = iommu_get_domain_for_dev_pasid(dev, mm->pasid);
> > + if (domain) {
> > + sva_domain = to_sva_domain(domain);
> > + refcount_inc(&sva_domain->bond.users);
> > + goto out_success;
> > + }
> > +
>
> why would one device/pasid be bound to a mm more than once?

Device drivers can call bind() multiple times for the same device and mm,
for example if one process wants to open multiple accelerator queues.

Thanks,
Jean

\
 
 \ /
  Last update: 2022-05-24 12:59    [W:0.149 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site