Skip to content

Commit

Permalink
UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.
Browse files Browse the repository at this point in the history
The implementation of this new behavior aligns with the guidelines
outlined in the Intel SDM.

Following a power-up or RESET of an MP system, system hardware
dynamically selects one of the processors on the system bus as the BSP.
The remaining processors are designated as APs. The APs complete a
minimal self-configuration, then wait for a startup signal (a SIPI
message) from the BSP processor.

Additionally, the MP protocol is executed only after
a power-up or RESET. If the MP protocol has completed and a
BSP is chosen, subsequent INITs (either to a specific processor or
system wide) do not cause the MP protocol to be repeated. Instead, each
logical processor examines its BSP flag (in the IA32_APIC_BASE MSR) to
determine whether it should execute the BIOS boot-strap code (if it is
the BSP) or enter a wait-for-SIPI state (if it is an AP).

Cc: Eric Dong <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Signed-off-by: Ray Ni <[email protected]>
Signed-off-by: Yuanhao Xie <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
  • Loading branch information
xieyuanh authored and mergify[bot] committed Aug 14, 2023
1 parent 1d76560 commit eaffa1d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion UefiCpuPkg/Library/MpInitLib/MpLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,14 @@ WakeUpAP (
if (CpuMpData->SevSnpIsEnabled && (CpuMpData->InitFlag != ApInitConfig)) {
SevSnpCreateAP (CpuMpData, -1);
} else {
SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart);
if ((CpuMpData->InitFlag == ApInitConfig) && FixedPcdGetBool (PcdFirstTimeWakeUpAPsBySipi)) {
//
// SIPI can be used for the first time wake up after reset to reduce boot time.
//
SendStartupIpiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart);
} else {
SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart);
}
}
}

Expand Down

0 comments on commit eaffa1d

Please sign in to comment.