summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorTianyu Lan <Tianyu.Lan@microsoft.com>2018-07-19 08:40:17 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2018-08-06 17:59:06 +0200
commitb08660e59dbdb600c55953787ed2265a0b510f77 (patch)
tree3016620245ab6babe9c65babdcff9730f2578072 /virt
parent60cfce4c4f6f6741882032ee6f895e835533a16b (diff)
downloadlinux-b08660e59dbdb600c55953787ed2265a0b510f77.tar.bz2
KVM: x86: Add tlb remote flush callback in kvm_x86_ops.
This patch is to provide a way for platforms to register hv tlb remote flush callback and this helps to optimize operation of tlb flush among vcpus for nested virtualization case. Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 8f461e0ed382..74544d20bbf8 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -273,7 +273,8 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
* kvm_make_all_cpus_request() reads vcpu->mode. We reuse that
* barrier here.
*/
- if (kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
+ if (!kvm_arch_flush_remote_tlb(kvm)
+ || kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
++kvm->stat.remote_tlb_flush;
cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
}