[Skiboot] [PATCH] hw/bt: Work around QEMU lost interrupt bug

Nicholas Piggin npiggin at gmail.com
Sat Nov 16 14:06:34 AEDT 2024


QEMU has a bug where it loses the BT interrupt somewhere between BT
and XIVE when the OS boots.

For now, add a workaround QEMU quirk in the poller to try to kick
things along again.

SBE suffers the same problem but it has a poller that kicks the SBE and
gets it going again. Suspect the PSI interrupts may not be re-presented
after the OS re-initialises XIVE. This issue does not seem to appear on
real hardware.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 hw/bt.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/bt.c b/hw/bt.c
index 1912cd3a5..f813185fe 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -490,6 +490,16 @@ static void bt_poll(struct timer *t __unused, void *data __unused,
 #if BT_QUEUE_DEBUG
 	print_debug_queue_info();
 #endif
+	if (chip_quirk(QUIRK_QEMU) && !bt.irq_ok) {
+		/*
+		 * QEMU has a bug where PSI interrupts are lost when booting
+		 * the OS (perhaps when XIVE is reset, are the interrupts not
+		 * re-presented?) Clearing the irq here gets things moving.
+		 */
+		if (bt_inb(BT_INTMASK) & BT_INTMASK_B2H_IRQ)
+			bt_outb(BT_INTMASK_B2H_IRQ | BT_INTMASK_B2H_IRQEN,
+					BT_INTMASK);
+	}
 
 	bt_ctrl = bt_inb(BT_CTRL);
 
-- 
2.45.2



More information about the Skiboot mailing list