On 13/10/2026 17:18, Peter Maydell wrote:
On Wed, 16 Sept 2026 at 11:49, Mark Cave-Ayland
<[email protected]> wrote:
Currently the cascaded output from the secondary i8259 is returned directly in
the pass_irqs[] array, instead of being connected to the relevant input of the
primary i8259.
Signed-off-by: Mark Cave-Ayland <[email protected]>
---
hw/intc/i8259.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index fcc94e12f8..964ceb04b2 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -501,7 +501,8 @@ static void i8259_pic_realize(DeviceState *dev, Error
**errp)
}
/* Wire up secondary cascade */
- qdev_connect_gpio_out(sec_dev, 0, s->pass_irqs[2]);
+ qdev_connect_gpio_out(sec_dev, 0,
+ qdev_get_gpio_in(pri_dev, 2));
We just added this line in the previous patch, so we might as well
squash this change into the previous one I think.
The reason for having this in a separate commit is because it is
technically a behaviour change. Before this commit, an interrupt from
the secondary PIC would *always* raise the passed interrupt, whereas on
real hardware it is possible to disable interrupts from the secondary
PIC by masking the relevant input on the primary PIC [1].
Since real hardware works this way then I would argue that this is
fixing an existing bug, but I thought it was worth having as a separate
commit just to be sure.
ATB,
Mark.
[1] https://wiki.osdev.org/8259_PIC#Masking