selftests: kvm: add hardware_disable test
authorIgnacio Alvarado <ikalvarado@google.com>
Sat, 13 Feb 2021 00:14:52 +0000 (00:14 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 15 Feb 2021 16:42:36 +0000 (11:42 -0500)
commit1838b06bf01ac2b1b9ea808aa5962d5324b4da8f
treefe42932b4834f33a01d5a27b3b789e648e41fad3
parent8c6e67bec3192f16fa624203c8131e10cc4814ba
selftests: kvm: add hardware_disable test

This test launches 512 VMs in serial and kills them after a random
amount of time.

The test was original written to exercise KVM user notifiers in
the context of1650b4ebc99d:
- KVM: Disable irq while unregistering user notifier
- https://lore.kernel.org/kvm/CACXrx53vkO=HKfwWwk+fVpvxcNjPrYmtDZ10qWxFvVX_PTGp3g@mail.gmail.com/

Recently, this test piqued my interest because it proved useful to
for AMD SNP in exercising the "in-use" pages, described in APM section
15.36.12, "Running SNP-Active Virtual Machines".

Signed-off-by: Ignacio Alvarado <ikalvarado@google.com>
Signed-off-by: Marc Orr <marcorr@google.com>
Message-Id: <20210213001452.1719001-1-marcorr@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/hardware_disable_test.c [new file with mode: 0644]