From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
WikiProject Computing / Hardware (Rated C-class, Mid-importance)
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
C-Class article C  This article has been rated as C-Class on the project's quality scale.
 Mid  This article has been rated as Mid-importance on the project's importance scale.
Taskforce icon
This article is supported by Computer hardware task force (marked as Low-importance).

Unnamed section #1[edit]

CPUID is not specific to Intel Architecture, but its used in other CPUs as well, for example ARM MPCore [1], Altera NIOS2 [2]. In general, any architectural that supports Linux SMP kernel, must be able to uniquely identify underlaying processor to the kernel.

This page should be updated to incorporate this.

--Asadzia 07:56, 26 March 2007 (UTC)

IMO, the list of manufacturer IDs (specifically Transmeta) should be on individual lines, as the 2nd id for Transmeta was hiding. I'm gonna change it, unless theres a good reason why it was done this way. (talk) 19:47, 17 November 2010 (UTC)

Unnamed section #2[edit]

The first example code segfaults when I run it, compile with:

as -g cpuid.asm -o cpuid.o
ld  -dynamic-linker /lib64/ -lc cpuid.o -o cpuid

Is this my error or is the source incorrect? My assembly isn't great, but shouldn't there be a

movl $1, %eax
int  $0x80

Kobrien88 (talk) 03:16, 23 January 2011 (UTC)

With the assemble/link commands you are using, yes, you are correct (at least on Linux.) I went ahead and changed the code. Should work with no segfaults now. Kabure (talk) 01:36, 14 February 2011 (UTC)

What is the rationale behind using assembly language snippets in this article? As shown under "..other languages" CPUID can be easily called from within C. As the majority of the assembly is about bit shifting, masking and formatting I'd consider C (or maybe even pseudo code) far more readable and giving more information to the average reader. I nobody speaks up, I'd like to replace the programs for the cache information and the brand string with C or pseudo code snippets. Also I'd like to add new leaves, especially AMD specific ones. To what detail shall this happen? Just a short description of the contained information or the full bit mask description? --APritzel (talk) 14:02, 1 August 2011 (UTC)

Hi, I get segfaults under Linux with Intel Compiler with the code in this article titled with "Or, a generally useful C implementation that works on 32 and 64 bit setups". The code was compiled als follows: icc -O0 -g test.c -o test. No segfault without -O0. Any idea? Disassembly:

Dump of assembler code for function cpuid:
0x000000000040056c <cpuid+0>:   push   %rbp
0x000000000040056d <cpuid+1>:   mov    %rsp,%rbp
0x0000000000400570 <cpuid+4>:   sub    $0x50,%rsp
0x0000000000400574 <cpuid+8>:   mov    %rbx,-0x18(%rbp)
0x0000000000400578 <cpuid+12>:  mov    %edi,-0x10(%rbp)
0x000000000040057b <cpuid+15>:  mov    %rsi,-0x50(%rbp)
0x000000000040057f <cpuid+19>:  mov    %rdx,-0x48(%rbp)
0x0000000000400583 <cpuid+23>:  mov    %rcx,-0x40(%rbp)
0x0000000000400587 <cpuid+27>:  mov    %r8,-0x38(%rbp)
0x000000000040058b <cpuid+31>:  mov    -0x50(%rbp),%rax
0x000000000040058f <cpuid+35>:  mov    -0x10(%rbp),%edx
0x0000000000400592 <cpuid+38>:  mov    %edx,(%rax)
0x0000000000400594 <cpuid+40>:  mov    -0x50(%rbp),%rax
0x0000000000400598 <cpuid+44>:  mov    -0x48(%rbp),%rdx
0x000000000040059c <cpuid+48>:  mov    -0x40(%rbp),%rcx
0x00000000004005a0 <cpuid+52>:  mov    -0x38(%rbp),%rbx
0x00000000004005a4 <cpuid+56>:  mov    %rax,-0x30(%rbp)
0x00000000004005a8 <cpuid+60>:  mov    (%rax),%eax
0x00000000004005aa <cpuid+62>:  mov    %rcx,-0x28(%rbp)
0x00000000004005ae <cpuid+66>:  mov    %rdx,-0x20(%rbp)
0x00000000004005b2 <cpuid+70>:  mov    %ebx,%edi
0x00000000004005b4 <cpuid+72>:  cpuid
0x00000000004005b6 <cpuid+74>:  mov    %ebx,%esi
0x00000000004005b8 <cpuid+76>:  mov    %edi,%ebx
0x00000000004005ba <cpuid+78>:  mov    %edx,(%rbx)
0x00000000004005bc <cpuid+80>:  mov    -0x28(%rbp),%rdx
0x00000000004005c0 <cpuid+84>:  mov    %ecx,(%rdx)
0x00000000004005c2 <cpuid+86>:  mov    -0x20(%rbp),%rdx
0x00000000004005c6 <cpuid+90>:  mov    %esi,(%rdx)
0x00000000004005c8 <cpuid+92>:  mov    -0x30(%rbp),%rdx
0x00000000004005cc <cpuid+96>:  mov    %eax,(%rdx)
0x00000000004005ce <cpuid+98>:  mov    -0x18(%rbp),%rbx
0x00000000004005d2 <cpuid+102>: leaveq
0x00000000004005d3 <cpuid+103>: retq
End of assembler dump.

ECX is output-only?[edit]

There is nothing on the page (or to my knowledge anywhere else) which supports the assertion that the ECX register is ever involved in selecting a return value.

the value in the EAX register, and in some cases the ECX register, specifies what information to return

Accordingly I propose that the highlit phrase be struck from the article. Martin Kealey (talk) 04:01, 21 August 2013 (UTC)

Extended function msb[edit]

The article says "To obtain extended function information CPUID should be called with the second most significant bit of EAX set. To determine the highest extended function calling parameter, call CPUID with EAX = 80000000h." Isn't 0x80000000 setting the most significant bit, rather than the 2nd msb? (talk) 06:54, 24 February 2014 (UTC)

CPUID for input EAX=4[edit]

Does useful stuff. Should be added. (talk) 08:45, 10 July 2014 (UTC)

App note 485 gone[edit]

Even the removal notice thereof is gone from Intel's site, but the notice can still be read at (talk) 09:58, 10 July 2014 (UTC)

External links modified[edit]

Hello fellow Wikipedians,

I have just added archive links to one external link on CPUID. Please take a moment to review my edit. You may add {{cbignore}} after the link to keep me from modifying it, if I keep adding bad data, but formatting bugs should be reported instead. Alternatively, you can add {{nobots|deny=InternetArchiveBot}} to keep me off the page altogether, but should be used as a last resort. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

As of February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{sourcecheck}} (last update: 15 July 2018).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—cyberbot IITalk to my owner:Online 07:04, 28 March 2016 (UTC)

KVM manufacturer ID string[edit]

The KVM manufacturer ID string is only 9 characters long - should it not be 12? — Preceding unsigned comment added by Joe Glancy (talkcontribs) 17:50, 10 June 2016 (UTC)

It's padded with zeros. The string is "KVMKVMKVM\0\0\0". And the fact that the article displays it as " KVMKVMKVM ", as if it had spaces, I find super confusing! Mlkj (talk) 19:20, 6 April 2020 (UTC)

CPUID for input EAX=6[edit]


on return EAX:

Bit 00: Digital temperature sensor is supported if set.
Bit 01: Intel Turbo Boost Technology Available (see description of IA32_MISC_ENABLE[38]).
Bit 02: ARAT. APIC-Timer-always-running feature is supported if set.
Bit 03: Reserved.
Bit 04: PLN. Power limit notification controls are supported if set.
Bit 05: ECMD. Clock modulation duty cycle extension is supported if set.
Bit 06: PTM. Package thermal management is supported if set.
Bit 07: HWP. HWP base registers (IA32_PM_ENABLE[bit 0], IA32_HWP_CAPABILITIES, IA32_HWP_REQUEST, IA32_HWP_STATUS) are supported if set.
Bit 08: HWP_Notification. IA32_HWP_INTERRUPT MSR is supported if set.
Bit 09: HWP_Activity_Window. IA32_HWP_REQUEST[bits 41:32] is supported if set.
Bit 10: HWP_Energy_Performance_Preference. IA32_HWP_REQUEST[bits 31:24] is supported if set.
Bit 11: HWP_Package_Level_Request. IA32_HWP_REQUEST_PKG MSR is supported if set.
Bit 12: Reserved.
Bit 13: HDC. HDC base registers IA32_PKG_HDC_CTL, IA32_PM_CTL1, IA32_THREAD_STALL MSRs are supported if set.
Bits 31 - 15: Reserved.

on return EBX:

Bits 03 - 00: Number of Interrupt Thresholds in Digital Thermal Sensor.
Bits 31 - 04: Reserved.

on return ECX:

Bit 00: Hardware Coordination Feedback Capability (Presence of IA32_MPERF and IA32_APERF).
The capability to provide a measure of delivered processor performance (since last reset of the counters), as a percentage of the expected processor performance when running at the TSC frequency.
Bits 02 - 01: Reserved = 0.
Bit 03: The processor supports performance-energy bias preference if CPUID.06H:ECX.SETBH[bit 3] is set and it also implies the presence of a new architectural MSR called IA32_ENERGY_PERF_BIAS (1B0H).
Bits 31 - 04: Reserved = 0.

on return EDX:

Reserved = 0. (talk) 16:20, 30 January 2018 (UTC)