KVM: VMX: Ensure CPU is stable when probing basic VMX support
authorSean Christopherson <seanjc@google.com>
Fri, 21 Jul 2023 20:18:55 +0000 (13:18 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 3 Aug 2023 22:37:15 +0000 (15:37 -0700)
commitf9a8866040fcf8672f20c67e07e67ba5a00caba4
treee761a41f92be8c12f63472718d79bc07c0f14884
parentc4db4f20f3bf619bacd3d705bf427016453eedb1
KVM: VMX: Ensure CPU is stable when probing basic VMX support

Disable migration when probing VMX support during module load to ensure
the CPU is stable, mostly to match similar SVM logic, where allowing
migration effective requires deliberately writing buggy code.  As a bonus,
KVM won't report the wrong CPU to userspace if VMX is unsupported, but in
practice that is a very, very minor bonus as the only way that reporting
the wrong CPU would actually matter is if hardware is broken or if the
system is misconfigured, i.e. if KVM gets migrated from a CPU that _does_
support VMX to a CPU that does _not_ support VMX.

Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20230721201859.2307736-16-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c