Skip to content

Commit

Permalink
[v1.05][X86] Fix for Meteor Lake (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Noob committed Jul 30, 2024
1 parent d297878 commit 64ef0d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/x86/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ int get_total_cores_module(int total_cores, int module) {

while(!end) {
if(!bind_to_cpu(i)) {
printBug("get_total_cores_module: Cannot bind to core %d", i);
return -1;
}
uint32_t eax = 0x0000001A;
Expand All @@ -99,6 +100,17 @@ int get_total_cores_module(int total_cores, int module) {
uint32_t edx = 0;
cpuid(&eax, &ebx, &ecx, &edx);
int32_t core_type = eax >> 24 & 0xFF;

// Here we artificially create a new core type for
// LP-E cores. In case the core has no L3 (on a hybrid)
// architecture, then we now it's an LP-E core.
eax = 0x4;
ebx = 0;
ecx = 0x3;
edx = 0;
cpuid(&eax, &ebx, &ecx, &edx);
core_type += eax == 0;

bool found = false;

for(int j=0; j < total_modules && !found; j++) {
Expand Down
2 changes: 2 additions & 0 deletions src/x86/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ struct topology* get_topology_info(struct cpuInfo* cpu, struct cache* cach, int
if(cpu->hybrid_flag) {
#ifdef __linux__
topo->total_cores_module = get_total_cores_module(topo->total_cores, module);
printBug("get_total_cores_module: Failed to get number of cores in module");
return NULL;
#else
UNUSED(module);
topo->total_cores_module = topo->total_cores;
Expand Down

0 comments on commit 64ef0d8

Please sign in to comment.