target-i386: defer VMEXIT to do_interrupt
commit10cde894b63146139f981857e4eedf756fa53dcb
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Mar 2017 11:37:36 +0000 (7 12:37 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Thu, 9 Mar 2017 10:41:48 +0000 (9 10:41 +0000)
tree2d3de35923c5a173450da4615950354e84e1c2db
parentd394698d73836d1c50545bdb32dc58d09708fcfb
target-i386: defer VMEXIT to do_interrupt

Paths through the softmmu code during code generation now need to be audited
to check for double locking of tb_lock.  In particular, VMEXIT can take tb_lock
through cpu_vmexit -> cpu_x86_update_cr4 -> tlb_flush.

To avoid this, split VMEXIT delivery in two parts, similar to what is done with
exceptions.  cpu_vmexit only records the VMEXIT exit code and information, and
cc->do_interrupt can then deliver it when it is safe to take the lock.

Reported-by: Alexander Boettcher <alexander.boettcher@genode-labs.com>
Suggested-by: Richard Henderson <rth@twiddle.net>
Tested-by: Alexander Boettcher <alexander.boettcher@genode-labs.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
target/i386/cpu.h
target/i386/seg_helper.c
target/i386/svm_helper.c