diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-24 14:54:57 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-06 09:37:25 -0400 |
commit | 2df72e9bc4c505d8357012f2924589f3d16f9d44 (patch) | |
tree | b5b0e8d63005300dd06fd779658639645d55a67b /virt | |
parent | 09941fbb712655cde9b350852be7a99a6f61a03f (diff) |
KVM: split kvm_arch_flush_shadow
Introducing kvm_arch_flush_shadow_memslot, to invalidate the
translations of a single memory slot.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 6425906d7cec..a4bf05be5fea 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -408,7 +408,7 @@ static void kvm_mmu_notifier_release(struct mmu_notifier *mn, | |||
408 | int idx; | 408 | int idx; |
409 | 409 | ||
410 | idx = srcu_read_lock(&kvm->srcu); | 410 | idx = srcu_read_lock(&kvm->srcu); |
411 | kvm_arch_flush_shadow(kvm); | 411 | kvm_arch_flush_shadow_all(kvm); |
412 | srcu_read_unlock(&kvm->srcu, idx); | 412 | srcu_read_unlock(&kvm->srcu, idx); |
413 | } | 413 | } |
414 | 414 | ||
@@ -582,7 +582,7 @@ static void kvm_destroy_vm(struct kvm *kvm) | |||
582 | #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) | 582 | #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) |
583 | mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm); | 583 | mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm); |
584 | #else | 584 | #else |
585 | kvm_arch_flush_shadow(kvm); | 585 | kvm_arch_flush_shadow_all(kvm); |
586 | #endif | 586 | #endif |
587 | kvm_arch_destroy_vm(kvm); | 587 | kvm_arch_destroy_vm(kvm); |
588 | kvm_free_physmem(kvm); | 588 | kvm_free_physmem(kvm); |
@@ -814,7 +814,7 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
814 | * - gfn_to_hva (kvm_read_guest, gfn_to_pfn) | 814 | * - gfn_to_hva (kvm_read_guest, gfn_to_pfn) |
815 | * - kvm_is_visible_gfn (mmu_check_roots) | 815 | * - kvm_is_visible_gfn (mmu_check_roots) |
816 | */ | 816 | */ |
817 | kvm_arch_flush_shadow(kvm); | 817 | kvm_arch_flush_shadow_memslot(kvm, slot); |
818 | kfree(old_memslots); | 818 | kfree(old_memslots); |
819 | } | 819 | } |
820 | 820 | ||
@@ -854,7 +854,7 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
854 | * mmio sptes. | 854 | * mmio sptes. |
855 | */ | 855 | */ |
856 | if (npages && old.base_gfn != mem->guest_phys_addr >> PAGE_SHIFT) | 856 | if (npages && old.base_gfn != mem->guest_phys_addr >> PAGE_SHIFT) |
857 | kvm_arch_flush_shadow(kvm); | 857 | kvm_arch_flush_shadow_all(kvm); |
858 | 858 | ||
859 | kvm_free_physmem_slot(&old, &new); | 859 | kvm_free_physmem_slot(&old, &new); |
860 | kfree(old_memslots); | 860 | kfree(old_memslots); |