UefiCpuPkg/MpInitLib: Move timeout delay to WakupAp()

After sending the 1st broadcast INIT-SIPI-SIPI, BSP will collect APs count after
one specified timeout delay. However, WakupAp() will restore reset vector
immediately after sending 1st broadcast INIT-SIPI-SIPI. Some processors may not
complete executing reset vector code.

This fix is to move MicroSecondDelay() from CollectProcessorCount() to the place
that is after sending 1st broadcast INIT-SIPI-SIPI and before FreeResetVector()
in WakupAp().

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@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>
This commit is contained in:
Jeff Fan 2016-08-24 21:37:14 +08:00
parent 1219c85df4
commit c119221060
1 changed files with 6 additions and 5 deletions

View File

@ -513,10 +513,6 @@ CollectProcessorCount (
CpuMpData->InitFlag = ApInitConfig;
CpuMpData->X2ApicEnable = FALSE;
WakeUpAP (CpuMpData, TRUE, 0, NULL, NULL);
//
// Wait for AP task to complete and then exit.
//
MicroSecondDelay (PcdGet32(PcdCpuApInitTimeOutInMicroSeconds));
CpuMpData->InitFlag = ApInitDone;
ASSERT (CpuMpData->CpuCount <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
//
@ -863,7 +859,12 @@ WakeUpAP (
//
SendInitSipiSipiAllExcludingSelf ((UINT32) ExchangeInfo->BufferStart);
}
if (CpuMpData->InitFlag != ApInitConfig) {
if (CpuMpData->InitFlag == ApInitConfig) {
//
// Wait for all potential APs waken up in one specified period
//
MicroSecondDelay (PcdGet32(PcdCpuApInitTimeOutInMicroSeconds));
} else {
//
// Wait all APs waken up if this is not the 1st broadcast of SIPI
//