Fix IO-APIC/IRQ-Routing Bug (affects GSIs 24, 48, 72, ...)

Christian Ehrhardt Christian_Ehrhardt at genua.de
Fri Jul 8 20:10:34 CEST 2011


Hi,

there seems to by an off-by-one error in Io_apic::find_apic() that
kills IRQ-routing for GSIs that are a multiple of 24. Please consider
the patch below (tested on real hardware with 3 IO-APICS).

     regards    Christian


diff --git a/src/kernel/fiasco/src/kern/io_apic.cpp b/src/kernel/fiasco/src/kern/io_apic.cpp
index 88ffe68..897a1a0 100644
--- a/src/kernel/fiasco/src/kern/io_apic.cpp
+++ b/src/kernel/fiasco/src/kern/io_apic.cpp
@@ -331,7 +331,7 @@ Io_apic::find_apic(unsigned irqnum)
 {
   for (unsigned i = Max_ioapics; i > 0; --i)
     {
-      if (_apics[i-1]._apic && _apics[i-1]._offset < irqnum)
+      if (_apics[i-1]._apic && _apics[i-1]._offset <= irqnum)
 	return i - 1;
     }
   return 0;






More information about the l4-hackers mailing list