]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: VMX: Unconditionally allocate root VMCSes during boot CPU bringup
authorSean Christopherson <seanjc@google.com>
Sat, 14 Feb 2026 01:26:50 +0000 (17:26 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 4 Mar 2026 16:52:34 +0000 (08:52 -0800)
commit405b7c27934eaabbcc52ccfbaeb22ef966b6b5f0
tree22636e084c89151f646c92a817c24db3a1bf0208
parenta1450a8156c65d9fe6111627094c26359d2e2274
KVM: VMX: Unconditionally allocate root VMCSes during boot CPU bringup

Allocate the root VMCS (misleading called "vmxarea" and "kvm_area" in KVM)
for each possible CPU during early boot CPU bringup, before early TDX
initialization, so that TDX can eventually do VMXON on-demand (to make
SEAMCALLs) without needing to load kvm-intel.ko.  Allocate the pages early
on, e.g. instead of trying to do so on-demand, to avoid having to juggle
allocation failures at runtime.

Opportunistically rename the per-CPU pointers to better reflect the role
of the VMCS.  Use Intel's "root VMCS" terminology, e.g. from various VMCS
patents[1][2] and older SDMs, not the more opaque "VMXON region" used in
recent versions of the SDM.  While it's possible the VMCS passed to VMXON
no longer serves as _the_ root VMCS on modern CPUs, it is still in effect
a "root mode VMCS", as described in the patents.

Link: https://patentimages.storage.googleapis.com/c7/e4/32/d7a7def5580667/WO2013101191A1.pdf
Link: https://patentimages.storage.googleapis.com/13/f6/8d/1361fab8c33373/US20080163205A1.pdf
Tested-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Sagi Shahar <sagis@google.com>
Link: https://patch.msgid.link/20260214012702.2368778-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/virt.h
arch/x86/kernel/cpu/common.c
arch/x86/kvm/vmx/vmx.c
arch/x86/virt/hw.c