aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 14:08:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 14:08:21 -0500
commit1c8106528aa6bf16b3f457de80df1cf7462a49a4 (patch)
tree4aed009c4a36195fd14c9f8d70fe2723a49583da /virt/kvm
parent1a464cbb3d483f2f195b614cffa4aa1b910a0440 (diff)
parentf93ea733878733f3e98475bc3e2ccf789bebcfb8 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (53 commits) iommu/amd: Set IOTLB invalidation timeout iommu/amd: Init stats for iommu=pt iommu/amd: Remove unnecessary cache flushes in amd_iommu_resume iommu/amd: Add invalidate-context call-back iommu/amd: Add amd_iommu_device_info() function iommu/amd: Adapt IOMMU driver to PCI register name changes iommu/amd: Add invalid_ppr callback iommu/amd: Implement notifiers for IOMMUv2 iommu/amd: Implement IO page-fault handler iommu/amd: Add routines to bind/unbind a pasid iommu/amd: Implement device aquisition code for IOMMUv2 iommu/amd: Add driver stub for AMD IOMMUv2 support iommu/amd: Add stat counter for IOMMUv2 events iommu/amd: Add device errata handling iommu/amd: Add function to get IOMMUv2 domain for pdev iommu/amd: Implement function to send PPR completions iommu/amd: Implement functions to manage GCR3 table iommu/amd: Implement IOMMUv2 TLB flushing routines iommu/amd: Add support for IOMMUv2 domain mode iommu/amd: Add amd_iommu_domain_direct_map function ...
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/iommu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 4e5f7b7f1d2b..0fb448e6a1a3 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);
@@ -293,15 +293,15 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
293 293
294 while (gfn < end_gfn) { 294 while (gfn < end_gfn) {
295 unsigned long unmap_pages; 295 unsigned long unmap_pages;
296 int order; 296 size_t size;
297 297
298 /* Get physical address */ 298 /* Get physical address */
299 phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn)); 299 phys = iommu_iova_to_phys(domain, gfn_to_gpa(gfn));
300 pfn = phys >> PAGE_SHIFT; 300 pfn = phys >> PAGE_SHIFT;
301 301
302 /* Unmap address from IO address space */ 302 /* Unmap address from IO address space */
303 order = iommu_unmap(domain, gfn_to_gpa(gfn), 0); 303 size = iommu_unmap(domain, gfn_to_gpa(gfn), PAGE_SIZE);
304 unmap_pages = 1ULL << order; 304 unmap_pages = 1ULL << get_order(size);
305 305
306 /* Unpin all pages we just unmapped to not leak any memory */ 306 /* Unpin all pages we just unmapped to not leak any memory */
307 kvm_unpin_pages(kvm, pfn, unmap_pages); 307 kvm_unpin_pages(kvm, pfn, unmap_pages);