OSDN Git Service

iommu: Allow IOMMU_RESV_DIRECT to work on ARM
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 11 May 2023 04:42:13 +0000 (01:42 -0300)
committerJoerg Roedel <jroedel@suse.de>
Tue, 23 May 2023 06:15:57 +0000 (08:15 +0200)
commit1000dccd5d134951d5fd37a7ad85ad7b19b825fc
tree8683692ced7e3ed99dc74fb330886c24915f9789
parentd99be00f42eac9fc35a164f3f6c8c7a56b295aa9
iommu: Allow IOMMU_RESV_DIRECT to work on ARM

For now several ARM drivers do not allow mappings to be created until a
domain is attached. This means they do not technically support
IOMMU_RESV_DIRECT as it requires the 1:1 maps to work continuously.

Currently if the platform requests these maps on ARM systems they are
silently ignored.

Work around this by trying again to establish the direct mappings after
the domain is attached if the pre-attach attempt failed.

In the long run the drivers will be fixed to fully setup domains when they
are created without waiting for attachment.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/15-v5-1b99ae392328+44574-iommu_err_unwind_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c