summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-03-20 14:28:14 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-21 09:12:50 -0400
commit5058b692c69997f9736b94df786509366c32f34d (patch)
tree70a09557ef63247471093df0e5a90053e61f85ce
parent72b38320872666f7fb6ff9564bf91139c685c234 (diff)
KVM: VMX: Move vmx_flush_tlb() to vmx.c
Move vmx_flush_tlb() to vmx.c and make it non-inline static now that all its callers live in vmx.c. No functional change intended. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200320212833.3507-19-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx/vmx.c25
-rw-r--r--arch/x86/kvm/vmx/vmx.h25
2 files changed, 25 insertions, 25 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index d843ef34aafd..3cdca4d03c07 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2838,6 +2838,31 @@ static void exit_lmode(struct kvm_vcpu *vcpu)
#endif
+static void vmx_flush_tlb(struct kvm_vcpu *vcpu)
+{
+ struct vcpu_vmx *vmx = to_vmx(vcpu);
+
+ /*
+ * Flush all EPTP/VPID contexts, as the TLB flush _may_ have been
+ * invoked via kvm_flush_remote_tlbs(). Flushing remote TLBs requires
+ * all contexts to be flushed, not just the active context.
+ *
+ * Note, this also ensures a deferred TLB flush with VPID enabled and
+ * EPT disabled invalidates the "correct" VPID, by nuking both L1 and
+ * L2's VPIDs.
+ */
+ if (enable_ept) {
+ ept_sync_global();
+ } else if (enable_vpid) {
+ if (cpu_has_vmx_invvpid_global()) {
+ vpid_sync_vcpu_global();
+ } else {
+ vpid_sync_vcpu_single(vmx->vpid);
+ vpid_sync_vcpu_single(vmx->nested.vpid02);
+ }
+ }
+}
+
static void vmx_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t addr)
{
/*
diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
index 45978552524e..4c7b0713b438 100644
--- a/arch/x86/kvm/vmx/vmx.h
+++ b/arch/x86/kvm/vmx/vmx.h
@@ -500,31 +500,6 @@ static inline struct vmcs *alloc_vmcs(bool shadow)
u64 construct_eptp(struct kvm_vcpu *vcpu, unsigned long root_hpa);
-static inline void vmx_flush_tlb(struct kvm_vcpu *vcpu)
-{
- struct vcpu_vmx *vmx = to_vmx(vcpu);
-
- /*
- * Flush all EPTP/VPID contexts, as the TLB flush _may_ have been
- * invoked via kvm_flush_remote_tlbs(). Flushing remote TLBs requires
- * all contexts to be flushed, not just the active context.
- *
- * Note, this also ensures a deferred TLB flush with VPID enabled and
- * EPT disabled invalidates the "correct" VPID, by nuking both L1 and
- * L2's VPIDs.
- */
- if (enable_ept) {
- ept_sync_global();
- } else if (enable_vpid) {
- if (cpu_has_vmx_invvpid_global()) {
- vpid_sync_vcpu_global();
- } else {
- vpid_sync_vcpu_single(vmx->vpid);
- vpid_sync_vcpu_single(vmx->nested.vpid02);
- }
- }
-}
-
static inline void decache_tsc_multiplier(struct vcpu_vmx *vmx)
{
vmx->current_tsc_ratio = vmx->vcpu.arch.tsc_scaling_ratio;