]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - virt/kvm/iommu.c
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
[~shefty/rdma-dev.git] / virt / kvm / iommu.c
index 4e5f7b7f1d2be1828005e5081ab3af86d7f447f2..0fb448e6a1a33288694e78ae764540df7e7a80bb 100644 (file)
@@ -113,7 +113,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);
@@ -293,15 +293,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);