KVM: selftests: Add this_cpu_has() to query X86_FEATURE_* via cpuid()
authorSean Christopherson <seanjc@google.com>
Tue, 14 Jun 2022 20:06:57 +0000 (20:06 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 14 Jul 2022 01:14:21 +0000 (18:14 -0700)
commit48ce3ed052e8336a17c64ca1787648d9e17c54d9
treec64d956e7c919eede9a5e890634533b08297c36a
parent8fe09d6a91be94be6910d843bb21d60b1fc99cd2
KVM: selftests: Add this_cpu_has() to query X86_FEATURE_* via cpuid()

Add this_cpu_has() to query an X86_FEATURE_* via cpuid(), i.e. to query a
feature from L1 (or L2) guest code.  Arbitrarily select the AMX test to
be the first user.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20220614200707.3315957-33-seanjc@google.com
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/x86_64/amx_test.c