[v1.05][X86] Fix for Meteor Lake (#255)

This commit is contained in:
Dr-Noob
2024-07-30 08:52:22 +01:00
parent d297878a51
commit 64ef0d889c
2 changed files with 14 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ int get_total_cores_module(int total_cores, int module) {
while(!end) { while(!end) {
if(!bind_to_cpu(i)) { if(!bind_to_cpu(i)) {
printBug("get_total_cores_module: Cannot bind to core %d", i);
return -1; return -1;
} }
uint32_t eax = 0x0000001A; uint32_t eax = 0x0000001A;
@@ -99,6 +100,17 @@ int get_total_cores_module(int total_cores, int module) {
uint32_t edx = 0; uint32_t edx = 0;
cpuid(&eax, &ebx, &ecx, &edx); cpuid(&eax, &ebx, &ecx, &edx);
int32_t core_type = eax >> 24 & 0xFF; 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; bool found = false;
for(int j=0; j < total_modules && !found; j++) { for(int j=0; j < total_modules && !found; j++) {

View File

@@ -733,6 +733,8 @@ struct topology* get_topology_info(struct cpuInfo* cpu, struct cache* cach, int
if(cpu->hybrid_flag) { if(cpu->hybrid_flag) {
#ifdef __linux__ #ifdef __linux__
topo->total_cores_module = get_total_cores_module(topo->total_cores, module); 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 #else
UNUSED(module); UNUSED(module);
topo->total_cores_module = topo->total_cores; topo->total_cores_module = topo->total_cores;