Identification of x86 CPUs with CPUID support

Copyright 1996-2000 by Grzegorz Mazur
All the brand names used here belong to their respective owners.




Revision history:
2000-09-29 - K7 and Centaur info expanded & corrected
2000-09-18 - Rise info updated, also undocumented CPUID
2000-09-14 - more signatures, Transmeta info
1998-11-09 - Rise info, C6-2, ids updated
980913 - ids updated
980415 - more new cpuids
980409 - new cpuids
971104 - info on 486DX w/CPUID
971014/15 - some corrections, Cyrix ext. CPUID, more info on Cyrix, New and undocumented AMD K6 CPUID, IDT C6
970514 - K5 info corrected
970508 - Pentium II and some other info corrected/expanded
970124 - Cx6x86 info corrected and extended
970107 - K5 info extended
961127 - some corrections
1996-05-20 - signatures updated
1996-04-03 - initial version, not yet finished


This part of article describes recognition of contemporary x86 CPUs supporting the CPUID instruction (beginning with newer versions of 486).
The newest up-to-date information on CPUID is usually available from CPU manufacturers. The information below should be treated as a supplement to the official documentation. In particular those who want to use CPUID in their programs should read Intel's CPUID application note available from developers.intel.com and AMD documents available in Tech Docs section of AMD's website.


Some background

CPUID instruction was introduced by Intel in Pentium processor. Since then it became the official method of identification for Pentium class and newer chips. It is also supported by newer 486-class chips made by Intel, AMD, UMC and Cyrix, and newer NexGen CPUs.


Checking for CPUID support...

...is described in another part of this article.

Note that NexGen CPUs are believed not to support CPUIDF bit, but some of them have CPUID...


Obtaining CPUID info

CPUID instruction opcode is 0fh, 0a2h (two bytes). An argument is passed in EAX. The argument selects information that should be returned by CPUID.

Standard CPUID

This section describes CPUID as defined by Intel.

Entry: EAX=0

Exit:
EAX = maximum value of CPUID argument supported by the CPU (on early Intel Pentium sample chips EAX contained the CPU signature, described below, so its value was >500h.
EBX:EDX:ECX= vendor id string (EBX.lsb = first char, ECX.msb = last char).
NOTE: IDT processors may supply any vendor string when programmed appropriately, even "GenuineIntel" or "MyOwnGoodCPU". The proposed IDT identification routine is described below.

Entry: EAX = 1

Exit (for Intel CPUs only, others are similar but not the same!):
EAX = cpu id signature, currently bits 31..16 - unused, bits 15..12 - type (t), bits 11.8 - family (f), bits 7..4 - model (m), bits 3..0 - mask revision (r) .
Note: IDT and Cyrix family CPUs may fool you there.
EBX = 31..24 - default APIC ID, 23..16 - Logical processsor ID, 15..8 - CFLUSH chunk size , 7..0 - brand ID - available from Pentium III up
EDX = cpu feature flags - interpretation may depend on manufacturer and model, currently these bits are defined by Intel as follows:
 

Standard CPU features returned by CPUID with EAX=1

bit

mnemonic

description

0

FPU

Floating Point Unit

1

VME

V86 Mode Extensions

2

DE

Debug Extensions - I/O breakpoints

3

PSE

Page Size Extensions (4 MB pages)

4

TSC

Time Stamp Counter and RDTSC instruction

5

MSR

Model Specific Registers

6

PAE

Physical Address Extensions (36-bit address, 2MB pages)

7

MCE

Machine Check Exception

8

CX8

CMPXCHG8B instruction available

9

APIC

Local APIC present (multiprocesssor operation support) AMD K5 model 0 (SSA5) only: global pages supported !

10

reserved (Fast System Call on AMD K6 model 6 and Cyrix)

11

SEP

Fast system call (SYSENTER and SYSEXIT instructions) - (on Intel CPUs only if signature >= 0633!)

12

MTRR

Memory Type Range Registers

13

PGE

Page Global Enable - global oages support

14

MCA

Machine Check Architecture and MCG_CAP register

15

CMOV

Conditional MOVe instructions

16

PAT

Page Attribute Table (MSR 277h)

17

PSE36

36 bit Page Size Extenions (36-bit addressing for 4 MB pages with 4-byte descriptors)

18

PSN

Processor Serial Number

19

CFLSH

Cache Flush

20

?

21

DTES

Debug Trace Store

22

ACPI

ACPI support

23

MMX

MultiMedia Extensions

24

FXSR

FXSAVE and FXRSTOR instructions

25

SSE

SSE instructions (introduced in Pentium III)

26

SSE2

SSE2 (WNI) instructions (introduced in Pentium 4)

27

SELFSNOOP

28

?

29

ACC

Automatic clock control

30

IA64

IA64 instructions?

31

?

Other vendors may define these bits slightly different. Known differences are: K5 Global Pages, K6 model 6 Fast system call, Cyrix Fast system call and bit 24 (Extended MMX). All these differences are documented in the appropriate manuals available via www directly from vendors.

EAX = 2 (Available only if CPUID 0 returns > 1 - P6 line, new Cyrix)

Exit:
Cache and TLB information, described in PPro manuals and application note AP-485 available on-line.

EAX = 3

Return Processor Serial Number

Extended CPUID

Starting with K5 model 1 (= K5-PR120/133), AMD introduced extended CPUID instruction. Extended CPUID is called when EAX content has bit 31 set to 1.
The Extended CPUID is supported by variuos vendors starting with the following CPU models:

EAX=0x80000000: Get extended CPUID info.

Returns max extended CPUID level in EAX (currently 0x80000005) or 0 if no extended CPUID is available.
On IDT C6-2 the extended functions are mirrored with EAX=0xC000000x for some C6 compatibility).

EAX=0x80000001: Get extended CPU features.

Described in manuals available from Cyrix, AMD and IDT.

EAX=0x80000002..0x80000004: Get CPU name

EAX:EBX:ECX:EDX contain 16 characters of CPU name string EAX.lsb = first character, EDX.msb = last character. Note that this is different from the convention used for returning VendorId string with EAX=0. The CPU name can be up to 48 chars long. If it is shorter (like it currently is), it is terminated with NUL character (code 0).
The name returned by IDT C6-2 (Winchip 2) depends on its operating mode. If 3D Now! instructions are enabled, the name ends with "-3D".

EAX=0x80000005: Get CPU TLB and cache information.

Described in details in AMD and Cyrix manuals, available on-line.

EAX = 0x80000006

Get L2 TLB and cache information. Available on AMD K6-III, K6-2+, K6-III+, K7 family

EAX = 0x80000007

Get power management information

EAX = 0x80000008

Get more CPU information (AMD Hammer family)
Returns number of physical and virtual address bits physically implemented on a given CPU,

EAX = 0x8086xxxx

Transmeta extended CPUID. See Transmeta Crusoe page.

EAX=0x8ffffffe: AMD K6 Unofficial CPU signature

Undocumented. Returns the string "DEI"
 

EAX=0x8fffffff: AMD K6 Unofficial CPU signature

Undocumented. Returns the string "NexGenerationAMD"
these CPUID levels serve as "hall of fame" for NexGen design team which designed the K6.
 

EAX=0xc0000000: IDT extended features presence test.

If this function returns 0xc0000000 in EAX, IDT-specific features are present, which effectively means that output of CPUID 0 and 1 may be controlled by a programmer. More info here. On C6-2 this function is an equivalent of 0x80000000.


Rise extended CPUID

Rise mP6 family CPUs use CPUID instruction in place of MSR access instructions (WRMSR). Execution of CPUID with special register values causes some changes to internal processor features. I would speculate that the following forms of CPUID on Rise CPUs influence the features reported by CPUID level 1.

On entry, EDX:ECX:EAX contain 12-character string. The instruction may modify any general purpose registers. Two forms are known:
"*Eccl_12:12*"
"#Eccl 12:13#"


Interpretation of CPUID data

First find the section with proper vendor id string below, then interpret the signature according to the description.
GenuineIntel
UMC UMC UMC
AuthenticAMD (AMD ISBETTER)
CyrixInstead
NexGenDriven
CentaurHauls
RiseRiseRise
GenuineTMx86

Please email me if you have any of the chips listed below marked with asterisk '*', or not listed below.


"GenuineIntel"

Vendor: Intel Corp.

Type field: 0 - standard, 1 - overdrive, 2 - 2nd processor in dual-processor system.

Family / Model / Mask rev.


"UMC UMC UMC "

Vendor: United Microelectronics Corporation

Family / Model / Mask
 
 


"AuthenticAMD"

Can also be "AMD ISBETTER" in some engineering samples (1994?) - email me if you have such chip...

Vendor: Advanced Micro Devices

Family / Model / Mask rev.


"CyrixInstead"

Vendor: Cyrix Corp., VIA Inc.

Note1: CPUID support must be enabled to toggle CPUID bit in EFLAGS and to exexcute CPUID. To do so, set CPUIDEN bit to one (it is bit 7 of CCR4). Anyway it is better to use DIR registers, which provide more precise identification than CPUID, at least on all CPUs up to 6x86MX.

Note2: The value returned in EAX by CPUID level 1 has the following structure:


"NexGenDriven"

Vendor: NexGen Inc., (acquired by AMD, so don't expect anything new here).
CPUID support for Nx586 relies on BIOS, not on the CPU. In fact, the BIOS loads the microcode responsible for CPUID execution. So if you ant CPUID on Nx586, get the new BIOS from AMD.
Note: Nx586 CPUs (or rather some verions of the microcode) are believed not to support CPUIDEN bit in EFLAGS, so there is no check available. Only newer models support CPUID instruction. The only method to check for CPUID is to execute it with illegal opcode handler installed.


"CentaurHauls"

Vendor: IDT/Centaur, now VIA
These chips may supply any vendor ID and Family/Model information. See the identification routine below.


"RiseRiseRise"

Vendor: Rise


"GenuineTMx86"

Vendor: Transmeta


IDT (Centaur) Identification routine

C6 may return any string as VendorID and any value as Family/Model. Once changed, the family/model/stepping information cannot be recovered other than by resetting the processor. True Vendor ID can be read at any time, provided that the control it is set to 0.  To check if the CPU is IDT, follow the steps described below:

To get the real CPUID, I would sugest resetting the CPU using the technique similar to the one used to get the reset signature.

General IDT C6 CPUID behavior

When CPUID is executed with EAX > 2, the EAX remains unchanged and contains the original value. This complies with the behavior described by IDT (CPUID 0xC0000000 returns 0xC0000000 in EAX).


Copyright 1996-8 by Grzegorz Mazur