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

Tian, Kevin
2023-04-20T07:54:55Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, April 12, 2023 9:52 PM
>
> 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: Kevin Tian <kevin.tian@intel.com>