Skip to content

KVM: selftests: Fix clocksource requirements in tests

Vitaly Kuznetsov kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: selftests: Generalize check_clocksource() from kvm_clock_testtools/testing/selftests/kvm/include/test_util.h tools/testing/selftests/kvm/include/x86_64/processor.h tools/testing/selftests/kvm/lib/test_util.c +2 more+43 -371 reply
2/5KVM: selftests: Use generic sys_clocksource_is_tsc() in vmx_nested_tsc_scaling_testtools/testing/selftests/kvm/x86_64/vmx_nested_tsc_scaling_test.c+1 -180 replies
3/5KVM: selftests: Run clocksource dependent tests with hyperv_clocksource_tsc_page tootools/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 +1 more+6 -40 replies
4/5KVM: selftests: Make hyperv_clock require TSC based system clocksourcetools/testing/selftests/kvm/x86_64/hyperv_clock.c+1 -00 replies
5/5KVM: x86: Make gtod_is_based_on_tsc() return 'bool'arch/x86/kvm/x86.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] KVM: selftests: Fix clocksource requirements in tests

It was discovered that 'hyperv_clock' fails miserably when the system is using an unsupported (by KVM) clocksource, e.g. 'kvm-clock'. The root cause of the failure is that 'hyperv_clock' doesn't actually check which clocksource is currently in use. Other tests (kvm_clock_test, vmx_nested_tsc_scaling_test) have the required check but each test does it on its own.

Generalize clocksource checking infrastructure, make all three clocksource dependent tests run with 'tsc' and 'hyperv_clocksource_tsc_page', and skip gracefully when run in an unsupported configuration.

The last patch of the series is a loosely related minor nitpick for KVM code itself.

Vitaly Kuznetsov (5):
KVM: selftests: Generalize check_clocksource() from kvm_clock_test
KVM: selftests: Use generic sys_clocksource_is_tsc() in
vmx_nested_tsc_scaling_test
KVM: selftests: Run clocksource dependent tests with
hyperv_clocksource_tsc_page too
KVM: selftests: Make hyperv_clock require TSC based system clocksource
KVM: x86: Make gtod_is_based_on_tsc() return 'bool'

 arch/x86/kvm/x86.c                            |  2 +-
 .../testing/selftests/kvm/include/test_util.h |  2 +
 .../selftests/kvm/include/x86_64/processor.h  |  2 +
 tools/testing/selftests/kvm/lib/test_util.c   | 25 ++++++++++++
 .../selftests/kvm/lib/x86_64/processor.c      | 15 ++++++++
 .../selftests/kvm/x86_64/hyperv_clock.c       |  1 +
 .../selftests/kvm/x86_64/kvm_clock_test.c     | 38 +------------------
 .../kvm/x86_64/vmx_nested_tsc_scaling_test.c  | 19 +---------
 8 files changed, 48 insertions(+), 56 deletions(-)

base-commit: 7f26fea9bc085290e3731501f4f8fc5b82b9d615

Signature · 1 line
2.43.0