Re: [PATCH v4 13/17] iommu: Revise iommu_group_alloc_default_domain()

Baolu Lu
2023-04-13T02:47:55Z

On 4/12/23 9:51 PM, Jason Gunthorpe wrote:
> Robin points out that the fallback to guessing what domains the driver
> supports should only happen if the driver doesn't return a preference from
> its ops->def_domain_type().
>
> Re-organize iommu_group_alloc_default_domain() so it internally uses
> iommu_def_domain_type only during the fallback and makes it clearer how
> the fallback sequence works.
>
> Make iommu_group_alloc_default_domain() return the domain so the return
> based logic is cleaner and to prepare for the next patch.
>
> Remove the iommu_alloc_default_domain() function as it is now trivially
> just calling iommu_group_alloc_default_domain().
>
> Signed-off-by: Jason Gunthorpe<jgg@nvidia.com>

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu