Reviewed-by: Ray Ni <[email protected]> > -----Original Message----- > From: Xie, Yuanhao <[email protected]> > Sent: Thursday, July 20, 2023 3:08 PM > To: [email protected] > Cc: Dong, Guo <[email protected]>; Ni, Ray <[email protected]>; Rhodes, Sean > <[email protected]>; Lu, James <[email protected]>; Guo, Gua > <[email protected]>; Xie, Yuanhao <[email protected]> > Subject: [Patch V3 4/4] UefiCpuPkg:Wake up APs after power-up or RESET > through SIPI. > > 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: Guo Dong <[email protected]> > Cc: Ray Ni <[email protected]> > Cc: Sean Rhodes <[email protected]> > Cc: James Lu <[email protected]> > Cc: Gua Guo <[email protected]> > Signed-off-by: Yuanhao Xie <[email protected]> > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index 737e03ffc5..ce94937e30 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -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); > + } > } > } > > -- > 2.36.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107119): https://edk2.groups.io/g/devel/message/107119 Mute This Topic: https://groups.io/mt/100251422/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
