Hi,
nooooooooos wrote:
Brendan wrote:
The only difference is that the MPS tables won't list additional logical CPUs (e.g. for a dual core chip with hyper-threading you'd get 2 CPUs listed by MPS), while the ACPI tables will (e.g. for a dual core chip with hyper-threading you'd get 4 CPUs listed by ACPI).
But then how I know the ID of the other part of the processor with? Do both processors have the same ID and a IPI reaches always both "parts of a processor"?
The other logical CPU in the core has it's own seperate local APIC and it's own local APIC ID.
nooooooooos wrote:
How can I find out with MPS Tables that there is HT? With CPUID?
You could use MPS to find one logical CPU in each core, and then use CPUID (on the logical CPU you did find) to see if it supports hyperthreading and if there are other logical CPUs in the core. Then you could assume that the additional logical CPUs (if any) have sequentially numbered local APIC IDs.
For example, if MPS says that one CPU has the local APIC ID 0x04, and if CPUID says that this CPU has one additional logical CPU, then you can assume the additional logical CPU has the local APIC ID 0x05.
In general, you should use ACPI tables (if present) to detect the local APIC IDs for other CPUs (if any), even if you use MPS tables for everything else.
There's other things you probably should know here...
For hyper-threading, for some software it makes performance worse, and for some OSs (that aren't designed for hyper-threading) it could cause timing problems because the performance of one logical CPU depends on what work the other logical CPU is doing.
For these reasons most BIOSs have an option to enable/disable hyperthreading, and the end user may have deliberately disabled hyperthreading. If hyper-threading is disabled, then the BIOS won't report additional logical CPUs in the ACPI tables (but that's the only difference). In this case your MPS code would start logical CPUs anyway - the BIOS setting will be ignored, and the end user won't be able to disable hyperthreading if it hurts performance.
Also, if the OS isn't optimized for hyperthreading then it's more likely that using the additional logical CPUs will reduce performance. AFAIK this is why the MPS tables never report the other logical CPUs - they assume that old OSs (that don't use ACPI tables) aren't optimized for hyperthreading and may have timing problems.
Cheers,
Brendan