Intel processor identification and cpuid command (2) cpuid command

Source: Internet
Author: User

Cpuid commands have two sets of functions. The first function returns the basic information of the processor, and the second function returns the extended information of the processor. Figure 1 summarizes the basic information of the processor that can be output by the cpuid command. The output of the cpuid command is completely dependent on the content of the eax register. According to the value in the eax register, different functions are called when the cpuid command is executed (see table 1 ).

To determine the maximum input value that the eax register can accept when the cpuid command outputs the basic information of the processor, the application should assign the eax register to 0 and execute the cpuid command:

MOV EAX, 00HCPUID

After execution, the results are saved in the eax register. To return valid basic CPU information, the eax register should always pass the value greater than or equal to 0 and less than or equal to the result.

To determine the maximum input value that the eax register can accept when the cpuid command outputs the extended information of the processor, the application should assign the eax register a value of H and execute the cpuid command:

MOV EAX, 80000000HCPUID

After the execution is complete, the results will be saved in the eax register. To return valid CPU extension information, the eax register should always pass a value greater than or equal to H and less than or equal to the value of the result.

In any case, if the value passed to eax is greater than the maximum value it can accept, or the function that returns the extended information is not supported, after executing the cpuid command, the maximum bits of the eax register are cleared. The values of other bits are specified by the specific processor model (moel specific) and are untrusted.

1. Vendor ID string (vendor ID string)

In addition to the maximum value that the eax register can accept, the cpuid command can also return the vendor ID string (verdor ID string) of the processor ). When 0 is passed to the eax register as the input value, the vendor ID string is saved in the EBX, EDX, and ECx registers, as shown in figure 1. The information is an ASCII string:

Genuineintel(*)

Any imitators of Intel processor architecture can support cpuid commands, but they cannot claim that their architecture is a real intel architecture. Therefore, this string is a guarantee that the cpuid command and processor Signature Based on it fully comply with the instructions in this document. If the returned string is not "genuineintel", the actual returned string cannot be interpreted according to the description in this document.


Figure 1

Eax input value Information returned by the processor
  Basic cpuid Information
0 h Maximum value that eax can accept when eax returns CPU Basic Information
EBX "genu"
ECX "ntel"
EdX "INEI"
1 H Eax32-bit processor Signature
EBX bits 7-0: Trademark index-unsupported if the value is 0
Bits 15-8: the size of the clflush row (this value * 8 = the size of the cached row). It is valid only when the clfstamp is set.
Bits 23-16: Number of logical processors, valid only when hyper-threading flag is set
Bits 31-24: Physical ID of the local APIC of the processor, which is only valid for pentium4 and later processors.
ECX feature flags
EdX feature flags
2 h  Eax, EBX, ECx, EDX cache and TLB Descriptor
3 H Eax retains EBX retains the first 31-bit edX 96-bit processor serial number of ECx 96-bit processor serial number
4 h Deterministic cache parameters Function
Eax bits 4-0: cache type **
Bits 7-5: cache level (starts at 1)
Bits 8: Self initializing cache level (does not need SW initialization)
Bits 9: fully associative Cache
Bits 13-10: Reserved
Bits 25-14: Number of threads sharing this cache *
Bits 31-26: Number of processor cores on this die (multicore )*
EBX bits 11-00: L = system coherency line size *
Bits 21-12: P = physical line partitions *
Bits 31-22: W = ways of associativity *
ECX bits 31-00: S = number of sets *
EdX reserved = 0
5 H Monitor/mwait Function
Eax bits 15-00: smallest Monitor-line size in bytes
Bits 31-16: Reserved = 0
EBX bits 15-00: largest monitor-line size in bytes
Bits 31-16: Reserved = 0
ECX reserved = 0
EdX reserved = 0
  Extended Function cpuid Information
80000000 H EaxMaximum value that eax can accept when the CPU extension information is returned
EBX, ECx, and EDX are retained
80000001 H Eax scalable processor signature and scalable feature bit
EBX, ECx, and EDX are retained
80000002 H Eax processor trademark string EBX, ECx, EDX subsequent processor trademark string
80000003 H Eax, EBX, ECx, EDX subsequent processor trademark string
80000004 H Eax, EBX, ECx, EDX subsequent processor trademark string
80000005 H Eax, EBX, ECx, EDX retained
80000006 H Extended second-level cache feature Functions
Eax retained
EBX retention
ECX bits 7: 0: second-level cache size
Bits 15: 8: Level-2 Cache relevance
Bits 31: 16: L2 cache size in 1-k units
EdX retained
80000007 H Eax, EBX, ECx, EDX retained
80000008 H Extended address size function
Eax bits physical address size
Bits 8 virtual address size
Table 1

2. processor Signature)

Starting from the intelease Processor family, The edX register saves the processor identification signature After resetting, as shown in figure 2.The processor authenticates that the signature is a 32-bit value.Which consists of eight single-site domains. The gray bit field indicates the Reserved Bit. It should be excluded when using the processor signature (masked out ). The remaining six fields constitute the processor authentication signature.


Figure 2

The processor that implements the cpuid command also returns the processor After resetting. However, the cpuid command is more flexible and can be used to check the processor signature at any time, that is, you can view the command without resetting. Figure 2 shows the signature format of intelease and subsequent processors. It is worth noting that the processor signature returned by EDX after the reset is the same as the processor signature output in eax in Figure 1.

Medium, 20th to 27 extended family, used to connect with the Family Code from 8th to 11th, indicating that the processor belongs to intel386, 486, Pentium, Pentium Pro or Pentium 4. The Pentium 6 family includes all the processor models based on the Pentium Pro architecture, and its extended family value is 00 h, family
The code value is 6 h. The Pentium 4 family includes all the netburst-based processors whose extended family value is 00 h and the family code value is 0fh.

Extended model and model number are combined to indicate the processor model in the processor family. Stepping ID indicates the version number of the model.

12th-bit and 13th-bit processors, including native OEM processors, overdrive processor, and dual-core processor ). Table 2 shows the type of the processor.

Value Type
00 Native OEM Processor
01 Overspeed Processor
10 Dual-core processor
11 Intel reserved (unavailable)
Table 2

The model value is 5 for the Pentium II processor, the Pentium II Xeon processor, and the Sai Yang processor, sharing the same extended family, Family Code, extended model, and model number. To differentiate these processors, the application should check the cache size by making eax = 2 and then calling the cpuid command. If the description of the second-level cache is not returned, the saiyang processor is used. If the returned second-level cache size is 1 MB or 2 MB, the CPU is the Pentium II Xeon processor; otherwise, it is either the Pentium II Xeon processor or the Pentium II processor whose second-level cache is K.

The Pentium III and Pentium III Xeon processors of Model 7 share the same extended family, Family Code, extended model, and model number. To differentiate these processors, the application should check the cache size by eax = 2 and then call the cpuid command. If the second-level cache description is not returned, the Pentium III Xeon processor is used. If the returned second-level cache size is 1 MB or 2 MB, the CPU is the Pentium III Xeon processor; otherwise, the Pentium III Xeon processor or Pentium III processor with a 512k level cache is used.

The model value is an 8 Pentium III processor, a Pentium III Xeon processor, and a race processor. Their processor brand can be determined by brand ID by making eax = 1, then, call the cpuid command.

Earlier processors, such as intelstmsx, intelstmdx, and inteldx2, do not support cpuid commands. Therefore, their processor signatures can only be viewed after the processor is reset.

Figure 3 shows the Intel 386 processor signature format, which is different from other processors.


Figure 3

(*) The inEl CPU will return:

EBX: 756e6547h 'genu'

EdX: 49656e69h 'inei'

ECX: 6c65746eh 'ntel'

EBX, EDX, and ECX will be connected to genuineintel.

The CPU of cyrix will return:

EBX: 43797269 H

EdX: 78496e73h

ECX: 74656164 H

"Cyrixinstead", "cyrix to replace ".

Amd cpu will return:

EBX: 41757468 H

EdX: 656e7469h

ECX: 63414d44h

"Authenticamd", trusted AMD.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.