KVM: selftests: use unified time type for comparison
authorBibo Mao <maobibo@loongson.cn>
Mon, 31 Jul 2023 02:24:05 +0000 (10:24 +0800)
committerSean Christopherson <seanjc@google.com>
Wed, 2 Aug 2023 20:36:08 +0000 (13:36 -0700)
commitb859b018aadfd05f0526533fd1bcf04024d01917
tree15f7d59a5dda43f79baa273573e93e0e5e38aaec
parent0de704d2d6c82c7498fa1b8df66903f8139e3de2
KVM: selftests: use unified time type for comparison

With test case kvm_page_table_test, start time is acquired with
time type CLOCK_MONOTONIC_RAW, however end time in timespec_elapsed()
is acquired with time type CLOCK_MONOTONIC. This can cause inaccurate
elapsed time calculation due to mixing timebases, e.g. LoongArch in
particular will see weirdness.

Modify kvm_page_table_test to use unified time type CLOCK_MONOTONIC for
start time.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20230731022405.854884-1-maobibo@loongson.cn
[sean: massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/kvm_page_table_test.c