]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: Force sending INIT-SIPI-SIPI to reset APs
authorJeff Fan <jeff.fan@intel.com>
Mon, 14 Nov 2016 02:30:03 +0000 (10:30 +0800)
committerJeff Fan <jeff.fan@intel.com>
Wed, 16 Nov 2016 08:09:08 +0000 (16:09 +0800)
If BSP found APs timeout happened when AP executing AP task, BSP will reset APs
by WakeUpAP(). However, if ApLoopMode is ApMwaitLoop or ApRunLoop, WakeUpAp()
will try to write semaphore in memory to wake up AP. It cannot wake up APs
actually if APs still executing AP task.

This fix is to set ApInitReconfig flag to force BSP to send INIT-SIPI-SIPI to
wake up APs.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael D 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>
UefiCpuPkg/Library/MpInitLib/MpLib.c

index a0edc55f5254b0031cc6ecf97a8bbd4414f66128..9641e5e82c200f8f14154f17d258805730e9fcf7 100644 (file)
@@ -899,7 +899,12 @@ ResetProcessorToIdleState (
 \r
   CpuMpData = GetCpuMpData ();\r
 \r
+  CpuMpData->InitFlag = ApInitReconfig;\r
   WakeUpAP (CpuMpData, FALSE, ProcessorNumber, NULL, NULL);\r
+  while (CpuMpData->FinishedCount < 1) {\r
+    CpuPause ();\r
+  }\r
+  CpuMpData->InitFlag = ApInitDone;\r
 \r
   SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);\r
 }\r