qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] BQL patches for the lm32 target
@ 2018-05-21 11:52 Michael Walle
  2018-05-21 11:52 ` [Qemu-devel] [PATCH 1/2] lm32: take BQL before writing IP/IM register Michael Walle
  2018-05-21 11:52 ` [Qemu-devel] [PATCH 2/2] target/lm32: hold BQL in gdbstub Michael Walle
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Walle @ 2018-05-21 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Paolo Bonzini, Michael Walle

I'll send a pull request next week if there are no comments on the
patches.

Michael Walle (2):
  lm32: take BQL before writing IP/IM register
  target/lm32: hold BQL in gdbstub

 target/lm32/gdbstub.c   | 4 ++++
 target/lm32/op_helper.c | 4 ++++
 2 files changed, 8 insertions(+)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] lm32: take BQL before writing IP/IM register
  2018-05-21 11:52 [Qemu-devel] [PATCH 0/2] BQL patches for the lm32 target Michael Walle
@ 2018-05-21 11:52 ` Michael Walle
  2018-05-21 11:52 ` [Qemu-devel] [PATCH 2/2] target/lm32: hold BQL in gdbstub Michael Walle
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Walle @ 2018-05-21 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Paolo Bonzini, Michael Walle, qemu-stable

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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c
index 577f8306e3..234d55e056 100644
--- a/target/lm32/op_helper.c
+++ b/target/lm32/op_helper.c
@@ -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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] target/lm32: hold BQL in gdbstub
  2018-05-21 11:52 [Qemu-devel] [PATCH 0/2] BQL patches for the lm32 target Michael Walle
  2018-05-21 11:52 ` [Qemu-devel] [PATCH 1/2] lm32: take BQL before writing IP/IM register Michael Walle
@ 2018-05-21 11:52 ` Michael Walle
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Walle @ 2018-05-21 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Paolo Bonzini, Michael Walle, qemu-stable

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

Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Walle <michael@walle.cc>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-21 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-21 11:52 [Qemu-devel] [PATCH 0/2] BQL patches for the lm32 target Michael Walle
2018-05-21 11:52 ` [Qemu-devel] [PATCH 1/2] lm32: take BQL before writing IP/IM register Michael Walle
2018-05-21 11:52 ` [Qemu-devel] [PATCH 2/2] target/lm32: hold BQL in gdbstub Michael Walle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).