From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Helge Deller <deller@gmx.de>,
Keith Monahan <keith@techtravels.org>
Subject: [PATCH 3/4] hw/misc/lasi: derive IRR from pending and unmasked requests
Date: Fri, 3 Jul 2026 21:32:23 +0200 [thread overview]
Message-ID: <20260703193224.33135-4-deller@kernel.org> (raw)
In-Reply-To: <20260703193224.33135-1-deller@kernel.org>
From: Keith Monahan <keith@techtravels.org>
The LASI interrupt request register (IRR) was latched: set when a source
asserted and then never cleared or re-evaluated against the mask, so a
masked or dropped request stayed set forever. The parisc core I/O
dispatcher reads IRR to find its interrupt source, so the stuck bit was
returned on every later interrupt as an "unexpected core I/O interrupt".
On an installed HP-UX system an unacknowledged i82596 LAN interrupt
latched this way and the flood wedged the boot.
Derive IRR as (pending & unmasked) with IPR tracking each source's level,
matching the hardware and the in-tree parisc gsc/lasi driver.
Signed-off-by: Keith Monahan <keith@techtravels.org>
Signed-off-by: Helge Deller <deller@gmx.de>
---
hw/misc/lasi.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/hw/misc/lasi.c b/hw/misc/lasi.c
index e8e1578b75..f0dfd78b4d 100644
--- a/hw/misc/lasi.c
+++ b/hw/misc/lasi.c
@@ -62,7 +62,15 @@ static MemTxResult lasi_chip_read_with_attrs(void *opaque, hwaddr addr,
switch (addr) {
case LASI_IRR:
- val = s->irr;
+ /*
+ * The interrupt request register reports the interrupts that are both
+ * pending and unmasked, derived live from IPR and IMR rather than
+ * latched, so masking or deasserting a source removes it immediately.
+ * The parisc core I/O interrupt dispatcher reads IRR; a latched bit
+ * that never cleared would be redelivered forever as a phantom
+ * "unexpected" interrupt.
+ */
+ val = s->ipr & s->imr;
break;
case LASI_IMR:
val = s->imr;
@@ -234,13 +242,18 @@ static void lasi_set_irq(void *opaque, int irq, int level)
if (level) {
s->ipr |= bit;
- if (bit & s->imr) {
+ if ((bit & s->imr) && (s->icr & ICR_BUS_ERROR_BIT) == 0) {
uint32_t iar = s->iar;
- s->irr |= bit;
- if ((s->icr & ICR_BUS_ERROR_BIT) == 0) {
- stl_be_phys(&address_space_memory, iar & -32, iar & 31);
- }
+ stl_be_phys(&address_space_memory, iar & -32, iar & 31);
}
+ } else {
+ /*
+ * The interrupt sources are level triggered, so a source that drops
+ * its request must clear its pending bit. Otherwise the bit stays set
+ * in IPR (and hence IRR) and is redelivered as a phantom "unexpected"
+ * core I/O interrupt on every later interrupt.
+ */
+ s->ipr &= ~bit;
}
}
--
2.54.0
prev parent reply other threads:[~2026-07-03 19:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 19:32 [PATCH 0/4] Updates for hppa architecture Helge Deller
2026-07-03 19:32 ` [PATCH 1/4] target/hppa: Work-around for Fast TLB insert instruction on HP-UX 9 Helge Deller
2026-07-04 20:17 ` Richard Henderson
2026-07-05 21:58 ` Philippe Mathieu-Daudé
2026-07-03 19:32 ` [PATCH 2/4] target/hppa: Delay MMU update until TLB protection bits were set Helge Deller
2026-07-03 19:32 ` Helge Deller [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=20260703193224.33135-4-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=keith@techtravels.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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.