Solve an issue with Core 2 Duo/Quad and same gen CPUs, where HTT flag is enabled in CPUID while the CPU does not support SMT. (#125 #129)

Now compare the number of physical core with the number of reserved APIC to check if SMT is really available or not
This commit is contained in:
Sam Demeulemeester 2022-07-23 23:47:06 +02:00
parent 53f61e6b87
commit cf156adc4a

View File

@ -215,7 +215,11 @@ void cpuid_init(void)
cpuid_info.topology.thread_count = cpuid_info.topology.core_count;
if (cpuid_info.flags.htt){
cpuid_info.topology.thread_count *= 2;
if (((cpuid_info.proc_info.raw >> 16) & 0xFF) > (uint32_t)cpuid_info.topology.core_count) {
cpuid_info.topology.thread_count *= 2;
} else {
cpuid_info.flags.htt = !cpuid_info.flags.htt;
}
}
} else if (cpuid_info.max_cpuid >= 0x2) {
if(cpuid_info.flags.htt){