From 5dc2234e975d369a59c3c4967dfa29d5b569f856 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Wed, 17 Jul 2024 08:50:11 +0100 Subject: [PATCH] [v1.05][X86] Assume logical and physical cores from total_cores --- src/x86/cpuid.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/x86/cpuid.c b/src/x86/cpuid.c index 35d8706..677d513 100644 --- a/src/x86/cpuid.c +++ b/src/x86/cpuid.c @@ -656,10 +656,15 @@ bool get_cache_topology_amd(struct cpuInfo* cpu, struct topology* topo) { void get_topology_from_udev(struct topology* topo) { topo->total_cores = get_ncores_from_cpuinfo(); // TODO: To be improved in the future - // Conservative setting as we only know the total - // number of cores. - topo->logical_cores = UNKNOWN_DATA; - topo->physical_cores = UNKNOWN_DATA; + if (topo->total_cores != -1) { + // Assuming this for now + topo->logical_cores = topo->total_cores; + topo->physical_cores = topo->total_cores; + } + else { + topo->logical_cores = UNKNOWN_DATA; + topo->physical_cores = UNKNOWN_DATA; + } topo->smt_available = 1; topo->smt_supported = 1; topo->sockets = 1;