MP Spec tables
Posted: Sun Jan 13, 2008 9:36 am
Hi everyone,
I'm trying to add SMP support to an x86_64 OS and I'm new to the SMP field. For the moment I'm able to find and parse the MPS tables. But there are some things, that confuse me. I hope someone can help me to bring some clearness.
(1) Qemu's BIOS seems to provide broken tables. It isn't reporting a PCI bus, but of course there is one with devices with interrupts. Further it reports, that we are in Virtual Wire Mode (no IMCR present), but in there are no interrupt assignments listed with an ExtInt to the IOAPIC. This must be wrong for Virtual Wire. So, how do I cope with such tables?
(2) Now on a "real" system. I get tables that make sense. There are two PCI busses listed and I can get the device numbers off the tables for the interrupts. No problem so far. But: How do I find that device on the PCI bus. Is the bus ID the BIOS provides in the MPS tables the bus number that I use for addressing on the PCI (in this single case it would work, is this assumption generally true)?
(3) I search the MP Floating Pointer Structe in the EBDA, then 639K-640K and then in the BIOS ROM. Linux seems to search it in 0K-1K in the first place and in the EBDA only if all others fail and then report that tables in EBDA are unsafe. Seems to be not compilant to the MP Spec, but okay, we're in a unperfect world. Is the Linux way of things the state of the art or is it ... well .. Linux.?
(4) Am I correct, that I have to program LocalAPICs/IOAPIC(s) to what the MPS tables tell me? My approach at the moment is:
* disable the 8259A's
* program the IOAPIC(s), all interrupts masked
* program the local APIC
* set IMCR, if I need to
* unmask the interrupts in the IOAPIC, that I can handle for now (e.g. no PCI devices...)
(5) Which vectors I have to assign to the IRQs/pins? Of course there are design aspects that should me tell (network cards need to have a high priority or so). But is there some general recommendation of what to or, more important, what not to do (except mapping all the IRQs to consecutive vector numbers).
Thank you in advance!
I'm trying to add SMP support to an x86_64 OS and I'm new to the SMP field. For the moment I'm able to find and parse the MPS tables. But there are some things, that confuse me. I hope someone can help me to bring some clearness.
(1) Qemu's BIOS seems to provide broken tables. It isn't reporting a PCI bus, but of course there is one with devices with interrupts. Further it reports, that we are in Virtual Wire Mode (no IMCR present), but in there are no interrupt assignments listed with an ExtInt to the IOAPIC. This must be wrong for Virtual Wire. So, how do I cope with such tables?
(2) Now on a "real" system. I get tables that make sense. There are two PCI busses listed and I can get the device numbers off the tables for the interrupts. No problem so far. But: How do I find that device on the PCI bus. Is the bus ID the BIOS provides in the MPS tables the bus number that I use for addressing on the PCI (in this single case it would work, is this assumption generally true)?
(3) I search the MP Floating Pointer Structe in the EBDA, then 639K-640K and then in the BIOS ROM. Linux seems to search it in 0K-1K in the first place and in the EBDA only if all others fail and then report that tables in EBDA are unsafe. Seems to be not compilant to the MP Spec, but okay, we're in a unperfect world. Is the Linux way of things the state of the art or is it ... well .. Linux.?
(4) Am I correct, that I have to program LocalAPICs/IOAPIC(s) to what the MPS tables tell me? My approach at the moment is:
* disable the 8259A's
* program the IOAPIC(s), all interrupts masked
* program the local APIC
* set IMCR, if I need to
* unmask the interrupts in the IOAPIC, that I can handle for now (e.g. no PCI devices...)
(5) Which vectors I have to assign to the IRQs/pins? Of course there are design aspects that should me tell (network cards need to have a high priority or so). But is there some general recommendation of what to or, more important, what not to do (except mapping all the IRQs to consecutive vector numbers).
Thank you in advance!