All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
	Programmingkid <programmingkidx@gmail.com>,
	Michael Walle <michael@walle.cc>,
	qemu-stable@nongnu.org
Subject: [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register
Date: Tue,  9 Jan 2018 18:01:13 +0100	[thread overview]
Message-ID: <20180109170113.20768-1-michael@walle.cc> (raw)
In-Reply-To: <CAFEAcA-pjg34=bPe7EiYN6oYC_3xuMCyiucPwZrka2Fxxrk3DQ@mail.gmail.com>

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>
---
 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 30f670eee8..a766a1ece4 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

  reply	other threads:[~2018-01-09 17:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 15:39 [Qemu-devel] New documentation for the LatticeMicro32 target Programmingkid
2017-07-17  5:40 ` Michael Walle
2017-07-17 14:56   ` Programmingkid
2017-07-17 15:18     ` Programmingkid
2017-07-18 11:44       ` Michael Walle
2017-07-18 14:05         ` Programmingkid
2018-01-09 11:58         ` Peter Maydell
2018-01-09 17:01           ` Michael Walle [this message]
2018-02-01  9:09             ` [Qemu-devel] [PATCH] lm32: take BQL before writing IP/IM register Michael Walle
2018-05-09 19:45               ` Philippe Mathieu-Daudé
2018-05-10 13:35                 ` Paolo Bonzini
2018-05-10 13:00             ` Alex Bennée
2018-01-09 17:04           ` [Qemu-devel] New documentation for the LatticeMicro32 target Michael Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180109170113.20768-1-michael@walle.cc \
    --to=michael@walle.cc \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.