summaryrefslogtreecommitdiff
path: root/Core
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2017-05-26 19:50:43 +0800
committerGuo Mang <mang.guo@intel.com>2017-07-12 11:24:50 +0800
commitf65d62d67c515712c5a04304d6b38fcc8e070a7f (patch)
treea0795b73721ee66ccc13d9e4160fd87f20e84156 /Core
parentc6e834536eeb0fadb3f063e696716ac07150b49e (diff)
downloadedk2-platforms-f65d62d67c515712c5a04304d6b38fcc8e070a7f.tar.xz
UefiCpuPkg/MpInitLib: Force to enable X2APIC if CPU number > 255
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 71d8226ac6f256d360626c8072337f9373f95671)
Diffstat (limited to 'Core')
-rw-r--r--Core/UefiCpuPkg/Library/MpInitLib/MpLib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Core/UefiCpuPkg/Library/MpInitLib/MpLib.c b/Core/UefiCpuPkg/Library/MpInitLib/MpLib.c
index c6f81914d2..df19b43bc0 100644
--- a/Core/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/Core/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -451,6 +451,12 @@ CollectProcessorCount (
CpuPause ();
}
+ if (CpuMpData->CpuCount > 255) {
+ //
+ // If there are more than 255 processor found, force to enable X2APIC
+ //
+ CpuMpData->X2ApicEnable = TRUE;
+ }
if (CpuMpData->X2ApicEnable) {
DEBUG ((DEBUG_INFO, "Force x2APIC mode!\n"));
//
@@ -1412,7 +1418,7 @@ MpInitLibInitialize (
CpuInfoInHob = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob;
for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
InitializeSpinLock(&CpuMpData->CpuData[Index].ApLock);
- if (CpuInfoInHob[Index].InitialApicId >= 255) {
+ if (CpuInfoInHob[Index].InitialApicId >= 255 || Index > 254) {
CpuMpData->X2ApicEnable = TRUE;
}
CpuMpData->CpuData[Index].CpuHealthy = (CpuInfoInHob[Index].Health == 0)? TRUE:FALSE;