summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-03-20 14:28:04 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-20 17:26:06 -0400
commitc746b3a4b84cc6eb2f8a45e89210f57d252d98fd (patch)
tree7f67f9a673e2199d87e2dad5b012a27f5207fe1b
parentee1fa209f5e5ca5c1e76c7aa1c2aab292f371f4a (diff)
KVM: VMX: Skip global INVVPID fallback if vpid==0 in vpid_sync_context()
Skip the global INVVPID in the unlikely scenario that vpid==0 and the SINGLE_CONTEXT variant of INVVPID is unsupported. If vpid==0, there's no need to INVVPID as it's impossible to do VM-Enter with VPID enabled and vmcs.VPID==0, i.e. there can't be any TLB entries for the vCPU with vpid==0. The fact that the SINGLE_CONTEXT variant isn't supported is irrelevant. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200320212833.3507-9-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx/ops.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx/ops.h b/arch/x86/kvm/vmx/ops.h
index 19717d0a1100..a1cb6d4114dc 100644
--- a/arch/x86/kvm/vmx/ops.h
+++ b/arch/x86/kvm/vmx/ops.h
@@ -300,7 +300,7 @@ static inline void vpid_sync_context(int vpid)
{
if (cpu_has_vmx_invvpid_single())
vpid_sync_vcpu_single(vpid);
- else
+ else if (vpid != 0)
vpid_sync_vcpu_global();
}