Re: spinlock recursion when running q800 emulation in qemu

Finn Thain
2024-03-06T23:12:33Z

On Wed, 6 Mar 2024, Brad Boyer wrote:

> It looks like the Q800 supports switching VIA1 to IRQ6 through the
> alternate IRQ mapping.

Yes, and that's what happens in QEMU. That was easily confirmed with the
patch below. As a result, you get less clocksource drift during I/O but
you also get a lot of interrupt nesting.

# cat /proc/interrupts
CPU0
3: 2 auto sonic
4: 45 auto ttyS0
7: 0 auto NMI
10: 2089 mac ADB
14: 988 mac timer
19: 792 mac ESP
56: 0 mac sonic
ERR: 0

diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 01e6b0e37f8d..aa3bdbaf2ff4 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -386,6 +386,9 @@ void via1_irq(struct irq_desc *desc)
int irq_num;
unsigned char irq_bit, events;

+ if (irq_desc_get_irq(desc) == 6)
+ printk_once(KERN_INFO "%s: using remapped irq\n", __func__);
+
events = via1[vIFR] & via1[vIER] & 0x7F;
if (!events)
return;