[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1308843083-10442-3-git-send-email-joerg.roedel@amd.com>
Date: Thu, 23 Jun 2011 17:31:23 +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 2/2] KVM: IOMMU: Use iommu_commit() in device-passthrough code
Use the new iommu_commit() function in the KVM device
passthrough code.
Signed-off-by: Joerg Roedel <joerg.roedel@....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
--
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