KVM: x86: Add a macro to precisely handle aliased 0x1.EDX CPUID features
authorSean Christopherson <seanjc@google.com>
Thu, 28 Nov 2024 01:33:52 +0000 (17:33 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 18 Dec 2024 22:19:48 +0000 (14:19 -0800)
commit264969b48a295e3fd89f01d3584a9f3cf6b47eb1
tree2553e92348c5741e2a909d1cf70dca992b0564f1
parent6eac4d99a9677a35947aa115bbc60266def40c3e
KVM: x86: Add a macro to precisely handle aliased 0x1.EDX CPUID features

Add a macro to precisely handle CPUID features that AMD duplicated from
CPUID.0x1.EDX into CPUID.0x8000_0001.EDX.  This will allow adding an
assert that all features passed to kvm_cpu_cap_init() match the word being
processed, e.g. to prevent passing a feature from CPUID 0x7 to CPUID 0x1.

Because the kernel simply reuses the X86_FEATURE_* definitions from
CPUID.0x1.EDX, KVM's use of the aliased features would result in false
positives from such an assert.

No functional change intended.

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