diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2024-01-09 15:11:20 +0100 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-02-01 08:58:15 -0800 |
commit | b6831a108be1206cd9f0e7905b48677b4147d5f9 (patch) | |
tree | ec5a132fb8d2612e8a2e6f97333d9763ec10049a /tools/testing/selftests/kvm | |
parent | 09951bf2cbb3a7893f76d1364b0ae6e3007ff1de (diff) | |
download | linux-stable-b6831a108be1206cd9f0e7905b48677b4147d5f9.tar.gz linux-stable-b6831a108be1206cd9f0e7905b48677b4147d5f9.tar.bz2 linux-stable-b6831a108be1206cd9f0e7905b48677b4147d5f9.zip |
KVM: selftests: Make hyperv_clock require TSC based system clocksource
KVM sets up Hyper-V TSC page clocksource for its guests when system
clocksource is 'based on TSC' (see gtod_is_based_on_tsc()), running
hyperv_clock with any other clocksource leads to imminent failure.
Add the missing requirement to make the test skip gracefully.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20240109141121.1619463-5-vkuznets@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/hyperv_clock.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_clock.c b/tools/testing/selftests/kvm/x86_64/hyperv_clock.c index 65690d916db7..e058bc676cd6 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_clock.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_clock.c @@ -212,6 +212,7 @@ int main(void) int stage; TEST_REQUIRE(kvm_has_cap(KVM_CAP_HYPERV_TIME)); + TEST_REQUIRE(sys_clocksource_is_based_on_tsc()); vm = vm_create_with_one_vcpu(&vcpu, guest_main); |