]> git.itanic.dy.fi Git - linux-stable/commit
KVM: selftests: Avoid infinite loop in hyperv_features when invtsc is missing
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 29 Jan 2024 08:58:46 +0000 (09:58 +0100)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 20:32:03 +0000 (12:32 -0800)
commit8ad4855273488c9bd5320b3fee80f66f0023f326
tree01ea4ac6ce1a9129badc57cf8af37e3826bbcf80
parent46fee9e38995af9ae16a8cc7d05031486d44cf35
KVM: selftests: Avoid infinite loop in hyperv_features when invtsc is missing

When X86_FEATURE_INVTSC is missing, guest_test_msrs_access() was supposed
to skip testing dependent Hyper-V invariant TSC feature. Unfortunately,
'continue' does not lead to that as stage is not incremented. Moreover,
'vm' allocated with vm_create_with_one_vcpu() is not freed and the test
runs out of available file descriptors very quickly.

Fixes: bd827bd77537 ("KVM: selftests: Test Hyper-V invariant TSC control")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20240129085847.2674082-1-vkuznets@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/hyperv_features.c