diff options
author | Roman Shaposhnikov <x0166637@ti.com> | 2012-06-13 23:00:26 +0300 |
---|---|---|
committer | Roman Shaposhnikov <x0166637@ti.com> | 2012-06-13 23:00:26 +0300 |
commit | 4efa29b240cc7dd0584ad3d2f6a446e6034e0a78 (patch) | |
tree | 741e8a369da867cd29c112a5f9fc4dfe596b67cd /virt | |
parent | 0f2c8a7c9c04e388f585a79a7e609d8427e68e08 (diff) | |
download | kernel_samsung_espresso10-4efa29b240cc7dd0584ad3d2f6a446e6034e0a78.zip kernel_samsung_espresso10-4efa29b240cc7dd0584ad3d2f6a446e6034e0a78.tar.gz kernel_samsung_espresso10-4efa29b240cc7dd0584ad3d2f6a446e6034e0a78.tar.bz2 |
Merge latest changes from google kernel/common.git
Kernel version updated to 3.0.31
Change-Id: Ifbd7150801f3beeec9cbaa566f249d8019ef9348
Signed-off-by: Roman Shaposhnikov <x0166637@ti.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/iommu.c | 12 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 5 |
2 files changed, 11 insertions, 6 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index 62a9caf..fb0f6e4 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c @@ -285,6 +285,11 @@ static void kvm_iommu_put_pages(struct kvm *kvm, } } +void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot) +{ + kvm_iommu_put_pages(kvm, slot->base_gfn, slot->npages); +} + static int kvm_iommu_unmap_memslots(struct kvm *kvm) { int i, idx; @@ -293,10 +298,9 @@ static int kvm_iommu_unmap_memslots(struct kvm *kvm) idx = srcu_read_lock(&kvm->srcu); slots = kvm_memslots(kvm); - for (i = 0; i < slots->nmemslots; i++) { - kvm_iommu_put_pages(kvm, slots->memslots[i].base_gfn, - slots->memslots[i].npages); - } + for (i = 0; i < slots->nmemslots; i++) + kvm_iommu_unmap_pages(kvm, &slots->memslots[i]); + srcu_read_unlock(&kvm->srcu, idx); return 0; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 96ebc06..6b39ba9 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -796,12 +796,13 @@ skip_lpage: if (r) goto out_free; - /* map the pages in iommu page table */ + /* map/unmap the pages in iommu page table */ if (npages) { r = kvm_iommu_map_pages(kvm, &new); if (r) goto out_free; - } + } else + kvm_iommu_unmap_pages(kvm, &old); r = -ENOMEM; slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); |