Hi,
here's a patch I've worked up (against stock 2.2.11) which may be useful to
some people on the list with buggy motherboard BIOSen. Basically it allows you
to add extra entries to the MPC table, which means you can tell the kernel
about things the BIOS forgot or got wrong. For example on my system (a Tyan
1668D with the old v3.03 bios) the BIOS forgets to tell the kernel how the
interrupts on the lowest PCI slot are wired into the IO-APIC; using this patch
I can add
mpcfix=8,0x000f0003,0x10022801
to my kernel command line and have it correctly detect the IRQ line on my SCSI
card. Without this patch I basically have to use the 'noapic' option to make
use of anything generating interrupts in my bottom PCI slot.
The syntax is ugly (it has to be parsed very early in order to be useful so I
can't use the normal parsing methods, and there probably isn't a nice compact
syntax anyway) and you'll probably need to read the Intel MP spec before it
will make a lot of sense. I've added documentation to the
Documentation/IO-APIC.txt file, so read that before using.
Oh, if SMP_DEBUG is defined in smp.c it will dump quite a bit of debugging info
about the interrupt source entries in your MPC table as well which may be
useful if you currently get weirdo mappings.
There is one possible wrinkle with this patch; it changes the current behaviour
in the case where there exist multiple MPC entries for interrupt sources such
that the interrupt type, bus and bus interrupt number all coincide (this allows
overriding of incorrect entries). If your BIOS produces such multiple entries
itself (can't imagine why!) then the last such one will take effect; I _think_
an unpatched behaviour is to grab the first such entry in the MPC table.
Therefore I'd like people to test that it doesn't break anything on systems
that currently work normally. If you do think something changed, look for a
kernel message of the form
Overriding original SMP IRQ on bus x irq y (entry z)
which would indicate that the code found what appear to be two entries for the
same interrupt source. If this turns out to be a problem I could restrict the
replacement of existing entries to the user-supplied override table, but it
shouldn't be needed - after all you could just override it again on the command
line!
Currently only interrupt sources can be overridden, but any valid config block
can be added to the table. I haven't tried adding a fake processor or IO-APIC
yet, but that could be fun to see how the kernel copes :-) It wouldn't be too
hard to allow overriding of other objects if somebody actually needs it though.
If anybody plays with this, please let me know how you get on.
Cheers,
David
mpcfix.diff.gz