Reviewed-by: Ray Ni <ray...@intel.com> > -----Original Message----- > From: Xie, Yuanhao <yuanhao....@intel.com> > Sent: Thursday, July 20, 2023 3:08 PM > To: devel@edk2.groups.io > Cc: Dong, Guo <guo.d...@intel.com>; Ni, Ray <ray...@intel.com>; Rhodes, Sean > <sean@starlabs.systems>; Lu, James <james...@intel.com>; Guo, Gua > <gua....@intel.com>; Xie, Yuanhao <yuanhao....@intel.com> > 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 <guo.d...@intel.com> > Cc: Ray Ni <ray...@intel.com> > Cc: Sean Rhodes <sean@starlabs.systems> > Cc: James Lu <james...@intel.com> > Cc: Gua Guo <gua....@intel.com> > Signed-off-by: Yuanhao Xie <yuanhao....@intel.com> > --- > 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: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-