[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1308843083-10442-2-git-send-email-joerg.roedel@amd.com>
Date: Thu, 23 Jun 2011 17:31:22 +0200
From: Joerg Roedel <joerg.roedel@....com>
To: <iommu@...ts.linux-foundation.org>
CC: <linux-kernel@...r.kernel.org>,
David Woodhouse <dwmw2@...radead.org>,
Ohad Ben-Cohen <ohad@...ery.com>,
David Brown <davidb@...eaurora.org>, <kvm@...r.kernel.org>,
Avi Kivity <avi@...hat.com>,
Alex Williamson <alex.williamson@...hat.com>,
Joerg Roedel <joerg.roedel@....com>
Subject: [PATCH 1/2] iommu-api: Introduce iommu_comit function
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@....com>
---
drivers/iommu/iommu.c | 7 +++++++
include/linux/iommu.h | 6 ++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 6e6b6a1..4099cc6 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -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);
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9940319..dbb4324 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -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 */
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists