KVM: x86: Add a macro for features that are synthesized into boot_cpu_data
authorSean Christopherson <seanjc@google.com>
Thu, 28 Nov 2024 01:34:19 +0000 (17:34 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 18 Dec 2024 22:20:18 +0000 (14:20 -0800)
commit75c489e12d4b90d8aa5ffb34c3c907ef717fe38e
treefd37384d74eba60a2a58bcd67ab59e0515413f06
parentcbdeea032bfe24ad9ef13a0c476ada405316758d
KVM: x86: Add a macro for features that are synthesized into boot_cpu_data

Add yet another CPUID macro, this time for features that the host kernel
synthesizes into boot_cpu_data, i.e. that the kernel force sets even in
situations where the feature isn't reported by CPUID.  Thanks to the
macro shenanigans of kvm_cpu_cap_init(), such features can now be handled
in the core CPUID framework, i.e. don't need to be handled out-of-band and
thus without as many guardrails.

Adding a dedicated macro also helps document what's going on, e.g. the
calls to kvm_cpu_cap_check_and_set() are very confusing unless the reader
knows exactly how kvm_cpu_cap_init() generates kvm_cpu_caps (and even
then, it's far from obvious).

Link: https://lore.kernel.org/r/20241128013424.4096668-53-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/cpuid.c