Skip to content

Commit b6831a1

Browse files
vittyvksean-jc
authored andcommitted
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>
1 parent 09951bf commit b6831a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/kvm/x86_64/hyperv_clock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ int main(void)
212212
int stage;
213213

214214
TEST_REQUIRE(kvm_has_cap(KVM_CAP_HYPERV_TIME));
215+
TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
215216

216217
vm = vm_create_with_one_vcpu(&vcpu, guest_main);
217218

0 commit comments

Comments
 (0)