diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2013-05-30 20:36:23 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-06-05 05:32:42 -0400 |
commit | 6ca18b6950f8dee29361722f28f69847724b276f (patch) | |
tree | a568f5a7310809f1f299eae585128987b8385d44 | |
parent | 5304b8d37c2a5ebca48330f5e7868d240eafbed1 (diff) |
KVM: x86: use the fast way to invalidate all pages
Replace kvm_mmu_zap_all by kvm_mmu_invalidate_zap_all_pages
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 15 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
2 files changed, 2 insertions, 17 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d71bf8fcccf8..c8063b9b30ee 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -4194,21 +4194,6 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot) | |||
4194 | spin_unlock(&kvm->mmu_lock); | 4194 | spin_unlock(&kvm->mmu_lock); |
4195 | } | 4195 | } |
4196 | 4196 | ||
4197 | void kvm_mmu_zap_all(struct kvm *kvm) | ||
4198 | { | ||
4199 | struct kvm_mmu_page *sp, *node; | ||
4200 | LIST_HEAD(invalid_list); | ||
4201 | |||
4202 | spin_lock(&kvm->mmu_lock); | ||
4203 | restart: | ||
4204 | list_for_each_entry_safe(sp, node, &kvm->arch.active_mmu_pages, link) | ||
4205 | if (kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list)) | ||
4206 | goto restart; | ||
4207 | |||
4208 | kvm_mmu_commit_zap_page(kvm, &invalid_list); | ||
4209 | spin_unlock(&kvm->mmu_lock); | ||
4210 | } | ||
4211 | |||
4212 | static void kvm_zap_obsolete_pages(struct kvm *kvm) | 4197 | static void kvm_zap_obsolete_pages(struct kvm *kvm) |
4213 | { | 4198 | { |
4214 | struct kvm_mmu_page *sp, *node; | 4199 | struct kvm_mmu_page *sp, *node; |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3758ff910d1f..15e10f7e68ac 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -7066,13 +7066,13 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, | |||
7066 | 7066 | ||
7067 | void kvm_arch_flush_shadow_all(struct kvm *kvm) | 7067 | void kvm_arch_flush_shadow_all(struct kvm *kvm) |
7068 | { | 7068 | { |
7069 | kvm_mmu_zap_all(kvm); | 7069 | kvm_mmu_invalidate_zap_all_pages(kvm); |
7070 | } | 7070 | } |
7071 | 7071 | ||
7072 | void kvm_arch_flush_shadow_memslot(struct kvm *kvm, | 7072 | void kvm_arch_flush_shadow_memslot(struct kvm *kvm, |
7073 | struct kvm_memory_slot *slot) | 7073 | struct kvm_memory_slot *slot) |
7074 | { | 7074 | { |
7075 | kvm_arch_flush_shadow_all(kvm); | 7075 | kvm_mmu_invalidate_zap_all_pages(kvm); |
7076 | } | 7076 | } |
7077 | 7077 | ||
7078 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) | 7078 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) |