Yuanhao, Sorry. I are missing the following updating. + if ((CpuMpData->InitFlag == ApInitConfig) Please ignore my last comments ! :-) Reviewed-by: Jeff Fan Thanks! Jeff fanjianfeng@byosoft.com.cn 发件人: fanjianfeng@byosoft.com.cn 发送时间: 2023-07-28 14:49 收件人: devel@edk2.groups.io; yuanhao.xie 抄送: Dong, Eric; Ni, Ray; Rahul Kumar; Gerd Hoffmann; Yuanhao Xie 主题: Re: [edk2-devel] [Patch V6 4/4] UefiCpuPkg:Wake up APs after power-up or RESET through SIPI. Yuanhao, Have you verirfed whether APs could be waken-up from ApInHltLoop state or not? Thanks! Jeff fanjianfeng@byosoft.com.cn From: Yuanhao Xie Date: 2023-07-28 14:25 To: devel CC: Eric Dong; Ray Ni; Rahul Kumar; Gerd Hoffmann; Yuanhao Xie Subject: [edk2-devel] [Patch V6 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: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Ray Ni Signed-off-by: Yuanhao Xie Reviewed-by: Ray Ni --- 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 e7054adbcc..6f1456cfe1 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 (#107370): https://edk2.groups.io/g/devel/message/107370 Mute This Topic: https://groups.io/mt/100406183/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-