3 ms·
Core ID in TSC_AUX is essentially an concession to userspace. As an OS and firmware you are supposed to identify CPU cores by means of their LAPIC ID (as read f
by dfox 4y ago
Core ID in TSC_AUX is essentially an concession to userspace. As an OS and firmware you are supposed to identify CPU cores by means of their LAPIC ID (as read from APIC configurations MSR or from CPUID). Small issue there is that APIC IDs are structured according to HT/NUMA topology and thus not necessarily consecutive.
On the other hand, as an OS on PC-like platform you know how many cores there are supposed to be and what are their APIC IDs before-hand because they were already enumerated by firmware (which is the reason why you can do the one by one AP startup sequence in the first place).
- JoshTriplett 4y agoExactly: either read the APIC ID and use that to look up the CPU number in a table you already have, or arrange a location in memory to use xadd to assign a sequential CPU number, whichever your OS prefers.