audk/UefiCpuPkg/Library/MpInitLib
Xie, Yuanhao 964a4f032d UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence.
When both the PEI and DXE phases operate in the same execution
mode(32-bit/64-bit), the BSP send a special start-up signal during
the DXE phase to awaken the Application APs.

To eliminate the need for the INIT-SIPI-SIPI sequence at the beginning
of the DXE phase, the BSP call the SwitchApContext function to trigger
the special  start-up signal. By writing the specified
StartupSignalValue to the designated StartupSignalAddress, the BSP
wakes up the APs from mwait mode. Once the APs receive the
MP_HAND_OFF_SIGNAL value, they are awakened and proceed to execute the
SwitchContextPerAp procedure. They enter another while loop,
transitioning their context from the PEI phase to the DXE phase.

The original state transitions for an AP during the procedure are as
follows:
Idle ----> Ready ----> Busy ----> Idle
      [BSP]      [AP]      [AP]

Instead of init-sipi-sipi sequence, we make use of a
start-up signal to awaken the APs and transfer their context from
PEI to DXE. Consequently, APs, rather than the BSP, to set their state
to CpuStateReady.

Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
2023-07-11 02:47:27 +00:00
..
Ia32 UefiCpuPkg: ApWakeupFunction directly use CpuMpData. 2023-07-11 02:47:27 +00:00
X64 UefiCpuPkg: ApWakeupFunction directly use CpuMpData. 2023-07-11 02:47:27 +00:00
AmdSev.c UefiCpuPkg: Create MpHandOff. 2023-07-11 02:47:27 +00:00
DxeMpInitLib.inf UefiCpuPkg: Create MpHandOff. 2023-07-11 02:47:27 +00:00
DxeMpInitLib.uni
DxeMpLib.c UefiCpuPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
Microcode.c UefiCpuPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
MpEqu.inc UefiCpuPkg: Rename AsmRelocateApLoopStart. 2023-03-07 08:14:59 +00:00
MpHandOff.h UefiCpuPkg: Create MpHandOff. 2023-07-11 02:47:27 +00:00
MpLib.c UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence. 2023-07-11 02:47:27 +00:00
MpLib.h UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence. 2023-07-11 02:47:27 +00:00
PeiMpInitLib.inf UefiCpuPkg: Create MpHandOff. 2023-07-11 02:47:27 +00:00
PeiMpInitLib.uni
PeiMpLib.c UefiCpuPkg: Create MpHandOff. 2023-07-11 02:47:27 +00:00