Commit 7390de1e authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini
Browse files

Revert "KVM: x86: use the fast way to invalidate all pages"

Revert to a slow kvm_mmu_zap_all() for kvm_arch_flush_shadow_all().
Flushing all shadow entries is only done during VM teardown, i.e.
kvm_arch_flush_shadow_all() is only called when the associated MM struct
is being released or when the VM instance is being freed.

Although the performance of teardown itself isn't critical, KVM should
still voluntarily schedule to play nice with the rest of the kernel;
but that can be done without the fast invalidate mechanism in a future

This reverts commit 6ca18b69


Cc: Xiao Guangrong <>
Signed-off-by: default avatarSean Christopherson <>
Signed-off-by: default avatarPaolo Bonzini <>
parent b59c4830
......@@ -5846,6 +5846,21 @@ void kvm_mmu_slot_set_dirty(struct kvm *kvm,
void kvm_mmu_zap_all(struct kvm *kvm)
struct kvm_mmu_page *sp, *node;
list_for_each_entry_safe(sp, node, &kvm->arch.active_mmu_pages, link)
if (kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list))
goto restart;
kvm_mmu_commit_zap_page(kvm, &invalid_list);
static void kvm_zap_obsolete_pages(struct kvm *kvm)
struct kvm_mmu_page *sp, *node;
......@@ -9470,7 +9470,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
void kvm_arch_flush_shadow_all(struct kvm *kvm)
void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment