RE: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-06-01 Thread Tian, Kevin
> From: Baolu Lu > Sent: Wednesday, June 1, 2022 5:37 PM > > On 2022/6/1 09:43, Tian, Kevin wrote: > >> From: Jacob Pan > >> Sent: Wednesday, June 1, 2022 1:30 AM > In both cases the pasid is stored in the attach data instead of the > domain. > > >> So during IOTLB flush for the do

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-06-01 Thread Baolu Lu
On 2022/6/1 09:43, Tian, Kevin wrote: From: Jacob Pan Sent: Wednesday, June 1, 2022 1:30 AM In both cases the pasid is stored in the attach data instead of the domain. So during IOTLB flush for the domain, do we loop through the attach data? Yes and it's required. What does the attach data

RE: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Tian, Kevin
> From: Jacob Pan > Sent: Wednesday, June 1, 2022 4:44 AM > > Hi Jason, > > On Tue, 31 May 2022 16:05:50 -0300, Jason Gunthorpe > wrote: > > > On Tue, May 31, 2022 at 10:29:55AM -0700, Jacob Pan wrote: > > > > > The reason why I store PASID at IOMMU domain is for IOTLB flush within > > > the d

RE: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Tian, Kevin
> From: Jacob Pan > Sent: Wednesday, June 1, 2022 1:30 AM > > > > > > In both cases the pasid is stored in the attach data instead of the > > > domain. > > > > So during IOTLB flush for the domain, do we loop through the attach data? Yes and it's required. > > > > DMA API pasid is no special fr

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Jacob Pan
Hi Jason, On Tue, 31 May 2022 16:05:50 -0300, Jason Gunthorpe wrote: > On Tue, May 31, 2022 at 10:29:55AM -0700, Jacob Pan wrote: > > > The reason why I store PASID at IOMMU domain is for IOTLB flush within > > the domain. Device driver is not aware of domain level IOTLB flush. We > > also have

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Jason Gunthorpe via iommu
On Tue, May 31, 2022 at 10:29:55AM -0700, Jacob Pan wrote: > The reason why I store PASID at IOMMU domain is for IOTLB flush within the > domain. Device driver is not aware of domain level IOTLB flush. We also > have iova_cookie for each domain which essentially is for RIDPASID. You need to make

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Jacob Pan
Hi Baolu, On Tue, 31 May 2022 20:45:28 +0800, Baolu Lu wrote: > On 2022/5/31 18:12, Tian, Kevin wrote: > +++ b/include/linux/iommu.h > @@ -105,6 +105,8 @@ struct iommu_domain { > enum iommu_page_response_code (*iopf_handler)(struct > >> iommu_fault *fault, >

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Jason Gunthorpe via iommu
On Tue, May 31, 2022 at 08:45:28PM +0800, Baolu Lu wrote: > My understanding is that device driver owns its PASID policy. I'm not sure this is actually useful, the core code should provide the allocator as I can't think of any device that actually needs a special allocator. > If ENQCMD is suppor

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Baolu Lu
On 2022/5/31 18:12, Tian, Kevin wrote: +++ b/include/linux/iommu.h @@ -105,6 +105,8 @@ struct iommu_domain { enum iommu_page_response_code (*iopf_handler)(struct iommu_fault *fault, void *data); void *fault_data; + ioas

RE: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-31 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, May 30, 2022 8:23 PM > > On Tue, May 24, 2022 at 08:17:27AM -0700, Jacob Pan wrote: > > Hi Jason, > > > > On Tue, 24 May 2022 10:50:34 -0300, Jason Gunthorpe > wrote: > > > > > On Wed, May 18, 2022 at 11:21:15AM -0700, Jacob Pan wrote: > > > > DMA requests

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-30 Thread Jason Gunthorpe via iommu
On Tue, May 24, 2022 at 08:17:27AM -0700, Jacob Pan wrote: > Hi Jason, > > On Tue, 24 May 2022 10:50:34 -0300, Jason Gunthorpe wrote: > > > On Wed, May 18, 2022 at 11:21:15AM -0700, Jacob Pan wrote: > > > DMA requests tagged with PASID can target individual IOMMU domains. > > > Introduce a domai

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-24 Thread Jacob Pan
Hi Jason, On Tue, 24 May 2022 10:50:34 -0300, Jason Gunthorpe wrote: > On Wed, May 18, 2022 at 11:21:15AM -0700, Jacob Pan wrote: > > DMA requests tagged with PASID can target individual IOMMU domains. > > Introduce a domain-wide PASID for DMA API, it will be used on the same > > mapping as lega

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-24 Thread Jason Gunthorpe via iommu
On Wed, May 18, 2022 at 11:21:15AM -0700, Jacob Pan wrote: > DMA requests tagged with PASID can target individual IOMMU domains. > Introduce a domain-wide PASID for DMA API, it will be used on the same > mapping as legacy DMA without PASID. Let it be IOVA or PA in case of > identity domain. Huh? I

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-18 Thread Baolu Lu
On 2022/5/19 02:21, Jacob Pan wrote: DMA requests tagged with PASID can target individual IOMMU domains. Introduce a domain-wide PASID for DMA API, it will be used on the same mapping as legacy DMA without PASID. Let it be IOVA or PA in case of identity domain. Signed-off-by: Jacob Pan --- in

[PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-18 Thread Jacob Pan
DMA requests tagged with PASID can target individual IOMMU domains. Introduce a domain-wide PASID for DMA API, it will be used on the same mapping as legacy DMA without PASID. Let it be IOVA or PA in case of identity domain. Signed-off-by: Jacob Pan --- include/linux/iommu.h | 2 ++ 1 file chang