diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-24 15:54:58 -0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-06 16:37:27 +0300 |
commit | 12d6e7538e2d418c08f082b1b44ffa5fb7270ed8 (patch) | |
tree | f548812d6c74416d6b4f2cae1d88c06cf56c0f96 | |
parent | 2df72e9bc4c505d8357012f2924589f3d16f9d44 (diff) | |
download | linux-12d6e7538e2d418c08f082b1b44ffa5fb7270ed8.tar.gz linux-12d6e7538e2d418c08f082b1b44ffa5fb7270ed8.tar.bz2 linux-12d6e7538e2d418c08f082b1b44ffa5fb7270ed8.zip |
KVM: perform an invalid memslot step for gpa base change
PPC must flush all translations before the new memory slot
is visible.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | virt/kvm/kvm_main.c | 6 |
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, /* destroy any largepage mappings for dirty tracking */ } - if (!npages) { + if (!npages || base_gfn != old.base_gfn) { struct kvm_memory_slot *slot; r = -ENOMEM; @@ -807,8 +807,8 @@ int __kvm_set_memory_region(struct kvm *kvm, old_memslots = kvm->memslots; rcu_assign_pointer(kvm->memslots, slots); synchronize_srcu_expedited(&kvm->srcu); - /* From this point no new shadow pages pointing to a deleted - * memslot will be created. + /* From this point no new shadow pages pointing to a deleted, + * or moved, memslot will be created. * * validation of sp->gfn happens in: * - gfn_to_hva (kvm_read_guest, gfn_to_pfn) |