Skip to content
Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
matosatti authored and avikivity committed Sep 6, 2012
1 parent 2df72e9 commit 12d6e75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions virt/kvm/kvm_main.c
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 12d6e75

Please sign in to comment.