Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-15 Thread Baolu Lu
On 2022/5/12 19:51, Jason Gunthorpe wrote: On Thu, May 12, 2022 at 08:00:59AM +0100, Jean-Philippe Brucker wrote: It is not "missing" it is just renamed to blocking_domain->ops->set_dev_pasid() The implementation of that function would be identical to detach_dev_pasid. attach(dev, pasid,

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-12 Thread Jason Gunthorpe via iommu
On Thu, May 12, 2022 at 08:00:59AM +0100, Jean-Philippe Brucker wrote: > > It is not "missing" it is just renamed to > > blocking_domain->ops->set_dev_pasid() > > > > The implementation of that function would be identical to > > detach_dev_pasid. > > attach(dev, pasid, sva_domain) >

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-12 Thread Jean-Philippe Brucker
On Wed, May 11, 2022 at 09:02:40AM -0300, Jason Gunthorpe wrote: > On Wed, May 11, 2022 at 08:54:39AM +0100, Jean-Philippe Brucker wrote: > > > > > Then 'detach pasid' is: > > > > > > > > > > iommu_ops->blocking_domain->ops->attach_dev_pasid(domain, dev, > > > > pasid); > > > > > > > > > > And we

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-11 Thread Jason Gunthorpe via iommu
On Wed, May 11, 2022 at 08:54:39AM +0100, Jean-Philippe Brucker wrote: > > > > Then 'detach pasid' is: > > > > > > > > iommu_ops->blocking_domain->ops->attach_dev_pasid(domain, dev, > > > pasid); > > > > > > > > And we move away from the notion of 'detach' and in the direction that > > > >

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-11 Thread Jean-Philippe Brucker
On Wed, May 11, 2022 at 04:09:14AM +, Tian, Kevin wrote: > > From: Baolu Lu > > Sent: Wednesday, May 11, 2022 10:32 AM > > > > On 2022/5/10 22:02, Jason Gunthorpe wrote: > > > On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: > > > > > >> This adds a pair of common domain ops for

RE: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Tian, Kevin
> From: Baolu Lu > Sent: Wednesday, May 11, 2022 10:32 AM > > On 2022/5/10 22:02, Jason Gunthorpe wrote: > > On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: > > > >> This adds a pair of common domain ops for this purpose and adds > helpers > >> to attach/detach a domain to/from a

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Baolu Lu
On 2022/5/10 22:02, Jason Gunthorpe wrote: On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: This adds a pair of common domain ops for this purpose and adds helpers to attach/detach a domain to/from a {device, PASID}. I wonder if this should not have a detach op - after discussing

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Jason Gunthorpe via iommu
On Tue, May 10, 2022 at 02:17:29PM +0800, Lu Baolu wrote: > This adds a pair of common domain ops for this purpose and adds helpers > to attach/detach a domain to/from a {device, PASID}. I wonder if this should not have a detach op - after discussing with Robin we can see that detach_dev is not

[PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-10 Thread Lu Baolu
Attaching an IOMMU domain to a PASID of a device is a generic operation for modern IOMMU drivers which support PASID-granular DMA address translation. Currently visible usage scenarios include (but not limited): - SVA (Shared Virtual Address) - kernel DMA with PASID - hardware-assist mediated