aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-14 20:06:40 +0000
committerSean Christopherson <seanjc@google.com>2022-07-13 18:14:13 -0700
commit3c67f8208451a864478b9bf049782159fc925e11 (patch)
tree751af5adaa533cf40270e1a568fb74a3717c015b /tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c
parentKVM: selftests: Use kvm_cpu_has() for KVM's PV steal time (diff)
downloadlinux-dev-3c67f8208451a864478b9bf049782159fc925e11.tar.xz
linux-dev-3c67f8208451a864478b9bf049782159fc925e11.zip
KVM: selftests: Use kvm_cpu_has() for nSVM soft INT injection test
Use kvm_cpu_has() to query for NRIPS support instead of open coding equivalent functionality using kvm_get_supported_cpuid_entry(). Signed-off-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20220614200707.3315957-16-seanjc@google.com
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c')
-rw-r--r--tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c b/tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c
index 2cc09ab41570..e637d7736012 100644
--- a/tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c
+++ b/tools/testing/selftests/kvm/x86_64/svm_nested_soft_inject_test.c
@@ -194,16 +194,13 @@ done:
int main(int argc, char *argv[])
{
- struct kvm_cpuid_entry2 *cpuid;
-
/* Tell stdout not to buffer its content */
setbuf(stdout, NULL);
TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM));
- cpuid = kvm_get_supported_cpuid_entry(0x8000000a);
- TEST_ASSERT(cpuid->edx & CPUID_NRIPS,
- "KVM with nSVM is supposed to unconditionally advertise nRIP Save\n");
+ TEST_ASSERT(kvm_cpu_has(X86_FEATURE_NRIPS),
+ "KVM with nSVM is supposed to unconditionally advertise nRIP Save");
atomic_init(&nmi_stage, 0);