KVM: selftests: Add stress test for LPI injection
authorOliver Upton <oliver.upton@linux.dev>
Mon, 22 Apr 2024 20:01:58 +0000 (20:01 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 25 Apr 2024 12:19:56 +0000 (13:19 +0100)
commit96d36ad95b03c89857d405b3317efb0188ac59cb
tree372ce0640426c2e71dd800322d0d54889104f593
parentc3c369b508d9a447436b7abb2fded9aec18953ff
KVM: selftests: Add stress test for LPI injection

Now that all the infrastructure is in place, add a test to stress KVM's
LPI injection. Keep a 1:1 mapping of device IDs to signalling threads,
allowing the user to scale up/down the sender side of an LPI. Make use
of the new VM stats for the translation cache to estimate the
translation hit rate.

Since the primary focus of the test is on performance, you'll notice
that the guest code is not pedantic about the LPIs it receives. Counting
the number of LPIs would require synchronization between the device and
vCPU threads to avoid coalescing and would get in the way of performance
numbers.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240422200158.2606761-20-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/aarch64/vgic_lpi_stress.c [new file with mode: 0644]