summaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2014-04-17 11:06:12 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2014-04-23 22:49:48 +0200
commita086f6a1ebc9d8d2d028b99e779ce0dbd9691dea (patch)
treede33d7b00d27226d7b775dd038875f12d55c6e0a /virt/kvm/kvm_main.c
parentKVM: x86: Processor mode may be determined incorrectly (diff)
downloadlinux-a086f6a1ebc9d8d2d028b99e779ce0dbd9691dea.tar.xz
linux-a086f6a1ebc9d8d2d028b99e779ce0dbd9691dea.zip
Revert "KVM: Simplify kvm->tlbs_dirty handling"
This reverts commit 5befdc385ddb2d5ae8995ad89004529a3acf58fc. Since we will allow flush tlb out of mmu-lock in the later patch Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ea46d64c8e75..fa70c6e642b4 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -186,9 +186,12 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
void kvm_flush_remote_tlbs(struct kvm *kvm)
{
+ long dirty_count = kvm->tlbs_dirty;
+
+ smp_mb();
if (make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
++kvm->stat.remote_tlb_flush;
- kvm->tlbs_dirty = false;
+ cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
}
EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);