]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: nVMX: Setup VMX MSRs on loading CPU during nested_vmx_hardware_setup()
authorSean Christopherson <seanjc@google.com>
Thu, 15 Jan 2026 17:34:24 +0000 (09:34 -0800)
committerSean Christopherson <seanjc@google.com>
Fri, 16 Jan 2026 15:47:59 +0000 (07:47 -0800)
commit26304e0e694f4cacc30bcf757663f26533351fbd
treec980a35ed09b85dc6856b66fc74dc63842cf7ef1
parent6c8512a5b7f44caf981cee4ffa2a4ac73e627732
KVM: nVMX: Setup VMX MSRs on loading CPU during nested_vmx_hardware_setup()

Move the call to nested_vmx_setup_ctls_msrs() from vmx_hardware_setup() to
nested_vmx_hardware_setup() so that the nested code can deal with ordering
dependencies without having to straddle vmx_hardware_setup() and
nested_vmx_hardware_setup().  Specifically, an upcoming change will
sanitize the vmcs12 fields based on hardware support, and that code needs
to run _before_ the MSRs are configured, because the lovely vmcs_enum MSR
depends on the max support vmcs12 field.

No functional change intended.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://patch.msgid.link/20260115173427.716021-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c