]> git.itanic.dy.fi Git - linux-stable/commit
KVM: selftests: Run clocksource dependent tests with hyperv_clocksource_tsc_page too
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 9 Jan 2024 14:11:19 +0000 (15:11 +0100)
committerSean Christopherson <seanjc@google.com>
Thu, 1 Feb 2024 16:58:14 +0000 (08:58 -0800)
commit09951bf2cbb3a7893f76d1364b0ae6e3007ff1de
tree019184eb1ef6084978e7981fe709ba5ed6b69d43
parent410cb01ead5bcec500c0654f361d620553f930aa
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>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/kvm_clock_test.c
tools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c