Processors
Intel® Processors, Tools, and Utilities
16155 Discussions

CPUID L2 param is confilict btw two cpuid = 0x4 with 0x80000006

LisaJohn
Beginner
1,686 Views

but why? I am also confusing about this.
Here are my src code.

// processor
#include <stdio.h>
#include <stdint.h>
#include<string.h>
// intel support - support
void cpuid(int code, int level, unsigned int *a, unsigned int *b, unsigned int *c, unsigned int *d) {
asm volatile("cpuid"
: "=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d)
: "a"(code), "c"(level));
}
// Get-WmiObject -Class Win32_CacheMemory | Select-Object -Property *
// Get-WmiObject -Class Win32_Processor
// wmic cpu get L3CacheSize
// wmic cpu get Name, Family, ProcessorId, Model, Stepping

int main() {
unsigned int brand_string[13];
uint32_t eax, ebx, ecx, edx;
int k = 0;

cpuid(0x80000000, 0, &eax,&ebx,&ecx,&edx);

// get cpu max functionId
if (eax < 0x80000004) {
printf("the cpu is not support\n");

return 0;
}
// ref intel cpuid
cpuid(0x04, 1, &eax, &ebx, &ecx, &edx);
printf("L1 Cache EAX:%08X EBX:%08X ECX:%08X EDX: %08X\n", eax, ebx, ecx, edx);
cpuid(0x04, 2, &eax, &ebx, &ecx, &edx);
printf("L2 Cache EAX:%08X EBX:%08X ECX:%08X EDX: %08X\n", eax, ebx, ecx, edx);
cpuid(0x04, 3, &eax, &ebx, &ecx, &edx);
printf("L3 Cache EAX:%08X EBX:%08X ECX:%08X EDX: %08X\n", eax, ebx, ecx, edx);
cpuid(0x80000006, 0, &eax, &ebx, &ecx, &edx);
printf("80000006 EAX:%08X EBX:%08X ECX:%08X EDX: %08X\n", eax, ebx, ecx, edx);

return 0;
}

And my question is why " 0x04 L2 EBX[31:22] = 4ways but 0x80000006 ECX[15:12] = 8ways"

0 Kudos
4 Replies
Jocelyn_Intel
Employee
1,642 Views

Hello, @LisaJohn 

 

Thank you for posting on the Intel® communities. I will gladly assist you here. 

 

Please provide us with more details about what is your issue exactly. Where does this output come from?

 

How does this affect your system? What are you trying to do or perform? 

 

Also, please provide us with the Processor model. 

 

Best regards,  

Jocelyn M.   

Intel Customer Support Technician. 


0 Kudos
n_scott_pearson
Super User
1,628 Views

Please provide us with the full output that you are seeing.

...S

0 Kudos
Jocelyn_Intel
Employee
1,542 Views

Hello, @LisaJohn  

 

We are checking this thread and we would like to know if you were able to review our previous post. If you need further assistance, please do not hesitate to contact us back. 

 

Best regards,  

Jocelyn M.   

Intel Customer Support Technician. 


0 Kudos
Jocelyn_Intel
Employee
1,509 Views

Hello, @LisaJohn  

 

We have not heard back from you, so we will proceed to close this thread now. If you need any additional information, please submit a new question as this thread will no longer be monitored.  

 

Best regards,  

Jocelyn M.   

Intel Customer Support Technician. 


0 Kudos
Reply