shepmaster / cupid

Get information about the x86 and x86_64 processor
MIT License
34 stars 9 forks source link

Add logical_processor_id, max_logical_processor_ids, and extended topology #21

Closed flier closed 5 years ago

shepmaster commented 5 years ago

Thanks!

Checking the reference manual:

EBX Bits 07 - 00: Brand Index. Bits 15 - 08: CLFLUSH line size (Value ∗ 8 = cache line size in bytes; used also by CLFLUSHOPT). Bits 23 - 16: Maximum number of addressable IDs for logical processors in this physical package*. Bits 31 - 24: Initial APIC ID.

NOTES:

  • The nearest power-of-2 integer that is not smaller than EBX[23:16] is the number of unique initial APIC IDs reserved for addressing different logical processors in a physical package. This field is only valid if CPUID.1.EDX.HTT[bit 28]= 1.

Only the maximum has the asterisk, and it says to check a different bit (HTT instead of APIC). Can you help me understand why this code appears to differ from the manual?

flier commented 5 years ago

sorry, my mistake, we should check htt instead of acpi

shepmaster commented 5 years ago

Sorry for the delay, this notification got pushed to the bottom of my inbox! I made some tweaks to the commits and reorganized them a bit, looks good to me!