RE: [PATCH v4 12/17] iommu: Consolidate the code to calculate the target default domain type

Tian, Kevin
2023-04-20T07:32:53Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, April 12, 2023 9:52 PM
>
> Put all the code to calculate the default domain type into one
> function. Make the function able to handle the
> iommu_change_dev_def_domain() by taking in the target domain type and
> erroring out if the target type isn't reachable.
>
> This makes it really clear that specifying a 0 type during
> iommu_change_dev_def_domain() will have the same outcome as the
> normal
> probe path.
>
> Remove the obfuscating use of __iommu_group_for_each_dev() and related
> struct __group_domain_type.
>
> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>