[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1457838631-26775-2-git-send-email-tianyu.lan@intel.com>
Date: Sun, 13 Mar 2016 11:10:24 +0800
From: Lan Tianyu <tianyu.lan@...el.com>
To: gleb@...nel.org, pbonzini@...hat.com, tglx@...utronix.de,
mingo@...hat.com, hpa@...or.com, x86@...nel.org,
guangrong.xiao@...ux.intel.com
Cc: Lan Tianyu <tianyu.lan@...el.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/7] 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@...el.com>
---
arch/x86/kvm/mmu.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 2463de0..5e795af 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2390,14 +2390,12 @@ static void kvm_mmu_commit_zap_page(struct kvm *kvm,
return;
/*
- * wmb: make sure everyone sees our modifications to the page tables
- * rmb: make sure we see changes to vcpu->mode
- */
- smp_mb();
-
- /*
- * Wait for all vcpus to exit guest mode and/or lockless shadow
- * page table walks.
+ * We need to make sure everyone sees our modifications to
+ * the page tables and see changes to vcpu->mode here. The barrier
+ * in the kvm_flush_remote_tlbs() helps us to achieve these. This pairs
+ * with vcpu_enter_guest and walk_shadow_page_lockless_begin/end.
+ * In addition, wait for all vcpus to exit guest mode and/or lockless
+ * shadow page table walks.
*/
kvm_flush_remote_tlbs(kvm);
--
1.8.4.rc0.1.g8f6a3e5.dirty
Powered by blists - more mailing lists