aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--virt/kvm/kvm_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a4bf05be5fea..f41ea1262d51 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -791,7 +791,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
791 /* destroy any largepage mappings for dirty tracking */ 791 /* destroy any largepage mappings for dirty tracking */
792 } 792 }
793 793
794 if (!npages) { 794 if (!npages || base_gfn != old.base_gfn) {
795 struct kvm_memory_slot *slot; 795 struct kvm_memory_slot *slot;
796 796
797 r = -ENOMEM; 797 r = -ENOMEM;
@@ -807,8 +807,8 @@ int __kvm_set_memory_region(struct kvm *kvm,
807 old_memslots = kvm->memslots; 807 old_memslots = kvm->memslots;
808 rcu_assign_pointer(kvm->memslots, slots); 808 rcu_assign_pointer(kvm->memslots, slots);
809 synchronize_srcu_expedited(&kvm->srcu); 809 synchronize_srcu_expedited(&kvm->srcu);
810 /* From this point no new shadow pages pointing to a deleted 810 /* From this point no new shadow pages pointing to a deleted,
811 * memslot will be created. 811 * or moved, memslot will be created.
812 * 812 *
813 * validation of sp->gfn happens in: 813 * validation of sp->gfn happens in:
814 * - gfn_to_hva (kvm_read_guest, gfn_to_pfn) 814 * - gfn_to_hva (kvm_read_guest, gfn_to_pfn)