CPUIDIn the x86 architecture, the CPUID instruction (identified by a A program can use the HistoryPrior to the general availability of the Outside the x86 family, developers are mostly still required to use esoteric processes (involving instruction timing or CPU fault triggers) to determine the variations in CPU design that are present. For example, in the Motorola 680x0 family — which never had a While the Calling CPUIDThe In assembly language, the To obtain extended function information CPUID leaves greater than 3 but less than 80000000 are accessible only when the model-specific registers have IA32_MISC_ENABLE.BOOT_NT4 [bit 22] = 0 (which is so by default). As the name suggests, Windows NT 4.0 until SP6 did not boot properly unless this bit was set,[6] but later versions of Windows do not need it, so basic leaves greater than 4 can be assumed visible on current Windows systems. As of April 2024[update], basic valid leaves go up to 23h, but the information returned by some leaves are not disclosed in the publicly available documentation, i.e. they are "reserved". Some of the more recently added leaves also have sub-leaves, which are selected via the ECX register before calling EAX=0: Highest Function Parameter and Manufacturer IDThis returns the CPU's manufacturer ID string – a twelve-character ASCII string stored in EBX, EDX, ECX (in that order). The highest basic calling parameter (the largest value that EAX can be set to before calling Here is a list of processors and the highest function implemented.
The following are known processor manufacturer ID strings:
The following are ID strings used by open source soft CPU cores:
The following are known ID strings from virtual machines:
For instance, on a .intel_syntax noprefix
.text
.m0: .string "CPUID: %x\n"
.m1: .string "Largest basic function number implemented: %i\n"
.m2: .string "Vendor ID: %s\n"
.globl main
main:
push r12
mov eax, 1
sub rsp, 16
cpuid
lea rdi, .m0[rip]
mov esi, eax
call printf
mov eax, 0
cpuid
lea rdi, .m1[rip]
mov esi, eax
mov r12d, edx
mov ebp, ecx
call printf
mov 3[rsp], ebx
lea rsi, 3[rsp]
lea rdi, .m2[rip]
mov 7[rsp], r12d
mov 11[rsp], ebp
call printf
add rsp, 16
pop r12
ret
.section .note.GNU-stack,"",@progbits
On some processors, it is possible to modify the Manufacturer ID string reported by CPUID.(EAX=0) by writing a new ID string to particular MSRs (Model-specific registers) using the
EAX=1: Processor Info and Feature BitsThis returns the CPU's stepping, model, and family information in register EAX (also called the signature of a CPU), feature flags in registers EDX and ECX, and additional feature info in register EBX.[30]
As of October 2023, the following x86 processor family IDs are known:[32]
The processor info and feature flags are manufacturer specific but usually, the Intel values are used by other manufacturers for the sake of compatibility.
Reserved fields should be masked before using them for processor identification purposes. EAX=2: Cache and TLB Descriptor InformationThis returns a list of descriptors indicating cache and TLB capabilities in EAX, EBX, ECX and EDX registers. On processors that support this leaf, calling For each of the four registers (EAX,EBX,ECX,EDX), if bit 31 is set, then the register should not be considered to contain valid descriptors (e.g. on Itanium in IA-32 mode, CPUID(EAX=2) returns The table below provides, for known descriptor values, a condensed description of the cache or TLB indicated by that descriptor value (or other information, where that applies). The suffixes used in the table are:
EAX=3: Processor Serial NumberThis returns the processor's serial number. The processor serial number was introduced on Intel Pentium III, but due to privacy concerns, this feature is no longer implemented on later models (the PSN feature bit is always cleared). Transmeta's Efficeon and Crusoe processors also provide this feature. AMD CPUs however, do not implement this feature in any CPU models. For Intel Pentium III CPUs, the serial number is returned in the EDX:ECX registers. For Transmeta Efficeon CPUs, it is returned in the EBX:EAX registers. And for Transmeta Crusoe CPUs, it is returned in the EBX register only. Note that the processor serial number feature must be enabled in the BIOS setting in order to function.
EAX=4 and EAX=8000'001Dh: Cache Hierarchy and TopologyThese two leaves are used to provide information about the cache hierarchy levels available to the processor core on which the In the below table, fields that are defined for leaf
For any caches that are valid and not fully-associative, the value returned in ECX is the number of sets in the cache minus 1. (For fully-associative caches, ECX should be treated as if it return the value 0.)
For any given cache described by a sub-leaf of
For example, on Intel Crystalwell CPUs, executing CPUID with EAX=4 and ECX=4 will cause the processor to return the following size information for its level-4 cache in EBX and ECX: EAX=4 and EAX=Bh: Intel Thread/Core and Cache TopologyThese two leaves are used for processor topology (thread, core, package) and cache hierarchy enumeration in Intel multi-core (and hyperthreaded) processors.[89] As of 2013[update] AMD does not use these leaves but has alternate ways of doing the core enumeration.[90] Unlike most other CPUID leaves, leaf Bh will return different values in EDX depending on which logical processor the CPUID instruction runs; the value returned in EDX is actually the x2APIC id of the logical processor. The x2APIC id space is not continuously mapped to logical processors, however; there can be gaps in the mapping, meaning that some intermediate x2APIC ids don't necessarily correspond to any logical processor. Additional information for mapping the x2APIC ids to cores is provided in the other registers. Although the leaf Bh has sub-leaves (selected by ECX as described further below), the value returned in EDX is only affected by the logical processor on which the instruction is running but not by the subleaf. The processor(s) topology exposed by leaf Bh is a hierarchical one, but with the strange caveat that the order of (logical) levels in this hierarchy doesn't necessarily correspond to the order in the physical hierarchy (SMT/core/package). However, every logical level can be queried as an ECX subleaf (of the Bh leaf) for its correspondence to a "level type", which can be either SMT, core, or "invalid". The level id space starts at 0 and is continuous, meaning that if a level id is invalid, all higher level ids will also be invalid. The level type is returned in bits 15:08 of ECX, while the number of logical processors at the level queried is returned in EBX. Finally, the connection between these levels and x2APIC ids is returned in EAX[4:0] as the number of bits that the x2APIC id must be shifted in order to obtain a unique id at the next level. As an example, a dual-core Westmere processor capable of hyperthreading (thus having two cores and four threads in total) could have x2APIC ids 0, 1, 4 and 5 for its four logical processors. Leaf Bh (=EAX), subleaf 0 (=ECX) of CPUID could for instance return 100h in ECX, meaning that level 0 describes the SMT (hyperthreading) layer, and return 2 in EBX because there are two logical processors (SMT units) per physical core. The value returned in EAX for this 0-subleaf should be 1 in this case, because shifting the aforementioned x2APIC ids to the right by one bit gives a unique core number (at the next level of the level id hierarchy) and erases the SMT id bit inside each core. A simpler way to interpret this information is that the last bit (bit number 0) of the x2APIC id identifies the SMT/hyperthreading unit inside each core in our example. Advancing to subleaf 1 (by making another call to CPUID with EAX=Bh and ECX=1) could for instance return 201h in ECX, meaning that this is a core-type level, and 4 in EBX because there are 4 logical processors in the package; EAX returned could be any value greater than 3, because it so happens that bit number 2 is used to identify the core in the x2APIC id. Note that bit number 1 of the x2APIC id is not used in this example. However, EAX returned at this level could well be 4 (and it happens to be so on a Clarkdale Core i3 5x0) because that also gives a unique id at the package level (=0 obviously) when shifting the x2APIC id by 4 bits. Finally, you may wonder what the EAX=4 leaf can tell us that we didn't find out already. In EAX[31:26] it returns the APIC mask bits reserved for a package; that would be 111b in our example because bits 0 to 2 are used for identifying logical processors inside this package, but bit 1 is also reserved although not used as part of the logical processor identification scheme. In other words, APIC ids 0 to 7 are reserved for the package, even though half of these values don't map to a logical processor. The cache hierarchy of the processor is explored by looking at the sub-leaves of leaf 4. The APIC ids are also used in this hierarchy to convey information about how the different levels of cache are shared by the SMT units and cores. To continue our example, the L2 cache, which is shared by SMT units of the same core but not between physical cores on the Westmere is indicated by EAX[26:14] being set to 1, while the information that the L3 cache is shared by the whole package is indicated by setting those bits to (at least) 111b. The cache details, including cache type, size, and associativity are communicated via the other registers on leaf 4. Beware that older versions of the Intel app note 485 contain some misleading information, particularly with respect to identifying and counting cores in a multi-core processor;[91] errors from misinterpreting this information have even been incorporated in the Microsoft sample code for using CPUID, even for the 2013 edition of Visual Studio,[92] and also in the sandpile.org page for CPUID,[93] but the Intel code sample for identifying processor topology[89] has the correct interpretation, and the current Intel Software Developer's Manual has a more clear language. The (open source) cross-platform production code[94] from Wildfire Games also implements the correct interpretation of the Intel documentation. Topology detection examples involving older (pre-2010) Intel processors that lack x2APIC (thus don't implement the EAX=Bh leaf) are given in a 2010 Intel presentation.[95] Beware that using that older detection method on 2010 and newer Intel processors may overestimate the number of cores and logical processors because the old detection method assumes there are no gaps in the APIC id space, and this assumption is violated by some newer processors (starting with the Core i3 5x0 series), but these newer processors also come with an x2APIC, so their topology can be correctly determined using the EAX=Bh leaf method. EAX=5: MONITOR/MWAIT FeaturesThis returns feature information related to the
EAX=6: Thermal and Power ManagementThis returns feature bits in the EAX register and additional information in the EBX, ECX and EDX registers.
EAX=7, ECX=0: Extended FeaturesThis returns extended feature flags in EBX, ECX, and EDX. Returns the maximum ECX value for EAX=7 in EAX.
EAX=7, ECX=1: Extended FeaturesThis returns extended feature flags in all four registers.
EAX=7, ECX=2: Extended FeaturesThis returns extended feature flags in EDX. EAX, EBX and ECX are reserved.
EAX=0Dh: XSAVE Features and State ComponentsThis leaf is used to enumerate XSAVE features and state components. The XSAVE instruction set extension is designed to save/restore CPU extended state (typically for the purpose of context switching) in a manner that can be extended to cover new instruction set extensions without the OS context-switching code needing to understand the specifics of the new extensions. This is done by defining a series of state-components, each with a size and offset within a given save area, and each corresponding to a subset of the state needed for one CPU extension or another. The The state-components can be subdivided into two groups: user-state (state-items that are visible to the application, e.g. AVX-512 vector registers), and supervisor-state (state items that affect the application but are not directly user-visible, e.g. user-mode interrupt configuration). The user-state items are enabled by setting their associated bits in the The XSAVE mechanism can handle up to 63 state-components in this manner. State-components 0 and 1 (x87 and SSE, respectively) have fixed offsets and sizes - for state-components 2 to 62, their sizes, offsets and a few additional flags can be queried by executing
Attempting to query an unsupported state-component in this manner results in EAX,EBX,ECX and EDX all being set to 0. Sub-leaves 0 and 1 of
As of July 2023, the XSAVE state-components that have been architecturally defined are:
EAX=12h: SGX CapabilitiesThis leaf provides information about the supported capabilities of the Intel Software Guard Extensions (SGX) feature. The leaf provides multiple sub-leaves, selected with ECX. Sub-leaf 0 provides information about supported SGX leaf functions in EAX and maximum supported SGX enclave sizes in EDX; ECX is reserved. EBX provides a bitmap of bits that can be set in the MISCSELECT field in the SECS (SGX Enclave Control Structure) - this field is used to control information written to the MISC region of the SSA (SGX Save State Area) when an AEX (SGX Asynchronous Enclave Exit) occurs.
Sub-leaf 1 provides a bitmap of which bits can be set in the 128-bit ATTRIBUTES field of SECS in EDX:ECX:EBX:EAX (this applies to the SECS copy used as input to the
Sub-leaves 2 and up are used to provide information about which physical memory regions are available for use as EPC (Enclave Page Cache) sections under SGX.
EAX=14h, ECX=0: Processor TraceThis sub-leaf provides feature information for Intel Processor Trace (also known as Real Time Instruction Trace). The value returned in EAX is the index of the highest sub-leaf supported for CPUID with EAX=14h. EBX and ECX provide feature flags, EDX is reserved.
EAX=15h and EAX=16h: CPU, TSC, Bus and Core Crystal Clock FrequenciesThese two leaves provide information about various frequencies in the CPU in EAX, EBX and ECX (EDX is reserved in both leaves).
If the returned values in EBX and ECX of leaf 15h are both nonzero, then the TSC (Time Stamp Counter) frequency in Hz is given by On some processors (e.g. Intel Skylake), CPUID_15h_ECX is zero but CPUID_16h_EAX is present and not zero. On all known processors where this is the case,[120] the TSC frequency is equal to the Processor Base Frequency, and the Core Crystal Clock Frequency in Hz can be computed as On processors that enumerate the TSC/Core Crystal Clock ratio in CPUID leaf 15h, the APIC timer frequency will be the Core Crystal Clock frequency divided by the divisor specified by the APIC's Divide Configuration Register.[121] EAX=17h: SoC Vendor Attribute EnumerationThis leaf is present in systems where an x86 CPU IP core is implemented in an SoC (System on chip) from another vendor - whereas the other leaves of Sub-leaf 0 returns a maximum sub-leaf index in EAX (at least 3), and SoC identification information in EBX/ECX/EDX:
Sub-leaves 1 to 3 return a 48-byte SoC vendor brand string in UTF-8 format. Sub-leaf 1 returns the first 16 bytes in EAX,EBX,ECX,EDX (in that order); sub-leaf 2 returns the next 16 bytes and sub-leaf 3 returns the last 16 bytes. The string is allowed but not required to be null-terminated. EAX=19h: Intel Key Locker FeaturesThis leaf provides feature information for Intel Key Locker in EAX, EBX and ECX. EDX is reserved.
EAX=1Dh: Tile InformationWhen
EAX=1Eh, ECX=0: |
Bits | EAX | EBX | ECX | EDX | Bits | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Short | Feature | Short | Feature | Short | Feature | Short | Feature | |||||
7:0 | (reserved) | tmul_maxk | Maximum number of rows or columns (16) | (reserved) | (reserved) | 7:0 | ||||||
15:8 | (reserved) | tmul_maxn | Maximum number of bytes per column (64) | (reserved) | (reserved) | 15:8 | ||||||
23:16 | (reserved) | (reserved) | (reserved) | (reserved) | 23:16 | |||||||
31:24 | (reserved) | (reserved) | (reserved) | (reserved) | 31:24 |
EAX=1Eh, ECX=1: TMUL
Information
This leaf returns feature flags on the TMUL
(tile multiplier) unit.
Bits | EAX | EBX | ECX | EDX | Bits | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Short | Feature | Short | Feature | Short | Feature | Short | Feature | |||||
0 | amx-int8 | 8-bit integer support | (reserved) | (reserved) | (reserved) | 0 | ||||||
1 | amx-bf16 | bfloat16 support | (reserved) | (reserved) | (reserved) | 1 | ||||||
2 | amx-complex | Complex number support | (reserved) | (reserved) | (reserved) | 2 | ||||||
3 | amx-fp16 | float16 support | (reserved) | (reserved) | (reserved) | 3 | ||||||
4 | amx-fp8 | float8 support | (reserved) | (reserved) | (reserved) | 4 | ||||||
5 | amx-transpose | Transposition instruction support | (reserved) | (reserved) | (reserved) | 5 | ||||||
6 | amx-tf32 | tf32/fp19 support | (reserved) | (reserved) | (reserved) | 6 | ||||||
7 | amx-avx512 | AMX-AVX512 support | (reserved) | (reserved) | (reserved) | 7 | ||||||
8 | amx-movrs | AMX-MOVRS support | (reserved) | (reserved) | (reserved) | 8 | ||||||
31:9 | (reserved) | (reserved) | (reserved) | (reserved) | 31:9 |
EAX=21h: Reserved for TDX enumeration
When Intel TDX (Trust Domain Extensions) is active, attempts to execute the CPUID
instruction by a TD (Trust Domain) guest will be intercepted by the TDX module.
This module will, when CPUID
is invoked with EAX=21h
and ECX=0
(leaf 21h
, sub-leaf 0), return the index of the highest supported sub-leaf for leaf 21h
in EAX
and a TDX module vendor ID string as a 12-byte ASCII string in EBX,EDX,ECX (in that order). Intel's own module implementation returns the vendor ID string "IntelTDX "
(with four trailing spaces)[123] - for this module, additional feature information is not available through CPUID
and must instead be obtained through the TDX-specific TDCALL
instruction.
This leaf is reserved in hardware and will (on processors whose highest basic leaf is 21h
or higher) return 0 in EAX/EBX/ECX/EDX when run directly on the CPU.
EAX=24h, ECX=0: AVX10 Converged Vector ISA
This returns a maximum supported sub-leaf in EAX and AVX10 feature information in EBX.[112] (ECX and EDX are reserved.)
Bit | EBX | |
---|---|---|
Short | Feature | |
7:0 | AVX10 Converged Vector ISA version (≥1) | |
16:8 | (reserved) | |
17 | avx10-256 | 256-bit vector support is present |
18 | avx10-512 | 512-bit vector support is present |
31:19 | (reserved) |
EAX=24h, ECX=1: Discrete AVX10 Features
Subleaf 1 is reserved for AVX10 features not bound to a version. None are currently defined.
EAX=2000'0000h: Highest Xeon Phi Function Implemented
The highest function is returned in EAX. This leaf is only present on Xeon Phi processors.[124]
EAX=2000'0001h: Xeon Phi Feature Bits
This function returns feature flags.
Bit | EAX | EBX | ECX | EDX | Bit | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Short | Feature | Short | Feature | Short | Feature | Short | Feature | |||||
3:0 | (reserved) | (reserved) | (reserved) | (reserved) | 3:0 | |||||||
4 | (reserved) | (reserved) | (reserved) | k1om | K1OM[124] | 4 | ||||||
31:5 | (reserved) | (reserved) | (reserved) | (reserved) | 31:5 |
EAX=4000'0000h-4FFFF'FFFh: Reserved for Hypervisors
When the CPUID
instruction is executed under Intel VT-x or AMD-v virtualization, it will be intercepted by the hypervisor, enabling the hypervisor to return CPUID
feature flags that differ from those of the underlying hardware. CPUID
leaves 40000000h
to 4FFFFFFFh
are not implemented in hardware, and are reserved for use by hypervisors to provide hypervisor-specific identification and feature information through this interception mechanism.
For leaf 40000000h
, the hypervisor is expected to return the index of the highest supported hypervisor CPUID leaf in EAX, and a 12-character hypervisor ID string in EBX,ECX,EDX (in that order). For leaf 40000001h
, the hypervisor may return an interface identification signature in EAX - e.g. hypervisors that wish to advertise that they are Hyper-V compatible may return 0x31237648
—"Hv#1"
in EAX.[125][126] The formats of leaves 40000001h
and up to the highest supported leaf are otherwise hypervisor-specific. Hypervisors that implement these leaves will normally also set bit 31 of ECX for CPUID leaf 1 to indicate their presence.
Hypervisors that expose more than one hypervisor interface may provide additional sets of CPUID leaves for the additional interfaces, at a spacing of 100h
leaves per interface. For example, when QEMU is configured to provide both Hyper-V and KVM interfaces, it will provide Hyper-V information starting from CPUID leaf 40000000h
and KVM information starting from leaf 40000100h
.[127][128]
Some hypervisors that are known to return a hypervisor ID string in leaf 40000000h
include:
Hypervisor | ID String (ASCII) | Notes |
---|---|---|
Microsoft Hyper-V, Windows Virtual PC |
"Microsoft Hv" [125]
|
|
Linux KVM | "KVMKVMKVM\0\0\0" [129]
|
\0 denotes an ASCII NUL character. |
"Linux KVM Hv" [130]
|
Hyper-V emulation[131] | |
bhyve | "BHyVE BHyVE " ,"bhyve bhyve "
|
ID string changed from mixed-case to lower-case in 2013.[132]
Lower-case string also used in bhyve-derived hypervisors such as xhyve and HyperKit.[133] |
Xen | "XenVMMXenVMM" [134]
|
Only when using HVM (hardware virtual machine) mode. |
QEMU | "TCGTCGTCGTCG" [135]
|
Only when the TCG (Tiny Code Generator) is enabled. |
Parallels | " lrpepyh vr"
|
(it possibly should be "prl hyperv", but it is encoded as " lrpepyh vr" due to an endianness mismatch)[citation needed] |
VMware | "VMwareVMware" [136]
|
|
Project ACRN | "ACRNACRNACRN" [137]
|
|
VirtualBox | "VBoxVBoxVBox" [138]
|
Only when configured to use the "hyperv" paravirtualization provider. |
QNX Hypervisor | "QXNQSBMV"
|
The QNX hypervisor detection method provided in the official QNX documentation[139] checks only the first 8 characters of the string, as provided in EBX and ECX (including an endianness swap) - EDX is ignored and may take any value. |
NetBSD NVMM | "___ NVMM ___" [140]
| |
OpenBSD VMM | "OpenBSDVMM58" [141]
|
|
Jailhouse | "Jailhouse\0\0\0" [142]
|
\0 denotes an ASCII NUL character. |
Intel HAXM | "HAXMHAXMHAXM" [143]
|
Project discontinued. |
Intel KGT (Trusty) | "EVMMEVMMEVMM" [144]
|
On "trusty" branch of KGT only, which is used for the Intel x86 Architecture Distribution of Trusty OS (archive)
(KGT also returns a signature in |
Unisys s-Par | "UnisysSpar64" [145]
|
|
Lockheed Martin LMHS | "SRESRESRESRE" [146]
|
EAX=8000'0000h: Highest Extended Function Implemented
The highest calling parameter is returned in EAX.
EBX/ECX/EDX return the manufacturer ID string (same as EAX=0) on AMD but not Intel CPUs.
EAX=8000'0001h: Extended Processor Info and Feature Bits
This returns extended feature flags in EDX and ECX.
Many of the bits in EDX
(bits 0 through 9, 12 through 17, 23, and 24) are duplicates of EDX
from the EAX=1
leaf - these bits are highlighted in light yellow. (These duplicated bits are present on AMD but not Intel CPUs.)
AMD feature flags are as follows:[147][148]
Bit | EDX | ECX | Bit | |||
---|---|---|---|---|---|---|
Short | Feature | Short | Feature | |||
0 | fpu | Onboard x87 FPU | lahf_lm | LAHF /SAHF in long mode
|
0 | |
1 | vme | Virtual mode extensions (VIF) | cmp_legacy | Hyperthreading not valid | 1 | |
2 | de | Debugging extensions (CR4 bit 3) | svm | Secure Virtual Machine | 2 | |
3 | pse | Page Size Extension | extapic | Extended APIC space | 3 | |
4 | tsc | Time Stamp Counter | cr8_legacy | CR8 in 32-bit mode | 4 | |
5 | msr | Model-specific registers | abm/lzcnt | Advanced bit manipulation (LZCNT and POPCNT )
|
5 | |
6 | pae | Physical Address Extension | sse4a | SSE4a | 6 | |
7 | mce | Machine Check Exception | misalignsse | Misaligned SSE mode | 7 | |
8 | cx8 | CMPXCHG8B (compare-and-swap) instruction
|
3dnowprefetch | PREFETCH and PREFETCHW instructions
|
8 | |
9 | apic | Onboard Advanced Programmable Interrupt Controller | osvw | OS Visible Workaround | 9 | |
10 | (syscall)[a] | (SYSCALL /SYSRET , K6 only)
|
ibs | Instruction Based Sampling | 10 | |
11 | syscall[b] | SYSCALL and SYSRET instructions
|
xop | XOP instruction set | 11 | |
12 | mtrr | Memory Type Range Registers | skinit | SKINIT /STGI instructions
|
12 | |
13 | pge | Page Global Enable bit in CR4 | wdt | Watchdog timer | 13 | |
14 | mca | Machine check architecture | (reserved) | 14 | ||
15 | cmov | Conditional move and FCMOV instructions
|
lwp | Light Weight Profiling[152] | 15 | |
16 | pat[c] | Page Attribute Table | fma4 | 4-operand fused multiply-add instructions | 16 | |
17 | pse36 | 36-bit page size extension | tce | Translation Cache Extension | 17 | |
18 | (reserved) | (reserved) | 18 | |||
19 | ecc | "Athlon MP" / "Sempron" CPU brand identification[d] | nodeid_msr | NodeID MSR (C001_100C )[157]
|
19 | |
20 | nx | NX bit | (reserved) | 20 | ||
21 | (reserved) | tbm | Trailing Bit Manipulation | 21 | ||
22 | mmxext | Extended MMX | topoext | Topology Extensions | 22 | |
23 | mmx | MMX instructions | perfctr_core | Core performance counter extensions | 23 | |
24 | fxsr[c] | FXSAVE , FXRSTOR instructions, CR4 bit 9
|
perfctr_nb | Northbridge performance counter extensions | 24 | |
25 | fxsr_opt | FXSAVE /FXRSTOR optimizations
|
(StreamPerfMon) | (Streaming performance monitor architecture)[e] | 25 | |
26 | pdpe1gb | Gigabyte pages | dbx | Data breakpoint extensions | 26 | |
27 | rdtscp | RDTSCP instruction
|
perftsc | Performance timestamp counter (PTSC) | 27 | |
28 | (reserved) | pcx_l2i | L2I perf counter extensions | 28 | ||
29 | lm | Long mode | monitorx | MONITORX and MWAITX instructions
|
29 | |
30 | 3dnowext | Extended 3DNow! | addr_mask_ext | Address mask extension to 32 bits for instruction breakpoints | 30 | |
31 | 3dnow | 3DNow! | (reserved) | 31 |
- ^ The use of EDX bit 10 to indicate support for
SYSCALL
/SYSRET
is only valid onAuthenticAMD
Family 5 Model 7 CPUs (AMD K6, 250nm "Little Foot") - for all other processors, EDX bit 11 should be used instead.These instructions were first introduced on Model 7[149] - the CPUID bit to indicate their support was moved[150] to EDX bit 11 from Model 8 (AMD K6-2) onwards.
- ^ On Intel CPUs, the CPUID bit for
SYSCALL
/SYSRET
is only set if theCPUID
instruction is executed in 64-bit mode.[151] - ^ a b On some processors - Cyrix MediaGXm,[153] several Geodes (NatSemi Geode GXm, GXLV, GX1; AMD Geode GX1[154]) and Transmeta Crusoe[155] - EDX bits 16 and 24 have a different meaning:
- Bit 16: Floating-point Conditional Move (
FCMOV
) supported - Bit 24: 6x86MX Extended MMX instructions supported
- Bit 16: Floating-point Conditional Move (
- ^ EDX bit 19 is used for CPU brand identification on
AuthenticAMD
Family 6 processors only - the bit is, combined with processor signature and FSB speed, used to identify processors as either multiprocessor-capable or carrying the Sempron brand name.[156] - ^ ECX bit 25 is listed as StreamPerfMon in revision 3.20 of AMD APM[158] only - it is listed as reserved in later revisions. The bit is set on Excavator and Steamroller CPUs only.
EAX=8000'0002h,8000'0003h,8000'0004h: Processor Brand String
These return the processor brand string in EAX, EBX, ECX and EDX. CPUID
must be issued with each parameter in sequence to get the entire 48-byte ASCII processor brand string.[159] It is necessary to check whether the feature is present in the CPU by issuing CPUID
with EAX = 80000000h
first and checking if the returned value is not less than 80000004h
.
The string is specified in Intel/AMD documentation to be null-terminated, however this is not always the case (e.g. DM&P Vortex86DX3 and AMD Ryzen 7 6800HS are known to return non-null-terminated brand strings in leaves 80000002h
-80000004h
[160][161]), and software should not rely on it.
#include <stdio.h>
#include <string.h>
#include <cpuid.h>
int main()
{
unsigned int regs[12];
char str[sizeof(regs)+1];
__cpuid(0x80000000, regs[0], regs[1], regs[2], regs[3]);
if (regs[0] < 0x80000004)
return 1;
__cpuid(0x80000002, regs[0], regs[1], regs[2], regs[3]);
__cpuid(0x80000003, regs[4], regs[5], regs[6], regs[7]);
__cpuid(0x80000004, regs[8], regs[9], regs[10], regs[11]);
memcpy(str, regs, sizeof(regs));
str[sizeof(regs)] = '\0';
printf("%s\n", str);
return 0;
}
On AMD processors, from 180nm Athlon onwards (AuthenticAMD
Family 6 Model 2 and later), it is possible to modify the processor brand string returned by CPUID leaves 80000002h
-80000004h
by using the WRMSR
instruction to write a 48-byte replacement string to MSRs C0010030h
-C0010035h
.[156][162] This can also be done on AMD Geode GX/LX, albeit using MSRs 300Ah
-300Fh
.[163]
In some cases, determining the CPU vendor requires examining not just the Vendor ID in CPUID leaf 0 and the CPU signature in leaf 1, but also the Processor Brand String in leaves 80000002h
-80000004h
. Known cases include:
- Montage Jintide CPUs can be distinguished from the Intel Xeon CPU models they're based on by the presence of the substring
Montage
in the brand string of the Montage CPUs (e.g. Montage Jintide C2460[164] and Intel Xeon Platinum 8160[165] - both of which identify themselves asGenuineIntel
Family 6 Model 55h Stepping 4 - can be distinguished in this manner.) CentaurHauls
Family 6 CPUs may be either VIA or Zhaoxin CPUs - these can be distinguished by the presence of the substringZHAOXIN
in the brand string of the Zhaoxin CPUs (e.g. Zhaoxin KaiXian ZX-C+ C4580[166] and VIA Eden X4 C4250[167] - both of which identify themselves asCentaurHauls
Family 6 Model 0Fh Stepping 0Eh - can be distinguished in this manner.)
EAX=8000'0005h: L1 Cache and TLB Identifiers
This provides information about the processor's level-1 cache and TLB characteristics in EAX, EBX, ECX and EDX as follows:[a]
- EAX: information about L1 hugepage TLBs (TLBs that hold entries corresponding to 2M/4M pages)[b]
- EBX: information about L1 small-page TLBs (TLBs that hold entries corresponding to 4K pages)
- ECX: information about L1 data cache
- EDX: information about L1 instruction cache
Bits | EAX | EBX | ECX | EDX | Bits | |
---|---|---|---|---|---|---|
7:0 | Number of instruction TLB entries[c] | Cache line size in bytes | 7:0 | |||
15:8 | instruction TLB associativity[d] | Number of cache lines per tag | 15:8 | |||
23:16 | Number of data TLB entries[c] | Cache associativity[d] | 23:16 | |||
31:24 | Data TLB associativity[d] | Cache size in kilobytes | 31:24 |
- ^ On some older Cyrix and Geode CPUs (specifically,
CyrixInstead
/Geode by NSC
Family 5 Model 4 CPUs only), leaf80000005h
exists but has a completely different format, similar to that of leaf 2.[168] - ^ On processors that can only handle small-pages in their TLBs, this leaf will return 0 in EAX. (On such processors, which include e.g. AMD K6 and Transmeta Crusoe, hugepage entries in the page-tables are broken up into 4K pages as needed upon entry into the TLB.)
On some processors, e.g. VIA Cyrix III "Samuel",[169] this leaf returns0x80000005
in EAX. This has the same meaning as EAX=0, i.e. no hugepage TLBs. - ^ a b On Transmeta CPUs, the value
FFh
is used to indicate a 256-entry TLB. - ^ a b c For the associativity fields of leaf
80000005h
, the following values are used:Value Meaning 0 (reserved) 1 Direct-mapped 2 to FEh
N-way set-associative (field encodes N) FFh
Fully-associative
EAX=8000'0006h: Extended L2 Cache Features
Returns details of the L2 cache in ECX, including the line size in bytes (Bits 07 - 00), type of associativity (encoded by a 4 bits field; Bits 15 - 12) and the cache size in KB (Bits 31 - 16).
#include <stdio.h>
#include <cpuid.h>
int main()
{
unsigned int eax, ebx, ecx, edx;
unsigned int lsize, assoc, cache;
__cpuid(0x80000006, eax, ebx, ecx, edx);
lsize = ecx & 0xff;
assoc = (ecx >> 12) & 0x07;
cache = (ecx >> 16) & 0xffff;
printf("Line size: %d B, Assoc. type: %d, Cache size: %d KB.\n", lsize, assoc, cache);
return 0;
}
EAX=8000'0007h: Processor Power Management Information and RAS Capabilities
This function provides information about power management, power reporting and RAS (Reliability, availability and serviceability) capabilities of the CPU.
Bit | EBX | EDX | Bit | |||
---|---|---|---|---|---|---|
Short | Feature | Short | Feature | |||
0 | MCAOverflowRecov | MCA (Machine Check Architecture) overflow recovery support | TS | Temperature Sensor | 0 | |
1 | SUCCOR | Software uncorrectable error containment and recovery capability | FID | Frequency ID Control | 1 | |
2 | HWA | Hardware assert support (MSRs C001_10C0 to C001_10DF
|
VID | Voltage ID Control | 2 | |
3 | ScalableMca | Scalable MCA supported | TTP | THERMTRIP | 3 | |
4 | (reserved) | TM | Hardware thermal control (HTC) supported | 4 | ||
5 | (reserved) | STC | Software thermal control (STC) supported[170] | 5 | ||
6 | (reserved) | 100MHzSteps | 100 MHz multiplier control | 6 | ||
7 | (reserved) | HwPstate | Hardware P-state control (MSRs C001_0061 to C001_0063 )
|
7 | ||
8 | (reserved) | TscInvariant | Invariant TSC - TSC (Time Stamp Counter) rate is guaranteed to be invariant across all P-states, C-states and sop grant transitions. | 8 | ||
9 | (reserved) | CPB | Core Performance Boost | 9 | ||
10 | (reserved) | EffFreqRO | Read-only effective frequency interface (MSRs C000_00E7 and C000_00E8 )
|
10 | ||
11 | (reserved) | ProcFeedbackInterface | Processor Feedback Interface supported | 11 | ||
12 | (reserved) | ProcPowerReporting | Processor power reporting interface supported | 12 | ||
13 | (reserved) | ConnectedStandby | Connected Standby[171] | 13 | ||
14 | (reserved) | RAPL | Running Average Power Limit[171] | 14 | ||
15 | (reserved) | FastCPPC | Fast CPPC (Collaborative Processor Performance Control) supported[171] | 15 | ||
31:16 |
(reserved) | (reserved) | 31:16 |
Bits | EAX | ECX | Bits | |||
---|---|---|---|---|---|---|
Short | Feature | Short | Feature | |||
7:0 | NumberOfMonitors | Number of Processor Feedback MSR pairs available, starting from MSR C001_0080 onwards[172]
|
CpuPwrSampleTimeRatio | Ratio of compute unit power accumulator sample period to TSC counter period. | 7:0 | |
15:8 | Version | Processor Feedback Capabilities version | 15:8 | |||
31:16 | MaxWrapTime | Maximum time between reads (in milliseconds) that software should use to avoid two wraps. | 31:16 |
EAX=8000'0008h: Virtual and Physical Address Sizes
Bit | EBX | |
---|---|---|
Short | Feature | |
0 | clzero | CLZERO instruction
|
1 | retired_instr | Retired instruction count MSR (C000_00E9h ) supported
|
2 | xrstor_fp_err | XRSTOR restores FP errors
|
3 | invlpgb | INVLPGB and TLBSYNC instructions
|
4 | rdpru | RDPRU instruction
|
5 | (reserved) | |
6 | mbe | Memory Bandwidth Enforcement |
7 | (reserved) | |
8 | mcommit | MCOMMIT instruction
|
9 | wbnoinvd | WBNOINVD instruction
|
10 | (reserved) | |
11 | (reserved) | |
12 | IBPB | Indirect Branch Prediction Barrier (performed by writing 1 to bit 0 of PRED_CMD (MSR 049h ))
|
13 | wbinvd_int | WBINVD and WBNOINVD are interruptible
|
14 | IBRS | Indirect Branch Restricted Speculation |
15 | STIBP | Single Thread Indirect Branch Prediction mode |
16 | IbrsAlwaysOn | IBRS mode has enhanced performance and should be left always on |
17 | StibpAlwaysOn | STIBP mode has enhanced performance and should be left always on |
18 | ibrs_preferred | IBRS preferred over software |
19 | ibrs_same_mode_protection | IBRS provides Same Mode Protection |
20 | no_efer_lmsle | EFER.LMSLE is unsupported[a]
|
21 | invlpgb_nested | INVLPGB support for nested pages
|
22 | (reserved) | |
23 | ppin | Protected Processor Inventory Number -
|
24 | ssbd | Speculative Store Bypass Disable |
25 | ssbd_legacy | Speculative Store Bypass Disable Legacy |
26 | ssbd_no | Speculative Store Bypass Disable Not Required |
27 | cppc | Collaborative Processor Performance Control |
28 | psfd | Predictive Store Forward Disable |
29 | btc_no | Branch Type Confusion: Processor not affected |
30 | IBPB_RET | IBPB (see bit 12) also clears return address predictor |
31 | branch_sampling | Branch Sampling Support[174] |
Bits | EAX | ECX | EDX | Bits | ||
---|---|---|---|---|---|---|
7:0 | Number of Physical Address Bits | Number of Physical Threads in processor (minus 1) | Maximum page count for INVLPGB instruction
|
7:0 | ||
11:8 | Number of Linear Address Bits | (reserved) | 11:8 | |||
15:12 | APIC ID Size | 15:12 | ||||
17:16 | Guest Physical Address Size[b] | Performance Timestamp Counter size | Maximum ECX value recognized by RDPRU instruction
|
17:16 | ||
23:18 | (reserved) | 23:18 | ||||
31:24 | (reserved) | 31:24 |
- ^ The LMSLE (Long Mode Segment Limit Enable) feature does not have its own CPUID flag and is detected by checking CPU family and model. It was introduced in
AuthenticAMD
Family 0Fh Model 14h[173] (90nm Athlon64/Opteron) CPUs and is present in all later AMD CPUs - except the ones with the 'no_efer_lmsle' flag set. - ^ A value of 0 indicates that the "Guest Physical Address Size" is the same as the "Number Of Physical Address Bits", specified in EAX[7:0].
EAX=8000'000Ah: SVM features
This leaf returns information about AMD SVM (Secure Virtual Machine) features in EAX, EBX and EDX.
Bits | EAX | EBX | ECX | Bits | ||
---|---|---|---|---|---|---|
7:0 | SVM Revision Number | Number of available ASIDs (address space identifiers) |
(reserved) | 7:0 | ||
8 | (hypervisor)[a] | 8 | ||||
31:9 | (reserved) | 31:9 |
Bit | EDX | |
---|---|---|
Short | Feature | |
0 | NP | Rapid Virtualization Indexing (Nested Paging) |
1 | LbrVirt | LBR (Last Branch Records) virtualization |
2 | SVML | SVM-Lock |
3 | NRIPS | nRIP (next sequential instruction pointer) save on #VMEXIT supported |
4 | TscRateMsr | MSR-based TSC rate control (MSR C000_0104h )
|
5 | VmcbClean | VMCB (Virtual Machine Control Block) clean bits supported |
6 | FlushByAsid | TLB flush events (e.g. CR3 writes, CR4.PGE toggles) only flush the TLB entries of the current ASID (address space ID) |
7 | DecodeAssist | Decode assists supported |
8 | PmcVirt | PMC (Performance Monitoring Counters) virtualization |
9 | (SseIsa10Compat)[b] | (reserved) |
10 | PauseFilter | PAUSE intercept filter supported
|
11 | (reserved) | |
12 | PauseFilterThreshold | PAUSE filter cycle count threshold supported
|
13 | AVIC | AMD Advanced Virtualized Interrupt Controller supported |
14 | (reserved) | |
15 | VMSAVEvirt | VMSAVE and VMLOAD virtualization
|
16 | VGIF | Global Interrupt Flag (GIF) virtualization |
17 | GMET | Guest Mode Execution Trap |
18 | x2AVIC | x2APIC mode supported for AVIC |
19 | SSSCheck | SVM Supervisor shadow stack restrictions |
20 | SpecCtrl | SPEC_CTRL (MSR 2E0h ) virtualization
|
21 | ROGPT | Read-Only Guest Page Table supported |
22 | (reserved) | |
23 | HOST_MCE_OVERRIDE | Guest mode Machine-check exceptions when host CR4.MCE=1 and guest CR4.MCE=0 cause intercepts instead of shutdowns
|
24 | TlbiCtl | INVLPGB /TLBSYNC hypervisor enable in VMCB and TLBSYNC intercept support
|
25 | VNMI | NMI (Non-Maskable interrupt) virtualization |
26 | IbsVirt | IBS (Instruction-Based Sampling) virtualization |
27 | ExtLvtOffsetFaultChg | Read/Write fault behavior for extended LVT offsets (APIC addresses 0x500-0x530 ) changed to Read Allowed, Write #VMEXIT[181]
|
28 | VmcbAddrChkChg | VMCB address check change[181] |
29 | BusLockThreshold | Bus Lock Threshold |
30 | IdleHltIntercept | Idle HLT (HLT instruction executed while no virtual interrupt is pending) intercept
|
31 | EnhancedShutdownIntercept | Support for EXITINFO1 on shutdown intercept, and nested shutdown intercepts will result in a non-interceptible shutdown.[182] |
- ^ Early revisions of AMD's "Pacifica" documentation listed EAX bit 8 as an always-zero bit reserved for hypervisor use.[175]
Later AMD documentation, such as #25481 "CPUID specification" rev 2.18[176] and later, only lists the bit as reserved.
In rev 2.30[177] and later, a different bit is listed as reserved for hypervisor use: CPUID.(EAX=1):ECX[bit 31].
- ^ EDX bit 9 is briefly listed in some older revisions of AMD's document #25481 "CPUID Specification", and is set only in some AMD Bobcat CPUs.[178]
Rev 2.28 of #25481 lists the bit as "Ssse3Sse5Dis"[179] - in rev 2.34, it is listed as having been removed from the spec at rev 2.32 under the name "SseIsa10Compat".[180]
EAX=8000'001Fh: Encrypted Memory Capabilities
Bit | EAX | |
---|---|---|
Short | Feature | |
0 | SME | Secure Memory Encryption |
1 | SEV | Secure Encrypted Virtualization |
2 | PageFlushMSR | Page flush MSR (C001_011Eh ) supported
|
3 | SEV-ES | SEV Encrypted State |
4 | SEV-SNP | SEV Secure Nested Paging |
5 | VMPL | VM Privilege Levels |
6 | RMPQUERY | RMPQUERY instruction supported
|
7 | VmplSSS | VMPL Supervisor shadow stack supported |
8 | SecureTSC | Secure TSC supported |
9 | TscAuxVirtualization | Virtualization of TSC_AUX MSR (C000_0103 ) supported
|
10 | HwEnfCacheCoh | Hardware cache coherency across encryption domains enforced |
11 | 64BitHost | SEV Guest execution only allowed from 64-bit host |
12 | RestrictedInjection | SEV-ES guests can refuse all event-injections except #HV (Hypervisor Injection Exception) |
13 | AlternateInjection | SEV-ES guests can use an encrypted VMCB field for event-injection |
14 | DebugVirt | Full debug state virtualization supported for SEV-ES and SEV-SNP guests |
15 | PreventHostIBS | Prevent host IBS for a SEV-ES guest |
16 | VTE | Virtual Transparent Encryption for SEV |
17 | VmgexitParameter | VMGEXIT parameter is supported (using the RAX register)
|
18 | VirtualTomMsr | Virtual TOM (top-of-memory) MSR (C001_0135 ) supported
|
19 | IbsVirtGuestCtl | IBS virtualization is supported for SEV-ES and SEV-SNP guests |
20 | PmcVirtGuestCtl | PMC virtualization is supported for SEV-ES and SEV-SNP guests |
21 | RMPREAD | RMPREAD instruction supported
|
22 | GuestInterceptControl | Guest Intercept control supported for SEV-ES guests |
23 | SegmentedRmp | Segmented RMP (Reverse-Map Table) supported |
24 | VmsaRegProt | VMSA (VM Save Area) register protection supported |
25 | SmtProtection | SMT Protection supported |
26 | SecureAvic | Secure AVIC supported |
27 | AllowedSEVfeatures | ALLOWED_SEV_FEATURES_MASK field in VMCB (offset 138h ) supported
|
28 | SVSMCommPageMSR | SVSM (Secure VM Service Module[183]) communication page MSR (C001_F000h ) supported
|
29 | NestedVirtSnpMsr | VIRT_RMPUPDATE (C001_F001h ) and VIRT_PSMASH (C001_F002h ) MSRs supported
|
30 | HvInUseWrAllowed | Writes to Hypervisor-owned paged allowed when marked in-use |
31 | IbpbOnEntry | IBPB on entry to virtual machine supported |
Bits | EBX | ECX | EDX | Bits |
---|---|---|---|---|
5:0 | C-bit (encryption enable bit) location in page table entry | Maximum ASID value that can be used for a SEV-enabled guest (maximum number of encrypted guests that can be supported simultaneously) | Minimum ASID value for a guest that is SEV-enabled but not SEV-ES-enabled | 5:0 |
11:6 | Physical address width reduction when memory encryption is enabled | 11:6 | ||
15:12 | Number of VMPLs (VM Privilege Levels) supported | 15:12 | ||
31:16 | (reserved) | 31:16 |
EAX=8000'0021h: Extended Feature Identification
Bit | EAX | |
---|---|---|
Short | Feature | |
0 | NoNestedDataBp | Processor ignores nested data breakpoints |
1 | FsGsKernelGsBaseNonSerializing | WRMSR to the FS_BASE , GS_BASE and KernelGSBase MSRs is non-serializing[184]
|
2 | LFenceAlwaysSerializing | LFENCE is always dispatch serializing
|
3 | SmmPgCfgLock | SMM paging configuration lock supported |
4 | (reserved) | |
5 | (reserved) | |
6 | NullSelectClearsBase | Null segment selector loads also clear the destination segment register base and limit |
7 | UpperAddressIgnore | Upper Address Ignore is supported |
8 | AutomaticIBRS | Automatic IBRS |
9 | NoSmmCtlMSR | SMM_CTL MSR (C0010116h ) is not supported
|
10 | FSRS | Fast short REP STOSB supported
|
11 | FSRC | Fast short REPE CMPSB supported
|
12 | PMC2PreciseRetire | PreciseRetire performance counter control bit (MSR C0010002h bit 43) supported[182]
|
13 | PrefetchCtlMsr | PrefetchControl MSR (C0000108h ) is supported
|
14 | L2TlbSIzeX32 | If set, L2 TLB sizes (leaf 80000006h ) are encoded as multiples of 32
|
15 | AMD_ERMSB | Processor supports AMD implementation of Enhanced REP MOVSB and REP STOSB
|
16 | OPCODE_0F017_RECLAIM | Reserves opcode 0F 01 /7 for AMD use, returning #UD.[182]
|
17 | CpuidUserDis | CPUID disable for non-privileged software (#GP)
|
18 | EPSF | Enhanced Predictive Store Forwarding supported[184] |
19 | FAST_REP_SCASB | Fast Short REP SCASB supported
|
20 | PREFETCHI | Instruction Cache prefetch instructions supported |
21 | FP512_DOWNGRADE | Downgrade of 512-bit datapath to 256-bit supported.[a] |
22 | WL_CLASS_SUPPORT | Support for workload-based heuristic feedback to OS for scheduling decisions |
23 | (reserved) | |
24 | ERAPS | Enhanced Return Address Predictor Security (see also EBX[23:16] "RapSize") |
25 | (reserved) | |
26 | (reserved) | |
27 | SBPB | Selective Branch Predictor Barrier supported[186] |
28 | IBPB_BRTYPE | IBPB flushes all branch type predictions[186] |
29 | SRSO_NO | CPU is not subject to SRSO (Speculative Return Stack Overflow) vulnerability[186] |
30 | SRSO_USER_KERNEL_NO | CPU is not subject to SRSO vulnerability across user/kernel boundary[186] |
31 | SRSO_MSR_FIX | SRSO can be mitigated by setting bit 4 of BP_CFG (MSR C001_102E )[186]
|
Bit | EBX | |
---|---|---|
Short | Feature | |
15:0 | MicrocodePatchSize | The size of the Microcode patch in 16-byte multiples. If 0, the size of the patch is at most 5568 (15C0h) bytes |
23:16 | RapSize | Return Address Predictor Size. RapSize * 8 is the minimum number of CALL instructions without matching RET instructions that are needed to flush the Return Address Predictor.
|
31:24 | (reserved) |
EAX=8FFF'FFFFh: AMD Easter Egg
Several AMD CPU models will, for CPUID with EAX=8FFFFFFFh
, return an Easter Egg string in EAX, EBX, ECX and EDX.[187][188] Known Easter Egg strings include:
Processor | String |
---|---|
AMD K6 | NexGenerationAMD
|
AMD K8 | IT'S HAMMER TIME
|
AMD Jaguar[189] | HELLO KITTY! ^-^
|
EAX=C000'0000h: Highest Centaur Extended Function
Returns index of highest Centaur leaf in EAX. If the returned value in EAX is less than C0000001h
, then Centaur extended leaves are not supported.
Present in CPUs from VIA and Zhaoxin.
On IDT WinChip CPUs (CentaurHauls
Family 5), the extended leaves C0000001h-C0000005h
do not encode any Centaur-specific functionality but are instead aliases of leaves 80000001h-80000005h
.[190]
EAX=C000'0001h: Centaur Feature Information
This leaf returns Centaur feature information (mainly VIA PadLock) in EDX.[191][192] (EAX, EBX and ECX are reserved.)
Bit | EDX | |
---|---|---|
Short | Feature | |
0 | sm2[a] | SM2 present |
1 | sm2_en[a] | SM2 enabled |
2 | rng | PadLock RNG present: XSTORE and REP XSTORE instructions
|
3 | rng_en | RNG enabled |
4 | ccs[a] | PadLock SM3/SM4 instructions present: CCS_HASH and CCS_ENCRYPT
|
5 | ccs_en[a] | SM3/SM4 instructions enabled |
6 | xcrypt | PadLock Advanced Cryptographic Engine (ACE, using AES cipher) present: REP XCRYPT(ECB,CBC,CFB,OFB) instructions
|
7 | xcrypt_en | ACE enabled |
8 | ace2 | ACE v2 present: REP XCRYPTCTR instruction, as well as support for digest mode and misaligned data for ACE's REP XCRYPT* instructions.
|
9 | ace2_en | ACE v2 enabled |
10 | phe | PadLock Hash Engine (PHE): REP XSHA1 and REP XSHA256 instructions
|
11 | phe_en | PHE enabled |
12 | pmm | PadLock Montgomery Multiplier (PMM): REP MONTMUL instruction
|
13 | pmm_en | PMM enabled |
14 | (reserved) | |
15 | zx_fma | FMA supported |
16 | parallax | Adaptive P-state control present |
17 | parallax_en | Adaptive P-state control enabled |
18 | overstress | Overstress feature for auto overclock present |
19 | overstress_en | Overstress feature for auto overclock enabled |
20 | tm3 | Thermal Monitor 3 present |
21 | tm3_en | Thermal Monitor 3 enabled |
22 | rng2 | RNG v2: Second generation RNG present |
23 | rng2_en | RNG v2 enabled |
24 | sem | SME feature present |
25 | phe2 | PHE v2: SHA384 and SHA512 present |
26 | phe2_en | PHE v2 enabled |
27 | xmodx | RSA instructions present: XMODEXP and MONTMUL2
|
28 | xmodx_en | RSA instructions enabled |
29 | vex | VEX instructions present |
30 | vex_en | VEX instructions enabled |
31 | stk | STK is present |
CPUID usage from high-level languages
Inline assembly
This information is easy to access from other languages as well. For instance, the C code for gcc below prints the first five values, returned by the cpuid:
#include <stdio.h>
#include <cpuid.h>
int main()
{
unsigned int i, eax, ebx, ecx, edx;
for (i = 0; i < 5; i++) {
__cpuid(i, eax, ebx, ecx, edx);
printf ("InfoType %x\nEAX: %x\nEBX: %x\nECX: %x\nEDX: %x\n", i, eax, ebx, ecx, edx);
}
return 0;
}
In MSVC and Borland/Embarcadero C compilers (bcc32) flavored inline assembly, the clobbering information is implicit in the instructions:
#include <stdio.h>
int main()
{
unsigned int a, b, c, d, i = 0;
__asm {
/* Do the call. */
mov EAX, i;
cpuid;
/* Save results. */
mov a, EAX;
mov b, EBX;
mov c, ECX;
mov d, EDX;
}
printf ("InfoType %x\nEAX: %x\nEBX: %x\nECX: %x\nEDX: %x\n", i, a, b, c, d);
return 0;
}
If either version was written in plain assembly language, the programmer must manually save the results of EAX, EBX, ECX, and EDX elsewhere if they want to keep using the values.
Wrapper functions
GCC also provides a header called <cpuid.h>
on systems that have CPUID. The __cpuid
is a macro expanding to inline assembly. Typical usage would be:
#include <stdio.h>
#include <cpuid.h>
int main()
{
unsigned int eax, ebx, ecx, edx;
__cpuid(0 /* vendor string */, eax, ebx, ecx, edx);
printf("EAX: %x\nEBX: %x\nECX: %x\nEDX: %x\n", eax, ebx, ecx, edx);
return 0;
}
But if one requested an extended feature not present on this CPU, they would not notice and might get random, unexpected results. Safer version is also provided in <cpuid.h>
. It checks for extended features and does some more safety checks. The output values are not passed using reference-like macro parameters, but more conventional pointers.
#include <stdio.h>
#include <cpuid.h>
int main()
{
unsigned int eax, ebx, ecx, edx;
/* 0x81234567 is nonexistent, but assume it exists */
if (!__get_cpuid (0x81234567, &eax, &ebx, &ecx, &edx)) {
printf("Warning: CPUID request 0x81234567 not valid!\n");
return 1;
}
printf("EAX: %x\nEBX: %x\nECX: %x\nEDX: %x\n", eax, ebx, ecx, edx);
return 0;
}
Notice the ampersands in &a, &b, &c, &d
and the conditional statement. If the __get_cpuid
call receives a correct request, it will return a non-zero value, if it fails, zero.[194]
Microsoft Visual C compiler has builtin function __cpuid()
so the cpuid instruction may be embedded without using inline assembly, which is handy since the x86-64 version of MSVC does not allow inline assembly at all. The same program for MSVC would be:
#include <stdio.h>
#ifdef __MSVC__
#include <intrin.h>
#endif
int main()
{
unsigned int regs[4];
int i;
for (i = 0; i < 4; i++) {
__cpuid(regs, i);
printf("The code %d gives %d, %d, %d, %d", regs[0], regs[1], regs[2], regs[3]);
}
return 0;
}
Many interpreted or compiled scripting languages are capable of using CPUID via an FFI library. One such implementation shows usage of the Ruby FFI module to execute assembly language that includes the CPUID opcode.
.NET 5 and later versions provide the System.Runtime.Intrinsics.X86.X86base.CpuId
method. For instance, the C# code below prints the processor brand if it supports CPUID instruction:
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using System.Text;
namespace X86CPUID {
class CPUBrandString {
public static void Main(string[] args) {
if (!X86Base.IsSupported) {
Console.WriteLine("Your CPU does not support CPUID instruction.");
} else {
Span<int> raw = stackalloc int[12];
(raw[0], raw[1], raw[2], raw[3]) = X86Base.CpuId(unchecked((int)0x80000002), 0);
(raw[4], raw[5], raw[6], raw[7]) = X86Base.CpuId(unchecked((int)0x80000003), 0);
(raw[8], raw[9], raw[10], raw[11]) = X86Base.CpuId(unchecked((int)0x80000004), 0);
Span<byte> bytes = MemoryMarshal.AsBytes(raw);
string brand = Encoding.UTF8.GetString(bytes).Trim();
Console.WriteLine(brand);
}
}
}
}
CPU-specific information outside x86
Some of the non-x86 CPU architectures also provide certain forms of structured information about the processor's abilities, commonly as a set of special registers:
- ARM architectures have a
CPUID
coprocessor register which requires exception level EL1 or above to access.[195] - The IBM System z mainframe processors have a Store CPU ID (
STIDP
) instruction since the 1983 IBM 4381[196] for querying the processor ID.[197] - The IBM System z mainframe processors also have a Store Facilities List Extended (
STFLE
) instruction which lists the installed hardware features.[197] - The MIPS32/64 architecture defines a mandatory Processor Identification (
PrId
) and a series of daisy-chained Configuration Registers.[198] - The PowerPC processor has the 32-bit read-only Processor Version Register (
PVR
) identifying the processor model in use. The instruction requires supervisor access level.[199]
DSP and transputer-like chip families have not taken up the instruction in any noticeable way, in spite of having (in relative terms) as many variations in design. Alternate ways of silicon identification might be present; for example, DSPs from Texas Instruments contain a memory-based register set for each functional unit that starts with identifiers determining the unit type and model, its ASIC design revision and features selected at the design phase, and continues with unit-specific control and data registers. Access to these areas is performed by simply using the existing load and store instructions; thus, for such devices, there is no need for extending the register set for device identification purposes.[citation needed]
See also
- x86-cpuid.org, a complete x86 architecture CPUID database plus related code generation tools, to be used by both the Linux Kernel and the Xen hypervisor. [200]
- CPU-Z, a Windows utility that uses
CPUID
to identify various system settings - CPU-X, an alternative of CPU-Z for Linux and FreeBSD
- Spectre (security vulnerability)
- Speculative Store Bypass (SSB)
- /proc/cpuinfo, a text file generated by certain systems containing some of the CPUID information
References
- ^ "Intel 64 and IA-32 Architectures Software Developer's Manual" (PDF). Intel.com. Retrieved 2013-04-11.
- ^ "Detecting Intel Processors - Knowing the generation of a system CPU". Rcollins.org. Retrieved 2013-04-11.
- ^ "LXR linux-old/arch/i386/kernel/head.S". Lxr.linux.no. Archived from the original on 2012-07-13. Retrieved 2013-04-11.
- ^ a b c Debbie Wiles, CPU Identification, archived on 2006-06-04
- ^ B-CoolWare, TMi0SDGL x86 CPU/FPU detection library with source code, v2.15, June 2000 - see /SOURCE/REALCODE.ASM for a large collection of pre-CPUID x86 CPU detection routines. Archived on 14 Mar 2023.
- ^ "CPUID, EAX=4 - Strange results (Solved)". Software.intel.com. Retrieved 2014-07-10.
- ^ @InstLatX64 (February 28, 2019). "First encounter with "GenuineIotel" (o after I, instead of n)" (Tweet) – via Twitter.
- ^ "GenuineIotel CPUID dump for Intel Xeon E3-1231". instlatx64.
- ^ instlatx64, CPUID dump for RDC IAD 100. Retrieved 22 December 2022.
- ^ a b c d smxi, Inxi issue 197: Elbrus CPU support data and implementation. Retrieved 23 October 2023. Archived on 23 October 2023.
- ^ Grzegorz Mazur, Identification of x86 CPUs with CPUID support, 5 May 1997. Archived from the original on 24 May 1997.
- ^ Ingo Böttcher, CPUDET.PAS v1.61, 23 Oct 1996 - CPU identification program that tests for "AMD ISBETTER" string. Archived on 26 Apr 2024.
- ^ sorgelig (Aug 3, 2017). "ao486 CPUID instruction (in commit 43a2004)". GitHub. Archived from the original on 2023-12-04. Retrieved 2023-12-04.
- ^ a b sorgelig (Aug 30, 2020). "Update cpuid. · MiSTer-devel/ao486_MiSTer@82f5014". GitHub. Archived from the original on 2023-12-04. Retrieved 2023-12-04.
- ^ sorgelig (Aug 30, 2020). "ao486 CPUID instruction". GitHub. Archived from the original on October 23, 2023. Retrieved 4 Dec 2023.
- ^ "v586: 586 compatible soft core for FPGA". GitHub. 6 December 2021.
- ^ "Steam Hardware & Software Survey". store.steampowered.com. Retrieved 2022-07-26.
- ^ "Fun with Timers and cpuid - by Jim Cownie - CPU fun". 3 March 2021.
- ^ virt-what source tree, tests/lx86/proc/cpuinfo - PowerVM Lx86 cpuinfo dump. Archived on 10 Nov 2024.
- ^ Neko Project 21/W, help/configure (in Japanese). Archived on 22 Sep 2024.
- ^ CPU-World, CPUID for emulated Neko Project CPU with "Neko Project" string. Archived on 21 Dec 2024.
- ^ iXBT Labs, VIA Nano CPUID Tricks, Aug 26, 2010. Archived on Aug 29, 2010.
- ^ IDT, WinChip 2A data sheet, v1.0, Jan 1999, page A-3.
- ^ VIA, C3 Nehemiah Datasheet, rev 1.13, Sep 29, 2004, page A-3.
- ^ Agner Fog, CpuIDFake, v1.00, Jan 22, 2010, see "Instructions.txt". Archived on Jul 9, 2010.
- ^ a b Transmeta, Crusoe BIOS Programmer's Guide, Jan 23, 2004, pages 63-65.
- ^ Transmeta, Efficeon BIOS Programmers Guide, Aug 19, 2003, section 8.3, page 148.
- ^ AMD, Geode LX Data Book, pub.id. 33234H, Feb. 2009, page 107. Archived on Dec 3, 2023.
- ^ DM&P, Vortex86EX2_A9133_Master_Data_Sheet_V11_BF, May 8, 2019, page 72.
- ^ "Chapter 3 Instruction Set Reference, A-L" (PDF). Intel 64 and IA-32 Architectures Software Developer's Manual. Intel Corporation. 2018-12-20. Retrieved 2018-12-20.
- ^ Intel, Pentium Processor Family Developer's Manual, 1997, order no. 241428-005, sections 3.4.1.2 (page 91), 17.5.1 (page 489) and appendix A (page 522) provide more detail on how the "processor type" field and the "dual processor" designation work.
- ^ InstLatx64, x86, x64 Instruction Latency, Memory Latency and CPUID dumps, 30 Sep 2023.
- ^ AMD, Enhanced Am486DX Microprocessor Family, pub.no. 20736 rev B, March 1997, section 9.2.2, page 55. Archived on 18 Oct 2023.
- ^ AMD, ÉlanSC400 and ÉlanSC410 Microcontrollers User's Manual, pub.no. 21030, 1997, section 3.6.2, page 73. Archived on 18 Oct 2023.
- ^ Cyrix, 5x86 BIOS Writers Guide, rev 1.12, order no. 92426-00, 1995, page 7
- ^ a b Cyrix, CPU Detection Guide, rev 1.01, 2 Oct 1997, page 6.
- ^ MiSTer ao486 source code, rtl/ao486/defines.v, line 70. Archived on 23 Oct 2023.
- ^ CPU-World, CPUID for Vortex86DX2 933 MHz. Archived on 17 Oct 2023.
- ^ CPU-World, CPUID for Vortex86EX2. Archived on 18 Oct 2023.
- ^ InstLatx64, Centaur CNS CPUID dump. Archived on 30 May 2023.
- ^ Jeff Atwood, Nasty Software Hacks and Intel's CPUID. Coding Horror, 16 Aug 2005.
- ^ a b Intel, Intel Xeon Phi Coprocessor Instruction Set Architecture Reference Manual, sep 2012, order no. 327364-001, appendix B.8, pages 673-674. Archived on 4 Aug 2021.
- ^ CPU-World, CPUID for Intel Itanium 2 1.50 GHz. Archived on 17 Oct 2023.
- ^ "[PATCH] x86/cpu: Add two Intel CPU model numbers - Tony Luck". lore.kernel.org. Retrieved 2024-09-24.
- ^ InstLatX64, 72-Core Intel Xeon Phi 7290 CPUID dump
- ^ InstLatx64, 96-Core AMD Ryzen Threadripper Pro 7995WX CPUID dump
- ^ Intel Processor Identification and the CPUID Instruction (PDF), Intel, May 2002, archived from the original (PDF) on 2021-04-17
- ^ Linux 6.3 kernel sources, /arch/x86/include/asm/cpuid.h, line 69
- ^ gcc-patches mailing list, CPUID Patch for IDT Winchip, May 21, 2019
- ^ Geoff Chappell, CMPXCHG8B Support in the 32-Bit Windows Kernel, Jan 23, 2008. Archived on Jan 30, 2023.
- ^ AMD, AMD Processor Recognition Application Note, publication #20734, rev D, Jan 1997, page 13
- ^ Intel, AP-485 Application Note - Intel Processor Identification and the CPUID Instruction, order no. 241618-006, march 1997, table 5 on page 10, see bit 10.
- ^ Michal Necasek, SYSENTER, Where Are You?, OS/2 Museum, July 20, 2017
- ^ Intel, TDX module source code, v1.0.03.03, 22 Jun 2023, see src/common/helpers/smrrs.h. Archived on 20 Jan 2025.
- ^ Intel, Trust Domain CPU Architectural Extensions, order no. 343754-002, may 2021. Archived on 17 Dec 2024.
- ^ Intel, Pentium 4 Processor on 90 nm Process Specification Update, order no. 302352-031, sep 2006, see erratum R85 on page 59. Archived on 31 Dec 2008.
- ^ Geoff Chappell, ECX From CPUID Leaf 1, Jan 26, 2020. Archived on May 9, 2020.
- ^ Huggahalli, Ram; Iyer, Ravi; Tetrick, Scott (2005). "Direct Cache Access for High Bandwidth Network I/O". ACM SIGARCH Computer Architecture News. 33 (2): 50–59. CiteSeerX 10.1.1.85.3862. doi:10.1145/1080695.1069976. CiteSeerX:10.1.1.91.957.
- ^ Drepper, Ulrich (2007), What Every Programmer Should Know About Memory, CiteSeerX:10.1.1.91.957
- ^ a b Intel, Itanium Architecture Software Developer's Manual, rev 2.3, volume 4: IA-32 Instruction Set, may 2010, document number: 323208, table 2-5, page 4:81, see bits 20 and 30. Archived on Feb 15, 2012.
- ^ Intel, AP-485, Processor Identification and the CPUID Instruction flag, rev 30, jan 2006, page 26
- ^ Michal Necasek, HTT Means Hyper-Threading, Right?, OS/2 Museum, dec 11, 2017
- ^ "Mechanisms to determine if software is running in a VMware virtual machine". VMware Knowledge Base. VMWare. 2015-05-01.
Intel and AMD CPUs have reserved bit 31 of ECX of CPUID leaf 0x1 as the hypervisor present bit. This bit allows hypervisors to indicate their presence to the guest operating system. Hypervisors set this bit and physical CPUs (all existing and future CPUs) set this bit to zero. Guest operating systems can test bit 31 to detect if they are running inside a virtual machine.
- ^ Kataria, Alok; Hecht, Dan (2008-10-01). "Hypervisor CPUID Interface Proposal". LKML Archive on lore.kernel.org. Archived from the original on 2019-03-15.
Bit 31 of ECX of CPUID leaf 0x1. This bit has been reserved by Intel & AMD for use by hypervisors and indicates the presence of a hypervisor. Virtual CPU's (hypervisors) set this bit to 1 and physical CPU's (all existing and future CPU's) set this bit to zero. This bit can be probed by the guest software to detect whether they are running inside a virtual machine.
- ^ "AMD64 Technology AMD64 Architecture Programmer's Manual Volume 2: System Programming" (PDF) (3.41 ed.). Advanced Micro Devices, Inc. p. 498. 24593. Archived from the original (PDF) on 30 Sep 2023. Retrieved 9 September 2023.
15.2.2 Guest Mode This new processor mode is entered through the VMRUN instruction. When in guest mode, the behavior of some x86 instructions changes to facilitate virtualization. The CPUID function numbers 4000_0000h-4000_00FFh have been reserved for software use. Hypervisors can use these function numbers to provide an interface to pass information from the hypervisor to the guest. This is similar to extracting information about a physical CPU by using CPUID. Hypervisors use the CPUID Fn 400000[FF:00] bit to denote a virtual platform. Feature bit CPUID Fn0000_0001_ECX[31] has been reserved for use by hypervisors to indicate the presence of a hypervisor. Hypervisors set this bit to 1 and physical CPU's set this bit to zero. This bit can be probed by the guest software to detect whether they are running inside a virtual machine.
- ^ Intel SDM vol 2A, order no. 253666-053, Jan 2015, p. 244
- ^ a b Intel, Processor Identification and the CPUID Instruction Application Note 485, order no. 241618-037, Jan 2011, pages 31-32. Archived on 17 Oct 2023.
- ^ Intel, Itanium Processor Reference Manual for Software Development, rev 2.0, order no. 245320-003, December 2001, page 110. Archived from the original on 18 Feb 2004.
- ^ a b Intel, Processor Identification and the CPUID Instruction Application Note 485, order no. 241618-036, Aug 2009, page 26. Archived on 6 Oct 2023.
- ^ InstLatX64, Willamette-128 CPUID dump. Archived on 7 Dec 2019.
- ^ InstLatX64, Northwood-128 CPUID dump. Archived on 7 Dec 2019.
- ^ InstLatX64, Prescott-256 CPUID dump. Archived on 6 Dec 2019.
- ^ InstLatX64, Intel Tolapai CPUID dump. Archived on 19 Jan 2019.
- ^ Jason Gaston, (PATCH 2.6.24-rc5) x86 intel_cacheinfo.c: cpu cache info entry for Intel Tolapai, LKML, 20 Dec 2007. Archived on 9 Nov 2024.
- ^ VIA-Cyrix, Application Note 120: Cyrix III CPU BIOS Writer's Guide, rev 1.1, 24 Nov 1999, page 13. Archived from the original on 29 Sep 2000.
- ^ InstlatX64, Intel Atom 230 CPUID dump. Archived on 7 Dec 2019.
- ^ WikiChip, Bonnell. Archived on 16 Jul 2017.
- ^ Cyrix, Cyrix CPU Detection Guide, rev 1.01, 2 Oct 1997, page 13.
- ^ CPU-World forum, Working Timna desktop 2023, page 2 - lists a CPUID dump from a Timna engineering sample. Archived on 9 Nov 2024.
- ^ Geoff Chappell, CPUID Leaf 2, 26 Jan 2020. Archived on Sep 4, 2023.
- ^ Intel, Itanium 2 Processor Reference Manual, order no. 251110-003, May 2004, page 192. Archived from the original on 7 Dec 2006.
- ^ Intel, Itanium 2 Processor Specification Update, order.no. 251141-028, Nov 2004, erratum 6 on page 26. Archived from the original on 25 Nov 2004.
- ^ Intel, Atom C3000 Processor Product Family Specification Update, order no. 336345-020, page 16, Mar 2023. Archived on 7 Oct 2023.
- ^ Intel, 6th Generation Intel Processor Specification Update, order no. 332689-030, July 2023, see erratum SKL148 on page 66. Archived from the original on 8 mar 2023.
- ^ Intel, 10th Generation Intel Core Processor Specification Update, order no. 615213-013, apr 2023, see erratum CML081 on page 41. Archived on 19 Jul 2024.
- ^ Intel, Xeon Processor 7500 Series Datasheet, order no. 323341-001, March 2010, page 150. Archived on Oct 8, 2023.
- ^ Intel, Optimization Reference Manual, volume 1, order no. 248966-049, jan 2024, chapter 9.6.3.3, p. 361. Archived on 19 Apr 2024.
- ^ Intel, Processor Identification and the CPUID Instruction, order no. 241618-031, sep 2006, page 32.
- ^ a b Shih Kuo (Jan 27, 2012). "Intel 64 Architecture Processor Topology Enumeration".
- ^ "Processor and Core Enumeration Using CPUID | AMD". Developer.amd.com. Archived from the original on 2014-07-14. Retrieved 2014-07-10.
- ^ "Sandybridge processors report incorrect core number?". Software.intel.com. 2012-12-29. Retrieved 2014-07-10.
- ^ "cpuid, __cpuidex". Msdn.microsoft.com. 2014-06-20. Retrieved 2014-07-10.
- ^ "x86 architecture - CPUID". sandpile.org. Retrieved 2014-07-10.
- ^ "topology.cpp in ps/trunk/source/lib/sysdep/arch/x86_x64 – Wildfire Games". Trac.wildfiregames.com. 2011-12-27. Archived from the original on 2021-03-09. Retrieved 2014-07-10.
- ^ Hyper-Threading Technology and Multi-Core Processor Detection
- ^ Intel, Architecture Instruction Set Extensions Programming Reference, order no. 319433-052, March 2024, chapter 17. Archived on Apr 7, 2024.
- ^ Intel, Intel Processor Identification and the CPUID Instruction (AP-485, rev 30), order no. 241618-030, Jan 2006, page 19.
- ^ Intel, Intel 64 and IA-32 Architecture Software Developer's Manual, order no. 352462-079, volume 3B, section 15.4.4.4, page 3503
- ^ Intel, Processor Identification and the CPUID Instruction, order no. 241618-038, apr 2012, p.38
- ^ Intel, Product Change Notification 108701, 1 aug 2008. Archived on May 11, 2023
- ^ a b "Performance Monitoring Impact of Intel Transactional Synchronization Extension Memory Ordering Issue" (PDF). Intel. June 2023. p. 8. Retrieved 8 May 2024.
- ^ a b c Intel, Architecture Specification: Intel Trust Domain Extensions (Intel TDX) Module, order no. 344425-001, sep 2020, pages 120-122. Archived from the original on Jul 29, 2021.
- ^ Intel, Deprecating the PCOMMIT instruction, sep 12, 2016. Archived on Apr 23, 2023.
- ^ Intel, AVX512-FP16 Architecture Specification (PDF), document number 347407-001, June 2021. Archived on Oct 26, 2022
- ^ a b c d "Speculative Execution Side Channel Mitigations" (PDF). Revision 2.0. Intel. May 2018 [January 2018]. Document Number: 336996-002. Retrieved 2018-05-26.
- ^ "IBRS patch series [LWN.net]".
- ^ Intel, X86S External Architecture Specification v1.2, June 2024, order no. 351407-002, section 3.5, page 13. Archived from the original on 2 Oct 2024.
- ^ Intel, Envisioning a Simplified Intel Architecture - as of 20 Dec 2024, contains a mention that Intel has chosen not to pursue X86S. Archived on 20 Dec 2024.
- ^ a b c Intel, Flexible Return and Event Delivery (FRED) Specification, rev 6.1, December 2023, order no. 346446-007, page 14. Archived on Dec 22, 2023.
- ^ Intel, Software Developer's Manual, order no. 325462-080, June 2023 - information about prematurely busy shadow stacks provided in Volume 1, section 17.2.3 on page 410; Volume 2A, table 3.8 (CPUID EAX=7,ECX=2) on page 820; Volume 3C, table 25-14 on page 3958 and section 26.4.3 on page 3984.
- ^ LKML, Re: (PATCH v3 00/21) Enable CET Virtualization, Jun 16, 2023 - provides additional discussion of how the CET-SSS prematurely-busy stack issue interacts with virtualization.
- ^ a b Intel, Advanced Vector Extensions 10, rev 1.0, July 2023, order no. 355989-001. Archived on Jul 24, 2023.
- ^ a b Intel, Advanced Performance Extensions - Architecture Specification, rev 2.0, Aug 2023, order no. 355828-002, page 37. Archived on Sep 10, 2023.
- ^ Intel, Fast Store Forwarding Predictor, 8 Feb 2022. Archived on 6 Apr 2024.
- ^ a b c Intel, Branch History Injection and Intra-mode Branch Target Injection / CVE-2022-0001, CVE-2022-0002 / INTEL-SA-00598, 4 Aug 2022. Archived on 5 May 2023.
- ^ Intel, Return Stack Buffer Underflow / CVE-2022-29901, CVE-2022-28693 / INTEL-SA-00702, 12 Jul 2022. Archived on 13 Jul 2022.
- ^ Intel, Data Dependent Prefetcher, 10 Nov 2022. Archived on 4 Aug 2024.
- ^ Intel, MONITOR and UMONITOR Performance Guidance, 10 Jul 2024. Archived on 27 Nov 2024.
- ^ Intel, Asynchronous Enclave Exit Notify and the EDECCSSA User Leaf Function, 30 Jun 2022. Archived on 21 Nov 2022.
- ^ Linux kernel git commit 604dc91, x86/tsc: Use CPUID.0x16 to calculate missing crystal frequency, 9 May 2019 - contains notes on computing the Core Crystal Clock frequency on CPUs that don't specify it, and corresponding C code.
- ^ Intel, SDM Volume 3A, order no 253668-083, March 2024, chapter 11.5.4, page 408
- ^ instlatx64, Spreadtrum SC9853I-IA CPUID dump
- ^ Intel, Architecture Specification: Intel Trust Domain Extensions (Intel TDX) Module, order no. 344425-005, page 93, Feb 2023. Archived on 20 Jul 2023.
- ^ a b Intel, Intel Xeon Phi Coprocessor Instruction Set Architecture Reference Manual, Sep 2012, order no. 327364-001, appendix B.8, pages 677. Archived on 4 Aug 2021.
- ^ a b Microsoft, Hyper-V Feature and Interface Discovery, 8 Jul 2022. Archived on 18 Nov 2023.
- ^ Geoff Chappell, HV_HYPERVISOR_INTERFACE, 10 Dec 2022. Archived on 1 Feb 2023.
- ^ QEMU documentation, Hyper-V Enlightenments. Archived on 17 Apr 2024.
- ^ Linux 6.8.7 kernel source, /source/arch/x86/kvm/cpuid.c, lines 1482-1488
- ^ Linux kernel documentation, KVM CPUID bits. Archived on 22 Aug 2022.
- ^ Linux 6.8.7 kernel source, /arch/x86/kvm/hyperv.c, line 2793
- ^ Linux kernel documentation, Virtualization support: 4.118 KVM_GET_SUPPORTED_HV_CPUID. Archived on 26 Mar 2024.
- ^ FreeBSD commit 560d5ed, 28 Jun 2013, see file /sys/amd64/vmm/x86.c, line 48. Archived on 22 Apr 2024.
- ^ HyperKit source code, /src/lib/vmm/x86.c line 42, 8 May 2021.
- ^ Xen, CPUID Interface to Xen. Archived on 22 Apr 2024.
- ^ QEMU source code, fb/target/i386/cpu.c, line 6475, 18 Mar 2024.
- ^ VMWare, Mechanisms to determine if software is running in a VMware virtual machine, 1 May 2015. Archived on 18 Jun 2023.
- ^ Project ACRN, CPUID Virtualization, 20 Oct 2022. Archived on 25 Mar 2023.
- ^ VirtualBox documentation, 9.30 Paravirtualized Debugging. Archived on 22 Apr 2024.
- ^ QNX, Hypervisor - Checking the guest's environment, 25 Mar 2022. Archived on 22 Apr 2024.
- ^ NetBSD source code, /sys/dev/nvmm/x86/nvmm_x86_vmx.c, line 1430, 6 Nov 2023.
- ^ OpenBSD source code, /sys/arch/amd64/include/vmmvar.h, line 24, 9 Apr 2024.
- ^ Siemens Jailhouse hypervisor documentation, hypervisor-interfaces.txt, line 39, 27 Jan 2020. Archived on Jul 5, 2024.
- ^ Intel HAXM source code, /core/cpuid.c, line 979, 20 Jan 2023. Archived on 22 Apr 2024.
- ^ Intel KGT source code (trusty branch), /vmm/vmexit/vmexit_cpuid.c, lines 17-75, 15 May 2019
- ^ Linux kernel v5.18.19 source code, /source/drivers/visorbus/visorchipset.c, line 28
- ^ N. Moore, virt: Support detection of LMHS SRE guests #25594, 1 Dec 2022 - Lockheed Martin-provided pull-request for systemd, adding CPUID hypervisor ID string for the LMHS SRE hypervisor. Archived on 23 Apr 2024.
- ^ CPUID Specification, publication no.25481, rev 2.34 (PDF), AMD, September 2010, archived from the original (PDF) on 18 Aug 2022
- ^ Linux kernel source code
- ^ AMD, AMD-K6 Processor Data Sheet, order no. 20695H/0, march 1998, section 24.2, page 283
- ^ AMD, AMD-K6 Processor Revision Guide, order no. 21846H/0, June 1999, section 3.2.1, page 17
- ^ Intel, Intel 64 and IA-32 Architectures Software Developer's Manual, order no. 325462-079, march 2023, table 3-8 on page 3-238
- ^ Lightweight Profiling Specification (PDF), AMD, August 2010, archived from the original (PDF) on 2012-11-27, retrieved 2013-04-03
- ^ Cyrix, Cyrix CPU Detection Guide, rev 1.01, oct 2, 1997, page 12
- ^ AMD, Geode GX1 Processor Data Book, rev 5.0, december 2003, pages 202 and 226. Archived on 20 Apr 2020.
- ^ Transmeta, Processor Recognition, 2002-05-07, page 5
- ^ a b AMD, Processor Recognition Application Note, pub.no. 20734, rev. 3.13, december 2005. Section 2.2.2 (p.20) and Section 3 (pages 33 to 40) provide details on how CPUID.(EAX=8000_0001):EDX[bit 19] should be used to identify processors. Section 3 also provides information on AMD's brand name string MSRs. Archived from the original on Jun 26, 2006.
- ^ AMD, Family 10h BKDG, document no. 31116, rev 3.62, jan 11, 2013, p. 388 - lists the NodeId bit. Archived on 16 Jan 2019.
- ^ AMD, AMD64 Architecture Programmer's Manual Volume 3, pub. no. 24594, rev 3.20, may 2013, page 579 - lists the StreamPerfMon bit
- ^ "Intel Processor Identification and the CPUID Instruction" (PDF). Download.intel.com. 2012-03-06. Retrieved 2013-04-11.
- ^ InstLatx64, Vortex86DX3 CPUID dump, 27 Sep 2021. Archived on 21 Oct 2021.
- ^ InstLatx64, AMD Ryzen 7 6800HS CPUID dump, 21 Feb 2022. Archived on 24 Mar 2023.
- ^ Chips and Cheese, Why you can't trust CPUID, 27 Oct 2022. Archived on 3 Nov 2022.
- ^ AMD, Geode LX Databook, pub.id. 33234H, Feb 2009, page 207.
- ^ InstLatx64, 2x 24-core Montage Jintide C2460 CPUID dump
- ^ InstLatx64, 2x 24-core Intel Xeon Platinum 8160 CPUID dump
- ^ InstLatx64, Zhaoxin KaiXian ZX-C+ C4580 CPUID dump
- ^ InstLatx64, VIA Eden X4 C4250 CPUID dump
- ^ Cyrix, Application Note 112: Cyrix CPU Detection Guide, page 17, 21 July 1998.
- ^ Instlatx64, VIA Cyrix III "Samuel" CPUID dump
- ^ AMD, BKDG for AMD Family 10h Processors, pub.no. 31116, rev 3.62, jan 11, 2013, page 392. Archived on 16 Jan 2019.
- ^ a b c d AMD, PPR For AMD Family 19h Model 61h rev B1 procesors, pub.no. 56713, rev 3.05, Mar 8, 2023, pages 99-100. Archived on 25 Apr 2023.
- ^ AMD, BKDG for AMD Family 16h Models 00-0Fh processors, pub.no. 48571, rev 3.03, Feb 19, 2015, page 482. Archived on 16 Jan 2019.
- ^ AMD, BIOS and Kernel Developer's Guide for AMD Athlon 64 and AMD Opteron Processors, publication #26094, rev 3.30, feb 2006, pages 29-30 (lists Athlon 64 revision differences, including LMSLE) (archived on 16 Jan 2019), and Revision Guide for AMD Athlon 64 and AMD Opteron Processors, publication #25759, rev 3.79, july 2009, pages 7-8 (lists Athlon 64 revision IDs) (archived on 18 Jan 2019).
- ^ AMD, PPR for AMD Family 19h Model 01h, Revision B1 Processors, Volume 1 of 2, document no. 55898, rev 0.50, may 27, 2021, page 98 - lists branch-sampling bit. Archived on Jul 24, 2022
- ^ AMD, AMD64 Virtualization Codenamed "Pacifica" Technology, publication no. 33047, rev 3.01, May 2005, appendix B, page 81. Archived on Jun 13, 2011.
- ^ AMD, CPUID specification, publication #25481, revision 2.18, jan 2006, page 18.
- ^ AMD, CPUID specification, publication #25481, revision 2.34, sep 2010, pages 5 and 11.
- ^ Instlatx64, AMD E-350 CPUID dump - has CPUID.(EAX=8000000A):EDX[9] set.
- ^ AMD, CPUID specification, publication #25481, revision 2.28, apr 2008, page 21.
- ^ AMD, CPUID specification, publication #25481, revision 2.34, sep 2010, page 5 - lists "SseIsa10Compat" as having been dropped in November 2009.
- ^ a b AMD, PPR for AMD Family 19h Model 61h, Revision B1 processors, document no. 56713, rev 3.05, mar 8 2023, page 102. Archived on Apr 25, 2023.
- ^ a b c AMD, Processor Programming Reference (PPR) for AMD Family 1Ah Model 24h, Revision B0 Processors, order no. 57254, rev 3.00, Sep 26, 2024, pages 102, 118, 119 and 199.
- ^ AMD, Secure VM Service Module for SEV-SNP Guests, pub.no #58019, rev 1.00, Jul 2023, page 13. Archived on 5 Aug 2023.
- ^ a b AMD, PPR for AMD Family 19h Model 61h, Revision B1 processors, document no. 56713, rev 3.05, mar 8 2023, page 116. Archived on Apr 25, 2023.
- ^ AMD, 5th Gen AMD EPYC Processor Architecture, First Edition, October 2024, page 9.
- ^ a b c d e AMD, Technical Update Regarding Speculative Return Stack Overflow, rev 2.0, feb 2024. Archived on Apr 12, 2024.
- ^ Ferrie, Peter. "Attacks on Virtual Machine Emulators" (PDF). Symantec. Symantec Advanced Threat Research. Archived from the original (PDF) on 2007-02-07. Retrieved 15 March 2017.
- ^ Sandpile, x86 architecture CPUID. Retrieved 22 December 2022.
- ^ instlatx64, CPUID dump of AMD A4-5000, lists "HELLO KITTY" string for CPUID leaf
8FFFFFFFh
. Retrieved 22 December 2022. - ^ IDT, WinChip 2B Processor Data Sheet, v0.9, April 1999, chapter 3.3.3, page 31.
- ^ VIA, PadLock Programming Guide rev. 1.66, aug 4, 2005, page 5. Archived from the original on May 26, 2010
- ^ OpenEuler 1.0 LTS kernel sources, /arch/x86/include/asm/cpufeatures.h lines 147-178. Archived on Jul 30, 2023.
- ^ VIA, C3 Nehemiah Processor Datasheet, rev 1.13, Sep 29, 2004, page 21
- ^ "GCC-mirror/GCC". GitHub. 13 March 2022.
- ^ "ARM Information Center". Infocenter.arm.com. Retrieved 2013-04-11.
- ^ "Processor version codes and SRM constants". Archived from the original on 2014-09-08. Retrieved 2014-09-08.
- ^ a b "IBM System z10 Enterprise Class Technical Guide" (PDF).
- ^ "MIPS32 Architecture For Programmers, Volume III: The MIPS32 Privileged Resource Architecture" (PDF). MIPS Technologies, Inc. 2001-03-12.
- ^ "PowerPC Operating Environment Architecture, book III" (PDF).
- ^ S. Darwish, Ahmed. "[ANNOUNCE] x86-cpuid.org: A machine-readable CPUID repository". Linux Kernel Mailing List archive. Retrieved 20 July 2024.
Further reading
- "AMD64 Technology Indirect Branch Control Extension" (PDF) (White paper). Revision 4.10.18. Advanced Micro Devices, Inc. (AMD). 2018. Archived (PDF) from the original on 2018-05-09. Retrieved 2018-05-09.
External links
- Intel Processor Identification and the CPUID Instruction (Application Note 485), last published version. Said to be incorporated into the Intel 64 and IA-32 Architectures Software Developer's Manual in 2013, but as of July 2014[update] the manual still directs the reader to note 485.
- Contains some information that can be and was easily misinterpreted though, particularly with respect to processor topology identification.
- The big Intel manuals tend to lag behind the Intel ISA document, available at the top of this page, which is updated even for processors not yet publicly available, and thus usually contains more CPUID bits. For example, as of this writing, the ISA book (at revision 19, dated May 2014) documents the CLFLUSHOPT bit in leaf 7, but the big manuals although apparently more up-to-date (at revision 51, dated June 2014) don't mention it.
- AMD64 Architecture Programmer's Manual Volume 3: General-Purpose and System Instructions
- cpuid command-line program for Linux
- cpuprint.com, cpuprint.exe, cpuprint.raw command-line programs for Windows
- instlatx64 - collection of x86/x64 Instruction Latency, Memory Latency and CPUID dumps