Signed-off-by Beth Kon diff --git a/hw/apic.c b/hw/apic.c index a2915f8..3e34132 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -945,6 +945,13 @@ void ioapic_set_irq(void *opaque, int vector, int level) { IOAPICState *s = opaque; + /* ISA IRQs map to GSI 1-1 except for IRQ0 which maps + to GSI 2. GSI maps to ioapic 1-1. This is not + the cleanest way of doing it but it should work. */ + + if (vector == 0) + vector = 2; + if (vector >= 0 && vector < IOAPIC_NUM_PINS) { uint32_t mask = 1 << vector; uint64_t entry = s->ioredtbl[vector];