KVM: selftests: Disallow "get supported CPUID" before REQ_XCOMP_GUEST_PERM
authorSean Christopherson <seanjc@google.com>
Mon, 28 Nov 2022 22:57:34 +0000 (22:57 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 1 Dec 2022 23:31:45 +0000 (15:31 -0800)
commitcd5f3d210095347e9d40a9a1d464f5ee0bb5d7f2
tree5a7273eac6ffa3bc87cad03b4f94b68e1ee96d23
parent2ceade1d363c934633a1788d0f98fc2332062b92
KVM: selftests: Disallow "get supported CPUID" before REQ_XCOMP_GUEST_PERM

Disallow using kvm_get_supported_cpuid() and thus caching KVM's supported
CPUID info before enabling XSAVE-managed features that are off-by-default
and must be enabled by ARCH_REQ_XCOMP_GUEST_PERM.  Caching the supported
CPUID before all XSAVE features are enabled can result in false negatives
due to testing features that were cached before they were enabled.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221128225735.3291648-4-seanjc@google.com
tools/testing/selftests/kvm/lib/x86_64/processor.c