APIC logical destination mode mixing

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
TudorOS1
Posts: 8
Joined: Mon Sep 19, 2011 9:24 pm

APIC logical destination mode mixing

Post by TudorOS1 »

First I like to say Happy New Years to anyone looking here.

So, Im making a new project type for visual c++ called "Kernel". It has a kernel stub, a header for a HAL.dll(not related to the hal.dll in windows) and a header for #defines. Its part of the KDK(Kernel Development Kit).

In the HAL there is a function called RedirectInterrupt and Im wondering about Logical Destination Mode. Can I have some local APICs with Logical Flat Mode and some with Logical cluster mode.

PS: Here is something jst for fun :P
The below sentence is true.
The above sentence is false.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: APIC logical destination mode mixing

Post by Brendan »

Hi,
TudorOS1 wrote:Can I have some local APICs with Logical Flat Mode and some with Logical cluster mode.
No.

More specifically, the Destination Format Register in each CPU's local APIC must be configured correctly to match the chipset. If one or more of them (including all of them) are configured incorrectly you get undefined behaviour.

For almost all 80x86 machines the chipset expects "Logical Flat Mode". There were a few (very rare) NUMA machines that used "Logical Cluster Mode" (and had the required "APIC routing" circuitry needed for "Logical Cluster Mode"), but they aren't really worth caring about (partly because they're rare, and partly because they're huge servers purchased for a specific task that doesn't include alternative OSs).

Also note that for newer machines (Nehalem and later) that support x2APIC; when operating in x2APIC mode there is no Destination Format Register and you're forced to use "Logical Cluster Mode".



Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
TudorOS1
Posts: 8
Joined: Mon Sep 19, 2011 9:24 pm

Re: APIC logical destination mode mixing

Post by TudorOS1 »

Brendan wrote:No.
Sorry if thats a useless quote to you but it is Brendan's reply to my question. Im adding 2 new functions called SetGlobalLogicalMode and GetGlobalLogicalMode.
Brendan wrote:the Destination Format Register in each CPU's local APIC must be configured correctly to match the chipset.
Thats something I will leave out of the KDK(This is chipset specific)
Brendan wrote:For almost all 80x86 machines the chipset expects "Logical Flat Mode".
Would you mind telling everyone using the KDK that(I might put it in the KDK tutorial).
Brendan wrote:Also note that for newer machines (Nehalem and later) that support x2APIC; when operating in x2APIC mode there is no Destination Format Register and you're forced to use "Logical Cluster Mode".
I don't support x2APIC(yet) so this is irrelavant to me(plus i have Core 2 Duo in my computer so there wont be a x2APIC
WARNING: Bad joke
Why did the chick run away?
He was a little chicken
Post Reply