target/i386: svm: do not discard high 32 bits of EXITINFO1

env->error_code is only 32-bits wide, so the high 32 bits of EXITINFO1
are being lost.  However, even though saving guest state and restoring
host state must be delayed to do_vmexit, because they might take tb_lock,
it is always possible to write to the VMCB.  So do this for the exit
code and EXITINFO1, just like it is already being done for EXITINFO2.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2021-03-18 10:02:06 -04:00
parent da3f3b020f
commit 687758565a
3 changed files with 10 additions and 11 deletions

View file

@ -1305,9 +1305,9 @@ void x86_cpu_do_interrupt(CPUState *cs)
/* successfully delivered */
env->old_exception = -1;
#else
if (cs->exception_index >= EXCP_VMEXIT) {
if (cs->exception_index == EXCP_VMEXIT) {
assert(env->old_exception == -1);
do_vmexit(env, cs->exception_index - EXCP_VMEXIT, env->error_code);
do_vmexit(env);
} else {
do_interrupt_all(cpu, cs->exception_index,
env->exception_is_int,