summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorJunaid Shahid2018-06-27 23:59:12 +0200
committerPaolo Bonzini2018-08-06 17:58:55 +0200
commitafe828d1de4047d26eb0cd0c0154f5ac3722bf63 (patch)
treedde4847d96f41b66542bcf81c65b351d273a1f6f /arch/x86/kvm/mmu.c
parentkvm: x86: Use fast CR3 switch for nested VMX (diff)
downloadkernel-qcow2-linux-afe828d1de4047d26eb0cd0c0154f5ac3722bf63.tar.gz
kernel-qcow2-linux-afe828d1de4047d26eb0cd0c0154f5ac3722bf63.tar.xz
kernel-qcow2-linux-afe828d1de4047d26eb0cd0c0154f5ac3722bf63.zip
kvm: x86: Add ability to skip TLB flush when switching CR3
Remove the implicit flush from the set_cr3 handlers, so that the callers are able to decide whether to flush the TLB or not. Signed-off-by: Junaid Shahid <junaids@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 9b73cfcef917..d3a04cf6514b 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4070,6 +4070,7 @@ static bool fast_cr3_switch(struct kvm_vcpu *vcpu, gpa_t new_cr3,
kvm_make_request(KVM_REQ_LOAD_CR3, vcpu);
kvm_make_request(KVM_REQ_MMU_SYNC, vcpu);
+ kvm_x86_ops->tlb_flush(vcpu, true);
__clear_sp_write_flooding_count(
page_header(mmu->root_hpa));
@@ -4851,6 +4852,7 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu)
if (r)
goto out;
kvm_mmu_load_cr3(vcpu);
+ kvm_x86_ops->tlb_flush(vcpu, true);
out:
return r;
}