@@ -122,3 +122,10 @@ int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order)
return iommu_ops->unmap(domain, iova, gfp_order);
}
EXPORT_SYMBOL_GPL(iommu_unmap);
+
+void iommu_commit(struct iommu_domain *domain)
+{
+ if (iommu_ops->commit)
+ iommu_ops->commit(domain);
+}
+EXPORT_SYMBOL_GPL(iommu_commit);
@@ -47,6 +47,7 @@ struct iommu_ops {
unsigned long iova);
int (*domain_has_cap)(struct iommu_domain *domain,
unsigned long cap);
+ void (*commit)(struct iommu_domain *domain);
};
#ifdef CONFIG_IOMMU_API
@@ -67,6 +68,7 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
unsigned long iova);
extern int iommu_domain_has_cap(struct iommu_domain *domain,
unsigned long cap);
+extern void iommu_commit(struct iommu_domain *domain);
#else /* CONFIG_IOMMU_API */
@@ -123,6 +125,10 @@ static inline int domain_has_cap(struct iommu_domain *domain,
return 0;
}
+static inline void iommu_commit(struct iommu_domain *domain)
+{
+}
+
#endif /* CONFIG_IOMMU_API */
#endif /* __LINUX_IOMMU_H */
This function will be used to coalesce cache-flushes required after a domain was changed. This should significantly improve performance in some cases. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> --- drivers/iommu/iommu.c | 7 +++++++ include/linux/iommu.h | 6 ++++++ 2 files changed, 13 insertions(+), 0 deletions(-)