Obtaining CPU Step Code from CPUID

1.8k Views Asked by At

I see that it is possible to extract the CPU specifications using the CPUID, but I haven't seen a way to extract the CPU Step code like SLB8X which is an Intel Xeon X3360 2.83 Ghz 12M cache and 1333Mhz manufactured in Malayasia. I believe that the same CPU ID information relate to multiple CPU Step codes.

BS in Comp Sci here, but not a programmer, just getting some information for my programmers to see if the above is possible. Alternatively, is there a table on Intel.com and/or AMD that maps CPUID to Step code?

2

There are 2 best solutions below

0
On

The CPU doesn't report that. You can find processor information using sudo dmidecode --type processor on Linux. You'll get information such as Signature: Type 0, Family 6, Model 45, Stepping 7

0
On

I’ll link to a table for the stepping ids but maybe your programmers would be interested in the features table so they know what instructions a particular processor supports, that is if they are working at that low of a level. Even if not, this is interesting to know.

This site has both those tables: https://www.felixcloutier.com/x86/cpuid

For some of the information you are looking for in particular, this site says:

The brand index method (introduced with Pentium® III Xeon® processors) provides an entry point into a brand identification table that is maintained in memory by system software and is accessible from system- and user-level code... Software can then use this index to locate the brand identification string for the processor in the brand identification table.

Then refer to Table 3-14 unless you have software already that can interpret it.

Loading EAX with 01H might be all your programmers need though because in return you’ll get model, family and processor type in EAX like so: enter image description here Then the value in EBX will be the cache line size (second byte of EBX) the brand index (low byte of EBX) and an APIC ID (high byte of EBX).

You can check these values using something like this:

unsigned eax, ebx, ecx, edx;
if (__get_cpuid(0x00, &eax, &ebx, &ecx, &edx) == 0) {
    // cpuid not supported
}
if (eax < 0x14) {
    // leaf 0x14 not supported
}
__cpuid_count(0x14, 0x00, eax, ebx, ecx, edx); 
if ((ebx & 0x10) == 0) {
    // PTWRITE not supported
}