Re: [PATCH v3 23/25] iommu: Add ops->domain_alloc_paging()

2023-06-10 Thread Jason Gunthorpe
On Sat, Jun 10, 2023 at 05:08:31PM +0800, Baolu Lu wrote: > > @@ -1992,8 +1993,13 @@ static struct iommu_domain > > *__iommu_domain_alloc(const struct iommu_ops *ops, > > if (alloc_type == IOMMU_DOMAIN_IDENTITY && ops->identity_domain) > > return ops->identity_domain; > > + else

Re: [PATCH v3 23/25] iommu: Add ops->domain_alloc_paging()

2023-06-10 Thread Baolu Lu
On 6/10/23 3:56 AM, Jason Gunthorpe wrote: This callback requests the driver to create only a __IOMMU_DOMAIN_PAGING domain, so it saves a few lines in a lot of drivers needlessly checking the type. More critically, this allows us to sweep out all the IOMMU_DOMAIN_UNMANAGED and IOMMU_DOMAIN_DMA c

[PATCH v3 23/25] iommu: Add ops->domain_alloc_paging()

2023-06-09 Thread Jason Gunthorpe
This callback requests the driver to create only a __IOMMU_DOMAIN_PAGING domain, so it saves a few lines in a lot of drivers needlessly checking the type. More critically, this allows us to sweep out all the IOMMU_DOMAIN_UNMANAGED and IOMMU_DOMAIN_DMA checks from a lot of the drivers, simplifying