KVM: selftests: evmcs_test: Check that VMCS12 is alway properly synced to eVMCS after...
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 5 May 2021 15:18:22 +0000 (17:18 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 May 2021 10:06:12 +0000 (06:06 -0400)
commitc9ecafaf0113a305f5085ceb9c7a4b64ca70eae9
tree26410b087af837d837e69bfee73d97d7d90babc0
parent32d1b3ab588c1231dbfa9eb08819c50529ce77d7
KVM: selftests: evmcs_test: Check that VMCS12 is alway properly synced to eVMCS after restore

Add a test for the regression, introduced by commit f2c7ef3ba955
("KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES on nested vmexit"). When
L2->L1 exit is forced immediately after restoring nested state,
KVM_REQ_GET_NESTED_STATE_PAGES request is cleared and VMCS12 changes
(e.g. fresh RIP) are not reflected to eVMCS. The consequent nested
vCPU run gets broken.

Utilize NMI injection to do the job.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210505151823.1341678-3-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/x86_64/evmcs_test.c