Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-14 Thread Jason Gunthorpe
On Sat, Aug 12, 2023 at 09:41:50AM +0800, Baolu Lu wrote: > > index e05c93b6c37fba..87aebba474e093 100644 > > --- a/include/linux/iommu.h > > +++ b/include/linux/iommu.h > > @@ -64,6 +64,7 @@ struct iommu_domain_geometry { > > #define __IOMMU_DOMAIN_DMA_FQ (1U << 3) /* DMA-API uses flush que

Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-14 Thread Jason Gunthorpe
On Sun, Aug 13, 2023 at 08:11:30PM +0800, Baolu Lu wrote: > On 2023/8/12 19:28, Jason Gunthorpe wrote: > > On Sat, Aug 12, 2023 at 09:36:33AM +0800, Baolu Lu wrote: > > > > @@ -290,6 +295,7 @@ struct iommu_ops { > > > > unsigned long pgsize_bitmap; > > > > struct module *owner; > >

Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-13 Thread Baolu Lu
On 2023/8/12 19:28, Jason Gunthorpe wrote: On Sat, Aug 12, 2023 at 09:36:33AM +0800, Baolu Lu wrote: @@ -290,6 +295,7 @@ struct iommu_ops { unsigned long pgsize_bitmap; struct module *owner; struct iommu_domain *identity_domain; + struct iommu_domain *default_domain

Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-12 Thread Jason Gunthorpe
On Sat, Aug 12, 2023 at 09:36:33AM +0800, Baolu Lu wrote: > > @@ -290,6 +295,7 @@ struct iommu_ops { > > unsigned long pgsize_bitmap; > > struct module *owner; > > struct iommu_domain *identity_domain; > > + struct iommu_domain *default_domain; > > I am imaging whether we can merge a

Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-11 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: @@ -1967,7 +1978,8 @@ void iommu_domain_free(struct iommu_domain *domain) if (domain->type == IOMMU_DOMAIN_SVA) mmdrop(domain->mm); iommu_put_dma_cookie(domain); - domain->ops->free(domain); + if (domain->ops->fr

Re: [PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-11 Thread Baolu Lu
On 2023/8/3 8:07, Jason Gunthorpe wrote: This is used when the iommu driver is taking control of the dma_ops, currently only on S390 and power spapr. It is designed to preserve the original ops->detach_dev() semantic that these S390 was built around. Provide an opaque domain type and a 'default_

[PATCH v6 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM

2023-08-02 Thread Jason Gunthorpe
This is used when the iommu driver is taking control of the dma_ops, currently only on S390 and power spapr. It is designed to preserve the original ops->detach_dev() semantic that these S390 was built around. Provide an opaque domain type and a 'default_domain' ops value that allows the driver to