From: Peter Maydell <peter.maydell@linaro.org>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc: qemu-devel@nongnu.org, Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] Disable interrupts on Cortex M3 (lm3s6965evb)
Date: Sun, 5 Jun 2011 14:44:19 +0100 [thread overview]
Message-ID: <BANLkTinsuj1WgejwuZgz9Q6YhTrN1STWnA@mail.gmail.com> (raw)
In-Reply-To: <4DEB7F55.9030700@embedded-brains.de>
On 5 June 2011 14:06, Sebastian Huber
<sebastian.huber@embedded-brains.de> wrote:
> I think the interrupt handling logic for ARMv7M is wrong in cpu-exec.c
> line 470. Please have a look at the attached patch.
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -470,8 +470,8 @@ int cpu_exec(CPUState *env1)
We avoid this by disabling interrupts when
pc contains a magic address. */
if (interrupt_request & CPU_INTERRUPT_HARD
- && ((IS_M(env) && env->regs[15] < 0xfffffff0)
- || !(env->uncached_cpsr & CPSR_I))) {
+ && !(env->uncached_cpsr & CPSR_I)
+ && (IS_M(env) && env->regs[15] < 0xfffffff0)) {
env->exception_index = EXCP_IRQ;
do_interrupt(env);
next_tb = 0;
This doesn't look right -- it changes the behaviour in the
case where we aren't an M profile CPU.
In any case, M profile exception priority handling is sufficiently
complicated that any change which only looks at PRIMASK (which is
effectively what the change to look at CPSR_I here is doing) is
almost certainly wrong. I think that whatever is raising the
interrupt should be looking at the CPU priority and not raising it
in the first place.
(It looks suspiciously as if most of the v7M priority handling
is simply missing from QEMU, ie you have bigger problems than
can be fixed by a small patch like this...)
-- PMM
next prev parent reply other threads:[~2011-06-05 13:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 10:31 [Qemu-devel] Disable interrupts on Cortex M3 (lm3s6965evb) Sebastian Huber
2011-06-05 13:06 ` Sebastian Huber
2011-06-05 13:44 ` Peter Maydell [this message]
2011-06-05 14:17 ` Sebastian Huber
2011-06-05 14:57 ` Peter Maydell
2011-06-05 16:32 ` Sebastian Huber
2011-06-05 19:23 ` Peter Maydell
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=BANLkTinsuj1WgejwuZgz9Q6YhTrN1STWnA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=sebastian.huber@embedded-brains.de \
/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 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).