]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
lm32: take BQL before writing IP/IM register
authorMichael Walle <michael@walle.cc>
Tue, 9 Jan 2018 17:01:13 +0000 (18:01 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 11 Jul 2018 16:48:17 +0000 (11:48 -0500)
Writing to these registers may raise an interrupt request. Actually,
this prevents the milkymist board from starting.

Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Walle <michael@walle.cc>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
(cherry picked from commit 81e9cbd0ca1131012b058df6804b1f626a6b730c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target/lm32/op_helper.c

index 577f8306e33fe4f53fe0016e2a0b2e7c6e093720..234d55e056a779ac4736999948e96dad3c2a0c36 100644 (file)
@@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc)
 
 void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_im(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
 {
+    qemu_mutex_lock_iothread();
     lm32_pic_set_ip(env->pic_state, im);
+    qemu_mutex_unlock_iothread();
 }
 
 void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)