Skip to content

Commit 1053e38

Browse files
committed
OcCpuLib: Fix incorrect core/thread counts on Pentium M
1 parent 9ecb761 commit 1053e38

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

Changelog.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ OpenCore Changelog
77
- Fixed `BOOTx64.efi` and `BOOTIA32.efi` convention
88
- Fixed SMBIOS handling with multiple memory arrays
99
- Fixed memory array handle assignment on empty slots
10-
- Fixed CPUID patching on certain versions of macOS 10.4.10 and 10.4.11.
10+
- Fixed CPUID patching on certain versions of macOS 10.4.10 and 10.4.11
11+
- Fixed incorrect core/thread counts on Pentium M processors
1112

1213
#### v0.6.2
1314
- Updated builtin firmware versions for SMBIOS and the rest

Include/Intel/IndustryStandard/ProcessorInfo.h

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ enum {
149149
#define CPU_MODEL_PRESCOTT 0x03 ///< Prescott, Nocona, Cranford, Potomac
150150
#define CPU_MODEL_PRESCOTT_2M 0x04 ///< Prescott 2M, Smithfield, Irwindale, Paxville
151151
#define CPU_MODEL_CEDAR_MILL 0x06 ///< Cedar Mill, Presler, Tusla, Dempsey
152+
#define CPU_MODEL_BANIAS 0x09 ///< Banias
152153
#define CPU_MODEL_DOTHAN 0x0D ///< Dothan
153154
#define CPU_MODEL_YONAH 0x0E ///< Sossaman, Yonah
154155
#define CPU_MODEL_MEROM 0x0F ///< Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom

Library/OcCpuLib/AppleCpuSupport.c

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ InternalDetectAppleProcessorType (
140140
//
141141
case CPU_MODEL_WILLAMETTE: // 0x01
142142
case CPU_MODEL_NORTHWOOD: // 0x02
143+
case CPU_MODEL_BANIAS: // 0x09
143144
case CPU_MODEL_DOTHAN: // 0x0D
144145
case CPU_MODEL_YONAH: // 0x0E
145146
// IM41 (T2400/T2500), MM11 (Solo T1200 / Duo T2300/T2400),

Library/OcCpuLib/OcCpuLib.c

+7
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,13 @@ ScanIntelProcessor (
471471
Msr = AsmReadMsr64 (MSR_CORE_THREAD_COUNT);
472472
Cpu->CoreCount = (UINT16)BitFieldRead64 (Msr, 16, 19);
473473
Cpu->ThreadCount = (UINT16)BitFieldRead64 (Msr, 0, 15);
474+
} else if (Cpu->Model == CPU_MODEL_BANIAS || Cpu->Model == CPU_MODEL_DOTHAN) {
475+
//
476+
// Banias and Dothan (Pentium M and Celeron M) never had
477+
// multiple cores or threads, and do not support the MSR below.
478+
//
479+
Cpu->CoreCount = 0;
480+
Cpu->ThreadCount = 0;
474481
} else {
475482
Msr = AsmReadMsr64 (MSR_CORE_THREAD_COUNT);
476483
Cpu->CoreCount = (UINT16)BitFieldRead64 (Msr, 16, 31);

0 commit comments

Comments
 (0)