Skip to contentSkip to conversation

KVM: VMX: Use vpid_sync_context() directly when possible

PATCH linmiaohe 1 participant 1 message Feb 21, 2020 KVM

lore
Share & tools
lore

linmiaohe

author Reviewed-by
#0 lore raw
Quoted 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 by
vmx->nested.msrs.secondary_ctls_high.SECONDARY_EXEC_ENABLE_VPID being
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. call vpid_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.