I had my IOAPIC & APIC code working on a single core platform right now i'm trying to extend that to a multicore platform.
Information that i parsed from the MADT tabels is shown below, i am 95% sure this is correct.
Code: Select all
4294767296 PID:0 TID:2 Global System Interrupt 1 (Pin 1) --> (IOAPIC 0x0004)IRQ 1, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 2 (Pin 2) --> (IOAPIC 0x0004)IRQ 0, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 3 (Pin 3) --> (IOAPIC 0x0004)IRQ 3, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 4 (Pin 4) --> (IOAPIC 0x0004)IRQ 4, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 5 (Pin 5) --> (IOAPIC 0x0004)IRQ 5, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 6 (Pin 6) --> (IOAPIC 0x0004)IRQ 6, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 7 (Pin 7) --> (IOAPIC 0x0004)IRQ 7, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 8 (Pin 8) --> (IOAPIC 0x0004)IRQ 8, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 9 (Pin 9) --> (IOAPIC 0x0004)IRQ 9, Level Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 10 (Pin 10) --> (IOAPIC 0x0004)IRQ 10, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 11 (Pin 11) --> (IOAPIC 0x0004)IRQ 11, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 12 (Pin 12) --> (IOAPIC 0x0004)IRQ 12, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 13 (Pin 13) --> (IOAPIC 0x0004)IRQ 13, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 14 (Pin 14) --> (IOAPIC 0x0004)IRQ 14, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 15 (Pin 15) --> (IOAPIC 0x0004)IRQ 15, Edge Triggerd, Active high
4294767296 PID:0 TID:2 Global System Interrupt 16 (Pin 16) --> (IOAPIC 0x0004)IRQ 16, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 17 (Pin 17) --> (IOAPIC 0x0004)IRQ 17, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 18 (Pin 18) --> (IOAPIC 0x0004)IRQ 18, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 19 (Pin 19) --> (IOAPIC 0x0004)IRQ 19, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 20 (Pin 20) --> (IOAPIC 0x0004)IRQ 20, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 21 (Pin 21) --> (IOAPIC 0x0004)IRQ 21, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 22 (Pin 22) --> (IOAPIC 0x0004)IRQ 22, Level Triggerd, Active low
4294767296 PID:0 TID:2 Global System Interrupt 23 (Pin 23) --> (IOAPIC 0x0004)IRQ 23, Level Triggerd, Active low
Code: Select all
4294767296 PID:0 TID:2 -------------------Printing Processor Local APIC description table @ adress a004742c --------------------------
4294767296 PID:0 TID:2 ACPI Processor ID : 0x1
4294767296 PID:0 TID:2 APIC ID : 0x0
4294767296 PID:0 TID:2 Flags: 0x1
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing Processor Local APIC description table @ adress a0047434 --------------------------
4294767296 PID:0 TID:2 ACPI Processor ID : 0x2
4294767296 PID:0 TID:2 APIC ID : 0x1
4294767296 PID:0 TID:2 Flags: 0x1
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing Processor Local APIC description table @ adress a004743c --------------------------
4294767296 PID:0 TID:2 ACPI Processor ID : 0x3
4294767296 PID:0 TID:2 APIC ID : 0x2
4294767296 PID:0 TID:2 Flags: 0x1
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing Processor Local APIC description table @ adress a0047444 --------------------------
4294767296 PID:0 TID:2 ACPI Processor ID : 0x4
4294767296 PID:0 TID:2 APIC ID : 0x3
4294767296 PID:0 TID:2 Flags: 0x1
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing IO APIC description table @ adress a004744c --------------------------
4294767296 PID:0 TID:2 IO APIC ID : 0x4
4294767296 PID:0 TID:2 IO APIC address : 0xFEC00000
4294767296 PID:0 TID:2 Global System Interrupt Base: 0x0
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing Interrupt Source Override description table @ adress a0047458 --------------------------
4294767296 PID:0 TID:2 Bus : 0x0
4294767296 PID:0 TID:2 Source : 0x0
4294767296 PID:0 TID:2 Global System Interrupt: 0x2
4294767296 PID:0 TID:2 Flags: 0x0
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing Interrupt Source Override description table @ adress a0047462 --------------------------
4294767296 PID:0 TID:2 Bus : 0x0
4294767296 PID:0 TID:2 Source : 0x9
4294767296 PID:0 TID:2 Global System Interrupt: 0x9
4294767296 PID:0 TID:2 Flags: 0xD
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
4294767296 PID:0 TID:2 -------------------Printing Local APIC NMI description table @ adress a004746c --------------------------
4294767296 PID:0 TID:2 ACPI Processor ID : 0xFF
4294767296 PID:0 TID:2 Flags : 0x5
4294767296 PID:0 TID:2 Local Apic LINT# : 0x1
4294767296 PID:0 TID:2 ------------------------------------------------------------------------------------------
Code: Select all
MSR @ 0x1B : 0x00000000_FEE00900
Code: Select all
4294767296 PID:0 TID:2 ApicId : 0x00000000
4294767296 PID:0 TID:2 ApicVersion : 0x00050014
4294767296 PID:0 TID:2 TaskPrioReg : 0x00000000
4294767296 PID:0 TID:2 ArbPrioReg : 0x00000000
4294767296 PID:0 TID:2 ProcPrioReg : 0x00000000
4294767296 PID:0 TID:2 LocDestReg : 0x00000000
4294767296 PID:0 TID:2 DestFmtReg : 0xFFFFFFFF
4294767296 PID:0 TID:2 SpurIntVecReg : 0x000001FF
4294767296 PID:0 TID:2 ErrStatReg : 0x00000000
4294767296 PID:0 TID:2 IcrHigh : 0x00000000
4294767296 PID:0 TID:2 IcrLow : 0x00000200
4294767296 PID:0 TID:2 LvtTimer : 0x00010000
4294767296 PID:0 TID:2 LvtThermal : 0x00010000
4294767296 PID:0 TID:2 LvtPerfCounter : 0x00010000
4294767296 PID:0 TID:2 LvtLint0 : 0x00000700
4294767296 PID:0 TID:2 LvtLint1 : 0x00000400
4294767296 PID:0 TID:2 LvtError : 0x00010000
4294767296 PID:0 TID:2 TimerInitCount : 0x00000000
4294767296 PID:0 TID:2 TimerCurrCount : 0x00000000
4294767296 PID:0 TID:2 DivConfig : 0x00000000
To get my interrupts working, first i tried to set delivery mode to fixed and destination mode to physical and send each interrupt to the first CPU APICID = 0x00 (bits 59-56)
I tought that this would send all interrupts to the bsp cpu. But for some reason, the same code that worked on a different platform now even fails to get into my interrupt handler.
So i assume that the messages never arrived in the lapic.
Next i tried to set interrupt to fixed delivery mode and logical destination mode. Here i ran into some trouble:
My specification states that the APIC can be found at address : 0xFEE00000. My first question, What about the other 3 lapics ? (my system has 2 cores with hyper threading enabled.)
The docs also state the you can relocate each memory mapped block, but how do i do this for the other cpu's ? I have only one "MSR" to change ...... (I assume i have to switch to a different processor if i want to change their MSR ????? )
Right back to logical mode. To get this working i know i need to set DestinationFormatRegister to 0xF000FFFF and the logicalDestinationRegister to what ever i want as a logical ID
Now here is the issue, whatever i do i can't write to those registers and i do not understand why . (I did check that i wouldn't write into a read-only part of that register ---> bit-wise operators)
Code: Select all
g_pApic->LocDestReg |= MYPOW(31); //set bit 31 = 1
g_pApic->DestFmtReg &= 0xF0000000;
Anyone with an idea ?