selftests: kvm/evmcs_test: complete I/O before migrating guest state
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Apr 2019 13:57:14 +0000 (15:57 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Apr 2019 13:37:39 +0000 (15:37 +0200)
commitc68c21ca929771a1f128d886359f9229d31cf80c
treefaf31ea837af5dfd50db04caf7c700a198f2be7a
parentb68f3cc7d978943fcf85148165b00594c38db776
selftests: kvm/evmcs_test: complete I/O before migrating guest state

Starting state migration after an IO exit without first completing IO
may result in test failures.  We already have two tests that need this
(this patch in fact fixes evmcs_test, similar to what was fixed for
state_test in commit 0f73bbc851ed, "KVM: selftests: complete IO before
migrating guest state", 2019-03-13) and a third is coming.  So, move the
code to vcpu_save_state, and while at it do not access register state
until after I/O is complete.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/evmcs_test.c
tools/testing/selftests/kvm/x86_64/state_test.c