Fix non-ACPI Timer Interrupt Routing - v2
PATCH 1/1 Fix non-ACPI Timer Interrupt Routing - v2
Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
v1 -> v2 adds comment suggested by Ryan.
bios/BIOS-bochs-latest binary +0 -0
bios/rombios32.c +10 -0
@@ -1168,6 +1168,12 @@ static void mptable_init(void)/* irqs */ for (i =0 ; i <16 ; i++) { +#ifdef BX_QEMU +/* One entry per ioapic input. Input 2 is covered by +irq0->inti2 override (i == 0). irq 2 is unused */ +if (i ==2 ) +continue ; +#endif putb (&q,3 );/* entry type = I/O interrupt */ putb (&q,0 );/* interrupt type = vectored interrupt */ putb (&q,0 );/* flags: po=0, el=0 */
@@ -1175,7 +1181,11 @@ static void mptable_init(void)putb (&q,0 );/* source bus ID = ISA */ putb (&q, i);/* source bus IRQ */ putb (&q, ioapic_id);/* dest I/O APIC ID */ +#ifdef BX_QEMU +putb (&q, i ==0 ?2 : i);/* dest I/O APIC interrupt in */ +#else putb (&q, i);/* dest I/O APIC interrupt in */ +#endif }/* patch length */ len = q - mp_config_table;
Anthony Liguori
AppliedQuoted 5 lines · Beth Kon
Replicate ACPI
irq0->inti2override in mp table for non-acpi case.v1 -> v2 adds comment suggested by Ryan.
Signed-off-by Beth Kon <[email protected]>
Applied to trunk and stable. Thanks
Signature · 3 lines
Regards, Anthony Liguori
Quoted 14 lines · Beth Kon
Replicate ACPI
irq0->inti2override in mp table for non-acpi case.v1 -> v2 adds comment suggested by Ryan.
Signed-off-by Beth Kon <[email protected]>bios/BIOS-bochs-latest binary +0
-0bios/rombios32.c +0
-0
bios/rombios32.c static void mptable_init(void) · line 1173
Quoted 6 lines
bios/rombios32.c +3
-0@@ -1168,6 +1168,12 @@ static void mptable_init(void)/* irqs */ for (i =0 ; i <16 ; i++) { +#ifdef BX_QEMU +/* One entry per ioapic input. Input 2 is covered by +irq0->inti2 override (i == 0). irq 2 is unused */
Isn't the input 0 or destination 2 covered by the override? We connect irq0 (input) to intin2 (destination).
bios/rombios32.c static void mptable_init(void) · line 1175
Quoted 2 lines
bios/rombios32.c +2
-0+if (i ==2 ) +continue ;
This changes the entry count. Currently it's
putle16(&q, smp_cpus + 18); /* entry count */
which is smp_cpus processor entries + (bus entry + i/o apic entry + 16 irq entries). This changes the number of irq entries to 15.
Quoted 6 lines
bios/rombios32.c +1
-0+#endif putb (&q,3 );/* entry type = I/O interrupt */ putb (&q,0 );/* interrupt type = vectored interrupt */ putb (&q,0 );/* flags: po=0, el=0 */ @@ -1175,7 +1181,11 @@ static void mptable_init(void)putb (&q,0 );/* source bus ID = ISA */
bios/rombios32.c static void mptable_init(void) · line 1191
Quoted 10 lines
bios/rombios32.c +4
-0putb (&q, i);/* source bus IRQ */ putb (&q, ioapic_id);/* dest I/O APIC ID */ +#ifdef BX_QEMU +putb (&q, i ==0 ?2 : i);/* dest I/O APIC interrupt in */ +#else putb (&q, i);/* dest I/O APIC interrupt in */ +#endif }/* patch length */ len = q - mp_config_table;
- Sebastian
Quoted 16 lines · Sebastian Herbszt
Quoted 15 lines · Beth Kon
Replicate ACPI
irq0->inti2override in mp table for non-acpi case.v1 -> v2 adds comment suggested by Ryan.
Signed-off-by Beth Kon <[email protected]>bios/BIOS-bochs-latest binary +0
-0bios/rombios32.c +0
-0@@ -1168,6 +1168,12 @@ static void mptable_init(void)
Quoted 8 lines
bios/rombios32.c static void mptable_init(void) · line 1173
Quoted 5 lines
bios/rombios32.c +3
-0/* irqs */ for (i =0 ; i <16 ; i++) { +#ifdef BX_QEMU +/* One entry per ioapic input. Input 2 is covered by +irq0->inti2 override (i == 0). irq 2 is unused */ Isn't the input 0 or destination 2 covered by the override? We connect irq0 (input) to intin2 (destination).
In the comment I was using the terminology in the MP Specification, section 4.3.4. "Destination" 2 is the input to IOAPIC pin 2. If you find it very confusing I can clarify.
Quoted 10 lines
bios/rombios32.c static void mptable_init(void) · line 1175
Quoted 3 lines
bios/rombios32.c +2
-0+if (i ==2 ) +continue ;This changes the entry count. Currently it's
putle16(&q, smp_cpus + 18); /* entry count */which is
smp_cpusprocessor entries + (bus entry + i/o apic entry + 16 irq entries). This changes the number of irq entries to 15.
Yes, this was an oversight. Thanks!
Quoted 19 lines
Quoted 4 lines
bios/rombios32.c +1
-0+#endif putb (&q,3 );/* entry type = I/O interrupt */ putb (&q,0 );/* interrupt type = vectored interrupt */ putb (&q,0 );/* flags: po=0, el=0 */ bios/rombios32.c static void mptable_init(void) · line 1190
Quoted 10 lines
bios/rombios32.c +4
-0@@ -1175,7 +1181,11 @@ static void mptable_init(void)putb (&q,0 );/* source bus ID = ISA */ putb (&q, i);/* source bus IRQ */ putb (&q, ioapic_id);/* dest I/O APIC ID */ +#ifdef BX_QEMU +putb (&q, i ==0 ?2 : i);/* dest I/O APIC interrupt in */ +#else putb (&q, i);/* dest I/O APIC interrupt in */ +#endif }/* patch length */ len = q - mp_config_table;- Sebastian