CpuPause ();\r
}\r
\r
+ if (CpuMpData->CpuCount > 255) {\r
+ //\r
+ // If there are more than 255 processor found, force to enable X2APIC\r
+ //\r
+ CpuMpData->X2ApicEnable = TRUE;\r
+ }\r
if (CpuMpData->X2ApicEnable) {\r
DEBUG ((DEBUG_INFO, "Force x2APIC mode!\n"));\r
//\r
CpuInfoInHob = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob;\r
for (Index = 0; Index < CpuMpData->CpuCount; Index++) {\r
InitializeSpinLock(&CpuMpData->CpuData[Index].ApLock);\r
- if (CpuInfoInHob[Index].InitialApicId >= 255) {\r
+ if (CpuInfoInHob[Index].InitialApicId >= 255 || Index > 254) {\r
CpuMpData->X2ApicEnable = TRUE;\r
}\r
CpuMpData->CpuData[Index].CpuHealthy = (CpuInfoInHob[Index].Health == 0)? TRUE:FALSE;\r