]> Gentwo Git Trees - linux/.git/commit
KVM: x86: Initialize allow_smaller_maxphyaddr earlier in setup
authorSean Christopherson <seanjc@google.com>
Mon, 22 Sep 2025 18:47:43 +0000 (11:47 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 23 Sep 2025 16:21:29 +0000 (09:21 -0700)
commitf705de12a22c945f55d51baec4ea495aedc5ebd7
tree9e1f244dcda1e3d4af32c6e6d98ffcd3b615d5c8
parent1f6f68fcfe43cf26fc0a98fe14e0454cc5c75416
KVM: x86: Initialize allow_smaller_maxphyaddr earlier in setup

Initialize allow_smaller_maxphyaddr during hardware setup as soon as KVM
knows whether or not TDP will be utilized.  To avoid having to teach KVM's
emulator all about CET, KVM's upcoming CET virtualization support will be
mutually exclusive with allow_smaller_maxphyaddr, i.e. will disable SHSTK
and IBT if allow_smaller_maxphyaddr is enabled.

In general, allow_smaller_maxphyaddr should be initialized as soon as
possible since it's globally visible while its only input is whether or
not EPT/NPT is enabled.  I.e. there's effectively zero risk of setting
allow_smaller_maxphyaddr too early, and substantial risk of setting it
too late.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250922184743.1745778-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c