selftests: kvm: add a selftest for SMM
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 10 Apr 2019 09:38:33 +0000 (11:38 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Apr 2019 13:38:06 +0000 (15:38 +0200)
commit79904c9de0d1a6cd66853b3af802343b0ba3720c
tree6c38d3847f09fc9b1f7d5d93f07fcd5259fb0f3a
parentc2390f16fc5b847a22f442a190d459beba07e86f
selftests: kvm: add a selftest for SMM

Add a simple test for SMM, based on VMX.  The test implements its own
sync between the guest and the host as using our ucall library seems to
be too cumbersome: SMI handler is happening in real-address mode.

This patch also fixes KVM_SET_NESTED_STATE to happen after
KVM_SET_VCPU_EVENTS, in fact it places it last.  This is because
KVM needs to know whether the processor is in SMM or not.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/smm_test.c [new file with mode: 0644]