]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:24:49 +0000 (09:24 +0100)
commit267f7b04effa57378596b4f35e2b16b54232cf13
treeab9d9e71f872d4e45c77c536271178f5ecd3448d
parent03aee9284d9b0ea12243815a0f054209f86f6adf
KVM: selftests: Avoid infinite loop in hyperv_features when invtsc is missing

[ Upstream commit 8ad4855273488c9bd5320b3fee80f66f0023f326 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/kvm/x86_64/hyperv_features.c