diff options
-rw-r--r-- | virt/kvm/iommu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index c7d9ce122529..0df7d4b34dfe 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c | |||
@@ -103,6 +103,10 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) | |||
103 | while ((gfn << PAGE_SHIFT) & (page_size - 1)) | 103 | while ((gfn << PAGE_SHIFT) & (page_size - 1)) |
104 | page_size >>= 1; | 104 | page_size >>= 1; |
105 | 105 | ||
106 | /* Make sure hva is aligned to the page size we want to map */ | ||
107 | while (__gfn_to_hva_memslot(slot, gfn) & (page_size - 1)) | ||
108 | page_size >>= 1; | ||
109 | |||
106 | /* | 110 | /* |
107 | * Pin all pages we are about to map in memory. This is | 111 | * Pin all pages we are about to map in memory. This is |
108 | * important because we unmap and unpin in 4kb steps later. | 112 | * important because we unmap and unpin in 4kb steps later. |