[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220511182908.GK49344@nvidia.com>
Date: Wed, 11 May 2022 15:29:08 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc: iommu@...ts.linux-foundation.org,
LKML <linux-kernel@...r.kernel.org>, dmaengine@...r.kernel.org,
Joerg Roedel <joro@...tes.org>,
David Woodhouse <dwmw2@...radead.org>,
Jean-Philippe Brucker <jean-philippe@...aro.com>,
Lu Baolu <baolu.lu@...ux.intel.com>, vkoul@...nel.org,
robin.murphy@....com, will@...nel.org, Yi Liu <yi.l.liu@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
Raj Ashok <ashok.raj@...el.com>,
Eric Auger <eric.auger@...hat.com>
Subject: Re: [PATCH v3 1/4] iommu/vt-d: Implement domain ops for
attach_dev_pasid
On Wed, May 11, 2022 at 10:25:21AM -0700, Jacob Pan wrote:
> Hi Jason,
>
> On Wed, 11 May 2022 14:00:25 -0300, Jason Gunthorpe <jgg@...dia.com> wrote:
>
> > On Wed, May 11, 2022 at 10:02:16AM -0700, Jacob Pan wrote:
> > > > > If not global, perhaps we could have a list of pasids (e.g. xarray)
> > > > > attached to the device_domain_info. The TLB flush logic would just
> > > > > go through the list w/o caring what the PASIDs are for. Does it
> > > > > make sense to you?
> > > >
> > > > Sort of, but we shouldn't duplicate xarrays - the group already has
> > > > this xarray - need to find some way to allow access to it from the
> > > > driver.
> > > >
> > > I am not following, here are the PASIDs for devTLB flush which is per
> > > device. Why group?
> >
> > Because group is where the core code stores it.
> I see, with singleton group. I guess I can let dma-iommu code call
>
> iommu_attach_dma_pasid {
> iommu_attach_device_pasid();
> Then the PASID will be stored in the group xa.
Yes, again, the dma-iommu should not be any different from the normal
unmanaged path. At this point there is no longer any difference, we
should not invent new ones.
> The flush code can retrieve PASIDs from device_domain_info.device ->
> group -> pasid_array. Thanks for pointing it out, I missed the new
> pasid_array.
Yes.. It seems inefficient to iterate over that xarray multiple times
on the flush hot path, but maybe there is little choice. Try to use
use the xas iterators under the xa_lock spinlock..
The challenge will be accessing the group xa in the first place, but
maybe the core code can gain a function call to return a pointer to
that XA or something..
Jason
Powered by blists - more mailing lists