KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page()

There is already a barrier inside of kvm_flush_remote_tlbs() which can
help to make sure everyone sees our modifications to the page tables and
see changes to vcpu->mode here. So remove the smp_mb in the
kvm_mmu_commit_zap_page() and update the comment.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Lan Tianyu 2016-03-13 11:10:24 +08:00 committed by Paolo Bonzini
parent b9baba8614
commit 9753f52915
1 changed files with 7 additions and 8 deletions

View File

@ -2390,14 +2390,13 @@ static void kvm_mmu_commit_zap_page(struct kvm *kvm,
return; return;
/* /*
* wmb: make sure everyone sees our modifications to the page tables * We need to make sure everyone sees our modifications to
* rmb: make sure we see changes to vcpu->mode * the page tables and see changes to vcpu->mode here. The barrier
*/ * in the kvm_flush_remote_tlbs() achieves this. This pairs
smp_mb(); * with vcpu_enter_guest and walk_shadow_page_lockless_begin/end.
*
/* * In addition, kvm_flush_remote_tlbs waits for all vcpus to exit
* Wait for all vcpus to exit guest mode and/or lockless shadow * guest mode and/or lockless shadow page table walks.
* page table walks.
*/ */
kvm_flush_remote_tlbs(kvm); kvm_flush_remote_tlbs(kvm);