UefiCpuPkg/CpuMpPei: Set AP state to CpuStateIdle after initialization
authorJeff Fan <jeff.fan@intel.com>
Wed, 2 Dec 2015 00:42:59 +0000 (00:42 +0000)
committervanjeff <vanjeff@Edk2>
Wed, 2 Dec 2015 00:42:59 +0000 (00:42 +0000)
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19087 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/CpuMpPei/CpuMpPei.c

index 7bedf64210910aae946e51d5e1f2b1a583a4331b..d058d143ced74557475cd99160837bd3080ccf19 100644 (file)
@@ -228,13 +228,14 @@ ApCFunction (
 \r
   PeiCpuMpData = ExchangeInfo->PeiCpuMpData;\r
   if (PeiCpuMpData->InitFlag) {\r
+    ProcessorNumber = NumApsExecuting;\r
     //\r
     // This is first time AP wakeup, get BIST information from AP stack\r
     //\r
-    BistData = *(UINTN *) (PeiCpuMpData->Buffer + NumApsExecuting * PeiCpuMpData->CpuApStackSize - sizeof (UINTN));\r
-    PeiCpuMpData->CpuData[NumApsExecuting].Health.Uint32 = (UINT32) BistData;\r
-    PeiCpuMpData->CpuData[NumApsExecuting].ApicId = GetInitialApicId ();\r
-    if (PeiCpuMpData->CpuData[NumApsExecuting].ApicId >= 0xFF) {\r
+    BistData = *(UINTN *) (PeiCpuMpData->Buffer + ProcessorNumber * PeiCpuMpData->CpuApStackSize - sizeof (UINTN));\r
+    PeiCpuMpData->CpuData[ProcessorNumber].Health.Uint32 = (UINT32) BistData;\r
+    PeiCpuMpData->CpuData[ProcessorNumber].ApicId = GetInitialApicId ();\r
+    if (PeiCpuMpData->CpuData[ProcessorNumber].ApicId >= 0xFF) {\r
       //\r
       // Set x2APIC mode if there are any logical processor reporting\r
       // an APIC ID of 255 or greater.\r
@@ -248,6 +249,7 @@ ApCFunction (
     //\r
     MtrrSetAllMtrrs (&PeiCpuMpData->MtrrTable);\r
     MicrocodeDetect ();\r
+    PeiCpuMpData->CpuData[ProcessorNumber].State = CpuStateIdle;\r
   } else {\r
     //\r
     // Execute AP function if AP is not disabled\r