Fix a detection issue caused by some Pre-ZEN AMD CPUs sometimes incorrectly reporting SMT as supported

This commit is contained in:
Sam Demeulemeester 2022-05-21 01:31:06 +02:00
parent 3bc72c1fd4
commit dce2cfb079
1 changed files with 5 additions and 1 deletions

View File

@ -166,7 +166,11 @@ void cpuid_init(void)
thread_per_core = 2;
}
} else if (cpuid_info.flags.htt) {
thread_per_core = 2;
if (cpuid_info.version.extendedFamily >= 8) {
thread_per_core = 2;
} else {
cpuid_info.flags.htt = 0; // Pre-ZEN never has SMT
}
}
cpuid_info.topology.core_count = cpuid_info.topology.thread_count / thread_per_core;
}