@@ -317,6 +317,11 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain,
return domain->ops->map_sg(domain, iova, sg, nents, prot);
}
+static inline size_t iommu_min_pgsize(struct iommu_domain *domain)
+{
+ return 1 << __ffs(domain->ops->pgsize_bitmap);
+}
+
/* PCI device grouping function */
extern struct iommu_group *pci_device_group(struct device *dev);
/* Generic device grouping function */
@@ -386,6 +391,11 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain,
return -ENODEV;
}
+static inline size_t iommu_min_pgsize(struct iommu_domain *domain)
+{
+ return -ENODEV;
+}
+
static inline int iommu_domain_window_enable(struct iommu_domain *domain,
u32 wnd_nr, phys_addr_t paddr,
u64 size, int prot)
This function is useful for drivers wishing to learn about the minimum supported page size of the IOMMU. This information can for example be used by drivers to align memory addresses it wish to map into its iommu domain. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> --- include/linux/iommu.h | 10 ++++++++++ 1 file changed, 10 insertions(+)