[PATCH v3 10/32] iommu/ipmmu-vmsa: implement iova_to_phys_length
From: Guanghui Feng
Date: Wed Jun 03 2026 - 12:07:13 EST
Migrate IPMMU-VMSA to implement iova_to_phys_length, passing through
mapped_length from io-pgtable.
Signed-off-by: Guanghui Feng <guanghuifeng@xxxxxxxxxxxxxxxxx>
---
drivers/iommu/ipmmu-vmsa.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 9386b752dea2..6e2e5922ab1b 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -699,14 +699,16 @@ static void ipmmu_iotlb_sync(struct iommu_domain *io_domain,
ipmmu_flush_iotlb_all(io_domain);
}
-static phys_addr_t ipmmu_iova_to_phys(struct iommu_domain *io_domain,
- dma_addr_t iova)
+static phys_addr_t ipmmu_iova_to_phys_length(struct iommu_domain *io_domain,
+ dma_addr_t iova, size_t *mapped_length)
{
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
+
/* TODO: Is locking needed ? */
- return domain->iop->iova_to_phys(domain->iop, iova);
+ return domain->iop->iova_to_phys_length(domain->iop, iova,
+ mapped_length);
}
static int ipmmu_init_platform_device(struct device *dev,
@@ -892,7 +894,7 @@ static const struct iommu_ops ipmmu_ops = {
.unmap_pages = ipmmu_unmap,
.flush_iotlb_all = ipmmu_flush_iotlb_all,
.iotlb_sync = ipmmu_iotlb_sync,
- .iova_to_phys = ipmmu_iova_to_phys,
+ .iova_to_phys_length = ipmmu_iova_to_phys_length,
.free = ipmmu_domain_free,
}
};
--
2.43.7