KVM: VMX: Use vpid_sync_context() directly when possible
linmiaohe
Reviewed-byQuoted 10 lines · Sean Christopherson
Use
vpid_sync_context()directly for flows that run if and only if enable_vpid=1, or more specifically, nested VMX flows that are gated byvmx->nested.msrs.secondary_ctls_high.SECONDARY_EXEC_ENABLE_VPIDbeing
set, which is allowed if and only if enable_vpid=1. Because these flows call__vmx_flush_tlb()with @invalidate_gpa=false, the if-statement that decides between INVEPT and >INVVPID will always go down the INVVPID path, i.e. callvpid_sync_context()because "enable_ept&& (invalidate_gpa|| !enable_vpid)" always evaluates false.This helps pave the way toward removing @invalidate_gpa and @vpid from
__vmx_flush_tlb()and its callers.No functional change intended.
Signed-off-by Sean Christopherson <[email protected]>
Reviewed-by Miaohe Lin <[email protected]>