audk/UefiCpuPkg/Include
Jiaxin Wu ba822d2851 UefiCpuPkg: Adds SmmCpuSyncLib library class
Intel is planning to provide different SMM CPU Sync implementation
along with some specific registers to improve the SMI performance,
hence need SmmCpuSyncLib Library for Intel.

This patch is to:
1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec.
2.Adds SmmCpuSyncLib.h function declaration header file.

For the new SmmCpuSyncLib, it provides 3 sets of APIs:

1. ContextInit/ContextDeinit/ContextReset:
ContextInit() is called in driver's entrypoint to allocate and
initialize the SMM CPU Sync context. ContextDeinit() is called in
driver's unload function to deinitialize SMM CPU Sync context.
ContextReset() is called before CPU exist SMI, which allows CPU to
check into the next SMI from this point.

2. GetArrivedCpuCount/CheckInCpu/CheckOutCpu/LockDoor:
When SMI happens, all processors including BSP enter to SMM mode by
calling CheckInCpu(). The elected BSP calls LockDoor() so that
CheckInCpu() will return the error code after that. CheckOutCpu() can
be called in error handling flow for the CPU who calls CheckInCpu()
earlier. GetArrivedCpuCount() returns the number of checked-in CPUs.

3. WaitForAPs/ReleaseOneAp/WaitForBsp/ReleaseBsp
WaitForAPs() & ReleaseOneAp() are called from BSP to wait the number
of APs and release one specific AP. WaitForBsp() & ReleaseBsp() are
called from APs to wait and release BSP. The 4 APIs are used to
synchronize the running flow among BSP and APs. BSP and AP Sync flow
can be easy understand as below:
BSP: ReleaseOneAp  -->  AP: WaitForBsp
BSP: WaitForAPs    <--  AP: ReleaseBsp

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-20 02:30:56 +00:00
..
Guid UefiCpuPkg: Add a new field in MpInfo2 HOB 2023-12-12 01:37:41 +00:00
Library UefiCpuPkg: Adds SmmCpuSyncLib library class 2023-12-20 02:30:56 +00:00
Ppi UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Protocol UefiCpuPkg: Add RISCV_EFI_BOOT_PROTOCOL related definitions 2023-02-16 05:53:28 +00:00
Register UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
AcpiCpuData.h UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuHotPlugData.h UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
StuffRsbNasm.inc UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00