summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorRohan Somvanshi <rsomvanshi@nvidia.com>2012-02-01 16:03:06 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-02-01 16:03:06 +0530
commit13ab2df1dfed5153899b98b1417f52de0ecc70cd (patch)
tree9b47b72d23fef02d1b489a845547106430552be9 /virt
parentc8932c9184978b42398fd582592315cbbf507415 (diff)
parentac2b520c46800dec16f3c23d0cf8759826750937 (diff)
Merge remote-tracking branch 'origin/dev/k3.3-rc1-iommu' into android-tegra-nv-3.1
Change-Id: I9001bb291779f107bbcb593d48f9f0f734074d0e
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/iommu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 78c80f67f535..511e160f7062 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -111,7 +111,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
/* Map into IO address space */
r = iommu_map(domain, gfn_to_gpa(gfn), pfn_to_hpa(pfn),
- get_order(page_size), flags);
+ page_size, flags);
if (r) {
printk(KERN_ERR "kvm_iommu_map_address:"
"iommu failed to map pfn=%llx\n", pfn);
@@ -228,12 +228,12 @@ int kvm_iommu_map_guest(struct kvm *kvm)
{
int r;
- if (!iommu_found()) {
+ if (!iommu_present(&pci_bus_type)) {
printk(KERN_ERR "%s: iommu not found\n", __func__);
return -ENODEV;
}
- kvm->arch.iommu_domain = iommu_domain_alloc();
+ kvm->arch.iommu_domain = iommu_domain_alloc(&pci_bus_type);
if (!kvm->arch.iommu_domain)
return -ENOMEM;
@@ -286,15 +286,15 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
while (gfn < end_gfn) {
unsigned long unmap_pages;
- int order;
+ size_t size;
/* Get physical address */
phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn));
pfn = phys >> PAGE_SHIFT;
/* Unmap address from IO address space */
- order = iommu_unmap(domain, gfn_to_gpa(gfn), 0);
- unmap_pages = 1ULL << order;
+ size = iommu_unmap(domain, gfn_to_gpa(gfn), PAGE_SIZE);
+ unmap_pages = 1ULL << get_order(size);
/* Unpin all pages we just unmapped to not leak any memory */
kvm_unpin_pages(kvm, pfn, unmap_pages);