KVM: selftests: Do kvm_cpu_has() checks before creating VM+vCPU
authorSean Christopherson <seanjc@google.com>
Mon, 28 Nov 2022 22:57:35 +0000 (22:57 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 1 Dec 2022 23:31:46 +0000 (15:31 -0800)
commit553d1652b8615b5ae3080bb1a561207aee87fa85
treed26d48e1fea36af58745b1e1330aff9a0bfb8fad
parentcd5f3d210095347e9d40a9a1d464f5ee0bb5d7f2
KVM: selftests: Do kvm_cpu_has() checks before creating VM+vCPU

Move the AMX test's kvm_cpu_has() checks before creating the VM+vCPU,
there are no dependencies between the two operations.  Opportunistically
add a comment to call out that enabling off-by-default XSAVE-managed
features must be done before KVM_GET_SUPPORTED_CPUID is cached.

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