]> git.ipfire.org Git - thirdparty/linux.git/commit
iommupt: Directly call iommupt's unmap_range()
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 27 Feb 2026 19:30:10 +0000 (15:30 -0400)
committerJoerg Roedel <joerg.roedel@amd.com>
Tue, 17 Mar 2026 12:57:39 +0000 (13:57 +0100)
commit99fb8afa16add85ed016baee9735231bca0c32b4
tree783c189eb4273e4788db9d040691ca8d7717aa70
parentfa8fb60d36375ca3166a60589a624f0d0bc9ddb5
iommupt: Directly call iommupt's unmap_range()

The common algorithm in iommupt does not require the iommu_pgsize()
calculations, it can directly unmap any arbitrary range. Add a new function
pointer to directly call an iommupt unmap_range op and make
__iommu_unmap() call it directly.

Gives about a 5% gain on single page unmappings.

The function pointer is run through pt_iommu_ops instead of
iommu_domain_ops to discourage using it outside iommupt. All drivers with
their own page tables should continue to use the simplified
map/unmap_pages() style interfaces.

Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/generic_pt/iommu_pt.h
drivers/iommu/iommu.c
include/linux/generic_pt/iommu.h
include/linux/iommu.h