]> git.proxmox.com Git - mirror_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 Walle <michael@walle.cc>
Mon, 21 May 2018 11:37:12 +0000 (13:37 +0200)
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>
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)