回复: Re: [edk2-devel] [Patch V6 4/4] UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.

Jeff Fan via groups.io fanjianfeng=byosoft.com.cn at groups.io
Fri Jul 28 06:57:08 UTC 2023


Yuanhao,

Sorry. I are missing the following updating. 
+        if ((CpuMpData->InitFlag == ApInitConfig) 

Please ignore my last comments ! :-)

Reviewed-by: Jeff Fan <fanjianfeng at byosoft.com.cn>

Thanks!
Jeff



fanjianfeng at byosoft.com.cn
 
发件人: fanjianfeng at byosoft.com.cn
发送时间: 2023-07-28 14:49
收件人: devel at 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 at 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 <eric.dong at intel.com>
Cc: Ray Ni <ray.ni at intel.com>
Cc: Rahul Kumar <rahul1.kumar at intel.com>
Cc: Gerd Hoffmann <kraxel at redhat.com>
Signed-off-by: Ray Ni <ray.ni at intel.com>
Signed-off-by: Yuanhao Xie <yuanhao.xie at intel.com>
Reviewed-by: Ray Ni <ray.ni at 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 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20230728/23028361/attachment-0001.htm>


More information about the edk2-devel-archive mailing list