summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2024-01-09 17:11:19 +0300
committerSean Christopherson <seanjc@google.com>2024-02-01 19:58:14 +0300
commit09951bf2cbb3a7893f76d1364b0ae6e3007ff1de (patch)
tree019184eb1ef6084978e7981fe709ba5ed6b69d43 /tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c
parent410cb01ead5bcec500c0654f361d620553f930aa (diff)
downloadlinux-09951bf2cbb3a7893f76d1364b0ae6e3007ff1de.tar.xz
KVM: selftests: Run clocksource dependent tests with hyperv_clocksource_tsc_page too
KVM's 'gtod_is_based_on_tsc()' recognizes two clocksources: 'tsc' and 'hyperv_clocksource_tsc_page' and enables kvmclock in 'masterclock' mode when either is in use. Transform 'sys_clocksource_is_tsc()' into 'sys_clocksource_is_based_on_tsc()' to support the later. This affects two tests: kvm_clock_test and vmx_nested_tsc_scaling_test, both seem to work well when system clocksource is 'hyperv_clocksource_tsc_page'. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Link: https://lore.kernel.org/r/20240109141121.1619463-4-vkuznets@redhat.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c')
-rw-r--r--tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c b/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c
index 93b0a850a240..1759fa5cb3f2 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_VMX));
TEST_REQUIRE(kvm_has_cap(KVM_CAP_TSC_CONTROL));
- TEST_REQUIRE(sys_clocksource_is_tsc());
+ TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
/*
* We set L1's scale factor to be a random number from 2 to 10.