summaryrefslogtreecommitdiff
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-11-14 10:30:03 +0800
committerJeff Fan <jeff.fan@intel.com>2016-11-16 16:09:08 +0800
commitcb33bde4ac7536f5a5621c7a56aecd981585e087 (patch)
tree5c2be56a1a5527671185e97a768d8882fc2a453d /UefiCpuPkg
parentd67cbc66045e824d61fca5bf51c90783161becdf (diff)
downloadedk2-cb33bde4ac7536f5a5621c7a56aecd981585e087.zip
edk2-cb33bde4ac7536f5a5621c7a56aecd981585e087.tar.gz
edk2-cb33bde4ac7536f5a5621c7a56aecd981585e087.tar.bz2
UefiCpuPkg/MpInitLib: Force sending INIT-SIPI-SIPI to reset APs
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>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index a0edc55..9641e5e 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -899,7 +899,12 @@ ResetProcessorToIdleState (
CpuMpData = GetCpuMpData ();
+ CpuMpData->InitFlag = ApInitReconfig;
WakeUpAP (CpuMpData, FALSE, ProcessorNumber, NULL, NULL);
+ while (CpuMpData->FinishedCount < 1) {
+ CpuPause ();
+ }
+ CpuMpData->InitFlag = ApInitDone;
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);
}