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 2/2] KVM: IOMMU: Use iommu_commit() in device-passthrough code
Date: Thu, 23 Jun 2011 17:31:23 +0200	[thread overview]
Message-ID: <1308843083-10442-3-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1308843083-10442-1-git-send-email-joerg.roedel@amd.com>

Use the new iommu_commit() function in the KVM device
passthrough code.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 virt/kvm/iommu.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 62a9caf..87ef85a 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -187,6 +187,8 @@ int kvm_assign_device(struct kvm *kvm,
 		PCI_SLOT(assigned_dev->host_devfn),
 		PCI_FUNC(assigned_dev->host_devfn));
 
+	iommu_commit(domain);
+
 	return 0;
 out_unmap:
 	kvm_iommu_unmap_memslots(kvm);
@@ -215,6 +217,8 @@ int kvm_deassign_device(struct kvm *kvm,
 		PCI_SLOT(assigned_dev->host_devfn),
 		PCI_FUNC(assigned_dev->host_devfn));
 
+	iommu_commit(domain);
+
 	return 0;
 }
 
@@ -235,6 +239,8 @@ int kvm_iommu_map_guest(struct kvm *kvm)
 	if (r)
 		goto out_unmap;
 
+	iommu_commit(kvm->arch.iommu_domain);
+
 	return 0;
 
 out_unmap:
@@ -283,6 +289,8 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
 
 		gfn += unmap_pages;
 	}
+
+	iommu_commit(domain);
 }
 
 static int kvm_iommu_unmap_memslots(struct kvm *kvm)
-- 
1.7.4.1



  parent reply	other threads:[~2011-06-23 15:31 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 ` [PATCH 1/2] iommu-api: Introduce iommu_comit function Joerg Roedel
2011-06-23 15:31 ` Joerg Roedel [this message]
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-3-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®