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

Ni, Ray ray.ni at intel.com
Fri Jul 21 03:52:09 UTC 2023


Reviewed-by: Ray Ni <ray.ni at intel.com>

> -----Original Message-----
> From: Xie, Yuanhao <yuanhao.xie at intel.com>
> Sent: Thursday, July 20, 2023 3:08 PM
> To: devel at edk2.groups.io
> Cc: Dong, Guo <guo.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Rhodes, Sean
> <sean at starlabs.systems>; Lu, James <james.lu at intel.com>; Guo, Gua
> <gua.guo at intel.com>; Xie, Yuanhao <yuanhao.xie at 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.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Sean Rhodes <sean at starlabs.systems>
> Cc: James Lu <james.lu at intel.com>
> Cc: Gua Guo <gua.guo at intel.com>
> Signed-off-by: Yuanhao Xie <yuanhao.xie 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 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list