HI,

If I execute this on a Dell T410, which has two Xeon E5530 Quad Core processors, I get the output shown below:

mov eax, 4
mov ebx, 0
mov ecx, 0
mov edx, 0
CPUID

; at this point eax=0x1c004121, ebx=0x1c0003f, ecx=0x3f, edx=0x0

According to Intel AP-485: "The BIOS will use this function to determine the number of cores implemented in a specific physical processor package. To do this the BIOS must initially set the EAX register to 4 and the ECX register to 0 prior to executing the CPUID instruction. After executing the CPUID instruction, (EAX[31:26] + 1) contains the number of cores."

As you can see, EAX[31:26] is 7, so this package has 8 cores. But I know it only has 4. Can anyone tell me how to determine the number of cores in Intel processors that works for the E5530?

By the way, the number of logical processors works out to be 16, which I would expect as this processor is hyperthreaded. But again I know it actually has only 8 logical processors.

If I execute the CPUID instruction for all supported functions I get:

 cpuid function,        eax,        ebx,        ecx,        edx
            0x0,        0xb, 0x756e6547, 0x6c65746e, 0x49656e69,
            0x1,    0x106a5,  0x7100800,   0x9ce3bd, 0xbfebfbff,
            0x2, 0x55035a01,   0xf0b2e4,        0x0,  0x9ca212c,
            0x3,        0x0,        0x0,        0x0,        0x0,
            0x4, 0x1c004121,  0x1c0003f,       0x3f,        0x0,
            0x5,       0x40,       0x40,        0x3,     0x1120,
            0x6,        0x3,        0x2,        0x1,        0x0,
            0x7,        0x0,        0x0,        0x0,        0x0,
            0x8,        0x0,        0x0,        0x0,        0x0,
            0x9,        0x0,        0x0,        0x0,        0x0,
            0xa,  0x7300403,       0x44,        0x0,      0x603,
            0xb,        0x1,        0x2,      0x100,        0x7,
     0x80000000, 0x80000008,        0x0,        0x0,        0x0,
     0x80000001,        0x0,        0x0,        0x1, 0x28100000,
     0x80000002, 0x65746e49, 0x2952286c, 0x6f655820, 0x2952286e,
     0x80000003, 0x55504320, 0x20202020, 0x20202020, 0x45202020,
     0x80000004, 0x30333535, 0x20402020, 0x30342e32,   0x7a4847,
     0x80000005,        0x0,        0x0,        0x0,        0x0,
     0x80000006,        0x0,        0x0,  0x1006040,        0x0,
     0x80000007,        0x0,        0x0,        0x0,      0x100,
     0x80000008,     0x3028,        0x0,        0x0,        0x0,
link|improve this question
Do this: cat /proc/cpuinfo – Zifre Jul 28 '09 at 13:48
What if he's running a non-Linux OS? – Vinko Vrsalovic Jul 28 '09 at 14:19
feedback

migrated from stackoverflow.com Jul 28 '09 at 13:54

This question came from our site for professional and enthusiast programmers.

7 Answers

Check the product page @ Intel:

Essentials

  • Status --- Launched
  • Launch Date --- Q1'09
  • Processor Number --- E5530
  • # of Cores --- 4
  • Clock Speed --- 2.4 GHz
  • Intel® Smart Cache --- 8 MB
  • Intel® QPI Speed --- 5.86 GT/s
  • # of QPI Links --- 2
  • Instruction Set --- 64-bit
  • Embedded --- X
  • Supplemental SKU --- X
  • Lithography --- 45 nm
  • Max TDP --- 80 W

Since it has Hyperthreading enabled you get 8 logical CPU's

link|improve this answer
Care to explain the downvote? It answers the question doesn't it? – Ivo Flipse Jul 28 '09 at 15:56
feedback
... Dell T410, which has two Xeon E5530 Quad Core processors ...

This is going to sound really dumb, but you mentioned your computer has two Xeon processors. Thusly, wouldn't it stand to reason that if you have two quad core processors, your machine would show with 8 physical cores and 16 logical cores, like you're seeing in the output?

More seriously, in response to your question, it seems that the computer is referring to the processor as a single unit - regardless of how many physical chips are present in the system.

It may not be possible to refer a single CPU in this fashion.

link|improve this answer
+1 for the two processors, I actually overread that – Ivo Flipse Jul 28 '09 at 15:57
feedback

Intel is available online for a check:

Processor
Essentials
Status  Launched
Launch Date Q1'09
Processor Number    E5530
# of Cores  4
Clock Speed 2.4 GHz
Intel® Smart Cache  8 MB
Intel® QPI Speed    5.86 GT/s
# of QPI Links  2
Instruction Set 64-bit
Embedded    No
Supplemental SKU    No
Lithography 45 nm
Max TDP 80 W
1ku Bulk Budgetary Price    $530.00
link|improve this answer
feedback

I asked the question on Stackoverflow and I don't seem to be able to edit or respond to other's posts. So I'm responding here.

On this processor CPUID(1).EDX[28] = 1, which means "The physical processor package is capable of supporting more than one logical processor."

Also, CPUID(1).EBX[23:16] = 16, which means "Number of logical processors per physical processor package (CPUID.1.EBX[23:16])"

According to AP-485, CPUID(4).EAX[31:26] + 1 is the number of cores not the number of logical CPUs.

I am getting 8 cores and 16 logical CPUs, when I would expect 4 cores and 8 logical CPUs.

link|improve this answer
You should be able to associate this account with your SO account in your user page (the accounts tab). I would hope that associating would make you the question owner again, but I don't know for sure. – mmyers Jul 28 '09 at 16:12
Thanks. Maybe the problem is that I asked the question on SO as a guest. Actually, I'm a bit sad that it was peremptorily moved here; I thought SO was for programming questions? – Anonymous Jul 29 '09 at 8:17
feedback

The answer is: 42

link|improve this answer
feedback

I think the answer is that if CPUID leaf B is supported you need to use that to determine the number cores. See http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/

link|improve this answer
feedback

You have 8 logical CPU's.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown