aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2017-03-30 16:04:09 +0100
committerAlex Bennée <alex.bennee@linaro.org>2017-04-10 10:14:50 +0100
commitb4e79a502ff2ac06a21c45f598870de807eb5d20 (patch)
tree6f2ec25cc36236a2531423ed948949da6fea5f65
parent8695350357abc38a4f915ba6cb62e796bbbaf111 (diff)
target/i386/misc_helper: wrap BQL around another IRQ generator
Anything that calls into HW emulation must be protected by the BQL. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--target/i386/misc_helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c
index ca2ea09f54..628f64aad5 100644
--- a/target/i386/misc_helper.c
+++ b/target/i386/misc_helper.c
@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/main-loop.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/exec-all.h"
@@ -156,7 +157,9 @@ void helper_write_crN(CPUX86State *env, int reg, target_ulong t0)
break;
case 8:
if (!(env->hflags2 & HF2_VINTR_MASK)) {
+ qemu_mutex_lock_iothread();
cpu_set_apic_tpr(x86_env_get_cpu(env)->apic_state, t0);
+ qemu_mutex_unlock_iothread();
}
env->v_tpr = t0 & 0x0f;
break;