]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Add tests in xen_shinfo_test to detect lock races
authorMichal Luczaj <mhal@rbox.co>
Thu, 13 Oct 2022 21:12:33 +0000 (21:12 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Oct 2022 10:10:27 +0000 (06:10 -0400)
commitf2d7dea3fc52381935704752bdd164b4495056aa
tree9c7c70859b3392cfa472e6a3ab023a429fec1100
parent0d2d5bde19ed87f2dc67350d907a4f116479b763
KVM: selftests: Add tests in xen_shinfo_test to detect lock races

Tests for races between shinfo_cache (de)activation and hypercall+ioctl()
processing.  KVM has had bugs where activating the shared info cache
multiple times and/or with concurrent users results in lock corruption,
NULL pointer dereferences, and other fun.

For the timer injection testcase (#22), re-arm the timer until the IRQ
is successfully injected.  If the timer expires while the shared info
is deactivated (invalid), KVM will drop the event.

Signed-off-by: Michal Luczaj <mhal@rbox.co>
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221013211234.1318131-16-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c