diff options
author | Alex Bennée | 2017-03-01 14:20:02 +0100 |
---|---|---|
committer | Alex Bennée | 2017-03-09 11:41:38 +0100 |
commit | 5ee5993001cf32addb86a92e2ae8cb090fbc1462 (patch) | |
tree | 5c54fe7fef9dddfcc18ec6c56ae2e17903e2b726 /target/sparc/int64_helper.c | |
parent | cpus.c: add additional error_report when !TARGET_SUPPORT_MTTCG (diff) | |
download | qemu-5ee5993001cf32addb86a92e2ae8cb090fbc1462.tar.gz qemu-5ee5993001cf32addb86a92e2ae8cb090fbc1462.tar.xz qemu-5ee5993001cf32addb86a92e2ae8cb090fbc1462.zip |
sparc/sparc64: grab BQL before calling cpu_check_irqs
IRQ modification is part of device emulation and should be done while
the BQL is held to prevent races when MTTCG is enabled. This adds
assertions in the hw emulation layer and wraps the calls from helpers
in the BQL.
Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'target/sparc/int64_helper.c')
-rw-r--r-- | target/sparc/int64_helper.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/target/sparc/int64_helper.c b/target/sparc/int64_helper.c index 605747c93c..f942973c22 100644 --- a/target/sparc/int64_helper.c +++ b/target/sparc/int64_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/log.h" @@ -208,7 +209,9 @@ static bool do_modify_softint(CPUSPARCState *env, uint32_t value) env->softint = value; #if !defined(CONFIG_USER_ONLY) if (cpu_interrupts_enabled(env)) { + qemu_mutex_lock_iothread(); cpu_check_irqs(env); + qemu_mutex_unlock_iothread(); } #endif return true; |