Questions tagged [cpuid]

CPUID is an Intel x86 and x86_64 processor instruction that returns the processor type and the presence of particular features.

Originally introduced by Intel, the CPUID instruction returns the processor type and the presence of features such as MMX/SSE.

163 questions
7
votes
1 answer

How to detect P/E-Core in Intel Alder Lake CPU?

Which logical processor belongs to the P-core group and which to E-core group? My first idea was to just check the base clock for each logical processor and then assume that the lowest base clock belongs to E-core (according to intel specs E-cores…
Atak_Snajpera
  • 619
  • 9
  • 24
6
votes
1 answer

How portable is __get_cpuid?

I'm using __get_cpuid() to get info on the x86 and x86_64 processors my programs run on. With GCC on Linux and Mac OS, it seems to compile and run OK without include any header, but how portable is that? Would it work with other compilers? Should I…
F'x
  • 12,105
  • 7
  • 71
  • 123
6
votes
1 answer

How to find the L3 cache index and NUMA node index for the current hardware thread

I'm building a topological tree of sockets, NUMA nodes, caches, cores, and threads for any Intel or AMD system in C. Building this hierarchy, I want to ensure hardware threads are grouped together appropriately so it's clear who precisely shares…
6
votes
2 answers

Understanding TLB from CPUID results on Intel

I'm exploring leaf 0x02 of the cpuid instruction and came up with a few questions. There is a table in the documentation which describes what cpuid results mean for the TLB configuration. Here they are: case 1 56H TLB Data TLB0: 4 MByte pages, 4-way…
St.Antario
  • 26,175
  • 41
  • 130
  • 318
6
votes
4 answers

Cannot resume saved Virtualbox state

I get the following error after upgrading via Migration Assistant my laptop from a 2-core to a 4-core processor: cpum#1: X86_CPUID_FEATURE_ECX_MOVBE is not supported by the host but has already exposed to the guest [ver=17 pass=final] …
Justin Shenk
  • 538
  • 1
  • 4
  • 17
6
votes
2 answers

__asm__ in c++ error

I'm trying to read the cpuid information with the following cod but it doesn't work. I'm using Visual Studio 2010: #include "stdafx.h" #include int main() { int a, b; for (a = 0; a < 5; a++) { __asm__("cpuid" …
user3731104
  • 69
  • 1
  • 2
6
votes
1 answer

CPUID on Intel i7 processors

I'm having an issue with my CPUID-based code on newer i7-based machines. It is detecting the CPU as having a single core with 8 HT units instead of 4 cores each with 2 HT units. I must be misinterpreting the results of the CPUID information coming…
StarPacker
  • 529
  • 4
  • 4
6
votes
1 answer

cpuid instruction on i5-2500k: MMX, SSE, SSE2 bits are not set

Is this expected? I expected my Sandy Bridge CPU to report that it can handle MMX, SSE, and SSE2 instructions. Are these bits not set because these "old" instruction sets have been "superceded" by some of the newer ones? I used this code here to…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
6
votes
2 answers

How to call cpuid instruction in a Mac framework?

I want to use the cpuid instruction to identify features of an Intel CPU. I found the cpuid.h header in Kernel.framework, so I added Kernel.framework to my project and included in my source file. That…
JWWalker
  • 22,385
  • 6
  • 55
  • 76
5
votes
2 answers

Get SSE version without __asm on x64

I'm trying to build slightly modified versions of some functions of the VS2010 CRT library, all is well except for the parts where it tries to access a global variable which presumably holds the instruction set architecture version (ISA): if…
demorge
  • 1,097
  • 1
  • 7
  • 17
5
votes
1 answer

CPUID on multiple cores/NUMA

I am working on CPU detection and general environment detection code for my hobby OS. Is there ever a case where CPUID needs to be called multiple times? That is if the system has multiple cores, does the OS need to call CPUID on each core? Same for…
nixeagle
  • 1,002
  • 8
  • 17
5
votes
1 answer

Cache set-sizes that aren't a power of two

I've got a Linux computer with a Ryzen 7 1800X CPU. According to WikiChip it has a L2-DTLB of 1536 entries. So I assumed the associativity to be divisible by 3. I wrote a little program that checks the associativity reported by CPUID. Interestingly…
Bonita Montero
  • 2,817
  • 9
  • 22
5
votes
1 answer

QEMU/KVM missing CPU feature flags (kvm not pasing through?)

I'm trying to do some OS development in qemu with kvm. I'm using x86-64, my host cpu is an Intel i7-6700K (Skylake). The problem is that some of the cpu feature flags don't get passed through when I run qemu with -cpu host. I'm specifically…
5
votes
2 answers

Why is CPUID + RDTSC unreliable?

I am trying to profile a code for execution time on an x86-64 processor. I am referring to this Intel white paper and also gone through other SO threads discussing the topic of using RDTSCP vs CPUID+RDTSC here and here. In the above mentioned…
talekeDskobeDa
  • 372
  • 2
  • 13
5
votes
1 answer

Determine CPUID as listed in the Intel Intrinsics Guide

In the Intel Intrinsics Guide there are 'Latency and Throughput Information' at the bottom of several Intrinsics, listing the performance for several CPUID(s). For example, the table in the Intrinsics Guide looks as follows for the Intrinsic…
user1818760
1
2
3
10 11