KVM: selftests: Add a test for KVM_CAP_EXIT_ON_EMULATION_FAILURE
authorDavid Matlack <dmatlack@google.com>
Wed, 2 Nov 2022 18:46:54 +0000 (11:46 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 17 Nov 2022 00:59:02 +0000 (16:59 -0800)
commit3ae5b759c3c033b4ca2b7ef19836622902151517
tree9637f8852aeb391bf538804697e03f487d8103d8
parenta323845d6c3d2f667274bde8145906580359fe06
KVM: selftests: Add a test for KVM_CAP_EXIT_ON_EMULATION_FAILURE

Add a selftest to exercise the KVM_CAP_EXIT_ON_EMULATION_FAILURE
capability.

This capability is also exercised through
smaller_maxphyaddr_emulation_test, but that test requires
allow_smaller_maxphyaddr=Y, which is off by default on Intel when ept=Y
and unconditionally disabled on AMD when npt=Y. This new test ensures
that KVM_CAP_EXIT_ON_EMULATION_FAILURE is exercised independent of
allow_smaller_maxphyaddr.

Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20221102184654.282799-11-dmatlack@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c [new file with mode: 0644]