qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marius Groeger <mgroeger@sysgo.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] IRQ acknowledge on MIPS
Date: Tue, 23 Jan 2007 10:06:07 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0701230959190.7138@mag-lap> (raw)
In-Reply-To: <20070123004819.GA10927@amd64.aurel32.net>

On Tue, 23 Jan 2007, Aurelien Jarno wrote:

> There is currently a bug concerning the IRQ acknowlege on the MIPS
> system emulation. It concerns both the QEMU and Malta boards, though it
> is only detectable with a 2.4 kernel and thus on the Malta board. The
> symptom is a storm of "We got a spurious interrupt from PIIX4."
> 
> This is due to the kernel requesting the interrupt number from the 
> i8259A where no interrupt is waiting. In such a case the i8259A answers
> by an IRQ 7.
> 
> When an hardware interrupt occurs, the i8259A memorizes the interrupt
> and sends it to the MIPS CPU. This is done via the pic_irq_request()
> function. The result is that the bit 10 of the CP0 Cause register is 
> set to one (interrupt 2). But when the interrupt is finished, the i8259a
> registers IRR and ISR are cleared, but not the CP0 Cause register. The
> CPU always thinks there is an interrupt to serve, which is wrong.

I can confirm this issue. For our (custom) OS I worked around this by 
manualy clearing CP0 Cause (even though I think I shouldn't be allowed 
to do that since CP0:IP[7-2] are read-only, but that's another 
story... ;-)

> Does anyone has an idea of a sane implementation for that? It seems
> only the MIPS platform has to clear a register of the CPU when an
> interrupt is finished.

What about passing another hook to pic_init which, if set, would be 
called when no more interrupts are pending? Would that be too specific 
this problem to be an acceptable solution?

Regards,
Marius

-- 
Marius Groeger <mgroeger@sysgo.com>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10
www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com

      parent reply	other threads:[~2007-01-23  9:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23  0:48 [Qemu-devel] [RFC] IRQ acknowledge on MIPS Aurelien Jarno
2007-01-23  9:01 ` Aurelien Jarno
2007-01-23 15:27   ` Alexander Voropay
2007-01-23 15:40     ` Paul Brook
2007-01-23 20:22       ` Fabrice Bellard
2007-01-23 16:36     ` Aurelien Jarno
2007-01-23  9:06 ` Marius Groeger [this message]

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=Pine.LNX.4.64.0701230959190.7138@mag-lap \
    --to=mgroeger@sysgo.com \
    --cc=qemu-devel@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 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).