]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Check KVM's supported CPUID, not host CPUID, for XFD
authorSean Christopherson <seanjc@google.com>
Tue, 14 Jun 2022 20:07:03 +0000 (20:07 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 14 Jul 2022 01:14:24 +0000 (18:14 -0700)
commit9898b42ff38e8a1c4512418b955d908e67e5796b
tree3187b300ae0672fbfe144d4ae8f92f8fc4a3c5fd
parent634b4617a4abc1a3305ae9b0cf0b573a9abb3661
KVM: selftests: Check KVM's supported CPUID, not host CPUID, for XFD

Use kvm_cpu_has() to check for XFD supported in vm_xsave_req_perm(),
simply checking host CPUID doesn't guarantee KVM supports AMX/XFD.

Opportunistically hoist the check above the bit check; if XFD isn't
supported, it's far better to get a "not supported at all" message, as
opposed to a "feature X isn't supported" message".

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