dd86k / ddcpuid

🔬 dd's x86 CPU Identification tool
MIT License
36 stars 1 forks source link

Report processor revision #6

Closed dd86k closed 6 years ago

dd86k commented 7 years ago

Alongside the Family, Model, and Stepping, it'd be nice if we could report the processor revision!

dd86k commented 6 years ago

Dear old me,

The Revision concerns the microcode.

In Intel's reference manual, Vol 3A:

Each logical processor has its own BIOS signature MSR (IA32_BIOS_SIGN_ID at MSR address 8BH).

Intel then proceeds with this snippet to retrieve the signature (at §9.11.7.1, page 9-36 or 3006):

MOV ECX, 08BH ;IA32_BIOS_SIGN_ID
XOR EAX, EAX ;clear EAX
XOR EDX, EDX ;clear EDX
WRMSR ;Load 0 to MSR at 8BH
MOV EAX, 1
cpuid
MOV ECX, 08BH ;IA32_BIOS_SIGN_ID
rdmsr ;Read Model Specific Register

Note: The signature is in EDX.

Since the snippet uses the RDMSR and WRMSR instructions, it is impossible to execute this code in a ring 3 context. Therefore I would require the OS to fetch me this kind of data, which I want to avoid. Unless I'm able to do an EFI variant of the tool, which then I would have other projects for.