Fix an issue while detection Core topology on Core 2 CPU.

Some CPU like Intel Yorkfield (Core 2 Quad) reports max CPUID > 0xB but doesn't support CPUID = 0xB. Check x2apic flag to be sure CPUID 0xB is supported. If not, fallback to older detection method
This commit is contained in:
Sam Demeulemeester 2022-07-26 20:02:58 +02:00
parent 408fdb8db6
commit 8a3cac8133

View File

@ -181,7 +181,7 @@ void cpuid_init(void)
case 'G':
if (cpuid_info.vendor_id.str[7] == 'T') break; // Transmeta
// Intel
if (cpuid_info.max_cpuid >= 0xB) {
if (cpuid_info.max_cpuid >= 0xB && cpuid_info.flags.x2apic) {
// Populate Hybrid Status (CPUID 7.EDX[15]) for Alder Lake+
cpuid(0x7, 0, &reg[0], &reg[1], &reg[2], &reg[3]);