qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] [PATCH 2/2] target/lm32: hold BQL in gdbstub


From: Michael Walle
Subject: [Qemu-stable] [PATCH 2/2] target/lm32: hold BQL in gdbstub
Date: Mon, 21 May 2018 13:52:52 +0200

Changing the IP/IM registers may cause interrupts, so hold the BQL.

Cc: address@hidden
Signed-off-by: Michael Walle <address@hidden>
---
 target/lm32/gdbstub.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/lm32/gdbstub.c b/target/lm32/gdbstub.c
index cf929dd392..2cdeef8f5e 100644
--- a/target/lm32/gdbstub.c
+++ b/target/lm32/gdbstub.c
@@ -82,10 +82,14 @@ int lm32_cpu_gdb_write_register(CPUState *cs, uint8_t 
*mem_buf, int n)
             env->ie = tmp;
             break;
         case 37:
+            qemu_mutex_lock_iothread();
             lm32_pic_set_im(env->pic_state, tmp);
+            qemu_mutex_unlock_iothread();
             break;
         case 38:
+            qemu_mutex_lock_iothread();
             lm32_pic_set_ip(env->pic_state, tmp);
+            qemu_mutex_unlock_iothread();
             break;
         }
     }
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]