]> Gentwo Git Trees - linux/.git/commit
KVM: VMX: Setup canonical VMCS config prior to kvm_x86_vendor_init()
authorSean Christopherson <seanjc@google.com>
Wed, 6 Aug 2025 19:56:36 +0000 (12:56 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 18 Sep 2025 19:56:28 +0000 (12:56 -0700)
commit4687a2c4e6a61b247ad14ffb2ef5ca56e44fa4f2
tree6ccb5d3cb41a368714a562b047233d29531d2966
parent5b5133e6a55bf6ca18de1b33c2ffe17d1162ec8e
KVM: VMX: Setup canonical VMCS config prior to kvm_x86_vendor_init()

Setup the golden VMCS config during vmx_init(), before the call to
kvm_x86_vendor_init(), instead of waiting until the callback to do
hardware setup.  setup_vmcs_config() only touches VMX state, i.e. doesn't
poke anything in kvm.ko, and has no runtime dependencies beyond
hv_init_evmcs().

Setting the VMCS config early on will allow referencing VMCS and VMX
capabilities at any point during setup, e.g. to check for PERF_GLOBAL_CTRL
save/load support during mediated PMU initialization.

Tested-by: Xudong Hao <xudong.hao@intel.com>
Link: https://lore.kernel.org/r/20250806195706.1650976-15-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c