diff options
Diffstat (limited to 'virt/kvm/iommu.c')
-rw-r--r-- | virt/kvm/iommu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index a195c07fa829..304d7e5717e9 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c | |||
@@ -113,7 +113,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) | |||
113 | 113 | ||
114 | /* Map into IO address space */ | 114 | /* Map into IO address space */ |
115 | r = iommu_map(domain, gfn_to_gpa(gfn), pfn_to_hpa(pfn), | 115 | r = iommu_map(domain, gfn_to_gpa(gfn), pfn_to_hpa(pfn), |
116 | get_order(page_size), flags); | 116 | page_size, flags); |
117 | if (r) { | 117 | if (r) { |
118 | printk(KERN_ERR "kvm_iommu_map_address:" | 118 | printk(KERN_ERR "kvm_iommu_map_address:" |
119 | "iommu failed to map pfn=%llx\n", pfn); | 119 | "iommu failed to map pfn=%llx\n", pfn); |
@@ -292,15 +292,15 @@ static void kvm_iommu_put_pages(struct kvm *kvm, | |||
292 | 292 | ||
293 | while (gfn < end_gfn) { | 293 | while (gfn < end_gfn) { |
294 | unsigned long unmap_pages; | 294 | unsigned long unmap_pages; |
295 | int order; | 295 | size_t size; |
296 | 296 | ||
297 | /* Get physical address */ | 297 | /* Get physical address */ |
298 | phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn)); | 298 | phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn)); |
299 | pfn = phys >> PAGE_SHIFT; | 299 | pfn = phys >> PAGE_SHIFT; |
300 | 300 | ||
301 | /* Unmap address from IO address space */ | 301 | /* Unmap address from IO address space */ |
302 | order = iommu_unmap(domain, gfn_to_gpa(gfn), 0); | 302 | size = iommu_unmap(domain, gfn_to_gpa(gfn), PAGE_SIZE); |
303 | unmap_pages = 1ULL << order; | 303 | unmap_pages = 1ULL << get_order(size); |
304 | 304 | ||
305 | /* Unpin all pages we just unmapped to not leak any memory */ | 305 | /* Unpin all pages we just unmapped to not leak any memory */ |
306 | kvm_unpin_pages(kvm, pfn, unmap_pages); | 306 | kvm_unpin_pages(kvm, pfn, unmap_pages); |