selftests: KVM: Test KVM_X86_QUIRK_FIX_HYPERCALL_INSN
authorOliver Upton <oupton@google.com>
Wed, 16 Mar 2022 00:55:38 +0000 (00:55 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Apr 2022 09:41:10 +0000 (05:41 -0400)
commit6c2fa8b20d0cad3719b024ba0f25a50199a90c9a
tree56244d92d841351eb8959de384e5772151116fe1
parentf1a9761fbb00639c5e73835f7f373ef834bb867f
selftests: KVM: Test KVM_X86_QUIRK_FIX_HYPERCALL_INSN

Add a test that asserts KVM rewrites guest hypercall instructions to
match the running architecture (VMCALL on VMX, VMMCALL on SVM).
Additionally, test that with the quirk disabled, KVM no longer rewrites
guest instructions and instead injects a #UD.

Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20220316005538.2282772-3-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c [new file with mode: 0644]