X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fmptable.c;h=3b6a4631b923180e2934922f4c6e9894426f1812;hb=f88a692d094459f0326c5c891df5ea81b5476ba6;hp=64cf96f65a053610551075c8aa71f3b532e4dcc5;hpb=9d406e84682878859284200ae00251d27c53c845;p=palacios-OLD.git diff --git a/palacios/src/devices/mptable.c b/palacios/src/devices/mptable.c index 64cf96f..3b6a463 100644 --- a/palacios/src/devices/mptable.c +++ b/palacios/src/devices/mptable.c @@ -363,7 +363,20 @@ static int write_mptable(void * target, uint32_t numcores) { ioapic->ioapic_flags.en = 1; ioapic->ioapic_address = IOAPIC_ADDR; + + // The MPTABLE IRQ mappings are kind of odd. + // We don't include a bus IRQ 2, and instead remap Bus IRQ 0 to dest irq 2 + + for (irq = 0; irq < 16; irq++) { + uint8_t dst_irq = irq; + + if (irq == 0) { + dst_irq = 2; + } else if (irq == 2) { + continue; + } + interrupt = (struct mp_table_io_interrupt_assignment *)cur; memset((void *)interrupt, 0, sizeof(struct mp_table_io_interrupt_assignment)); @@ -374,7 +387,7 @@ static int write_mptable(void * target, uint32_t numcores) { interrupt->source_bus_id = 0; interrupt->source_bus_irq = irq; interrupt->dest_ioapic_id = numcores; - interrupt->dest_ioapic_intn = irq; + interrupt->dest_ioapic_intn = dst_irq; cur += sizeof(struct mp_table_io_interrupt_assignment); }