mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: <iommu@lists.linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	David Brown <davidb@codeaurora.org>, <kvm@vger.kernel.org>,
	Avi Kivity <avi@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 1/2] iommu-api: Introduce iommu_comit function
Date: Thu, 23 Jun 2011 17:31:22 +0200	[thread overview]
Message-ID: <1308843083-10442-2-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1308843083-10442-1-git-send-email-joerg.roedel@amd.com>

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(-)

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



  reply	other threads:[~2011-06-23 15:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-23 15:31 [PATCH 0/2] Introduce iommu_commit() function Joerg Roedel
2011-06-23 15:31 ` Joerg Roedel [this message]
2011-06-23 15:31 ` [PATCH 2/2] KVM: IOMMU: Use iommu_commit() in device-passthrough code Joerg Roedel
2011-06-23 15:38 ` [PATCH 0/2] Introduce iommu_commit() function David Woodhouse
2011-06-23 16:21   ` Roedel, Joerg
2011-06-23 17:20   ` Chris Wright
2011-06-24  8:08     ` Roedel, Joerg
2011-11-16  9:40   ` Avi Kivity
2011-06-29  5:02 ` KyongHo Cho
2011-06-29  5:51   ` Joerg Roedel
2011-11-16  2:00     ` KyongHo Cho
2011-11-16 12:58       ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1308843083-10442-2-git-send-email-joerg.roedel@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=davidb@codeaurora.org \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ohad@wizery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®