RE: [PATCH v4 15/17] iommu: Allow IOMMU_RESV_DIRECT to work on ARM

Tian, Kevin
2023-04-20T08:00:34Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, April 12, 2023 9:52 PM
>
> @@ -2918,6 +2922,17 @@ static int iommu_setup_default_domain(struct
> iommu_group *group,
> }
> }
>
> + /*
> + * Drivers are supposed to allow mappings to be installed in a
> domain
> + * before device attachment, but some don't. Hack around this defect
> by
> + * trying again after attaching. If this happens it means the device
> + * will not continuously have the IOMMU_RESV_DIRECT map.
> + */
> + if (direct_failed) {
> + for_each_group_device(group, gdev)
> + iommu_create_device_direct_mappings(dom, gdev-
> >dev);
> + }
> +

Throw out a warning so user knows that the continuity might be broken
here?

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