[PATCH v2 0/3] Put AP into safe hlt-loop code on S3 path

Jeff Fan <jeff.fan@...>

On S3 path, we will wake up APs to restore CPU context in PiSmmCpuDxeSmm
driver. In case, one NMI or SMI happens, APs may exit from hlt state and
execute the instruction after HLT instruction.

But APs are not running on safe code, it leads OVMF S3 boot unstable.


I tested real platform with 64bit DXE.

1. Make stack alignment per Laszlo's comment.
2. Trim whitespace at end of end per Laszlo's comment.
3. Update year mark in file header.
4. Enhancement on InterlockedDecrement() per Paolo's comment.

Jeff Fan (3):
UefiCpuPkg/PiSmmCpuDxeSmm: Put AP into safe hlt-loop code on S3 path
UefiCpuPkg/PiSmmCpuDxeSmm: Place AP to 32bit protected mode on S3 path
UefiCpuPkg/PiSmmCpuDxeSmm: Decrease mNumberToFinish in AP safe code

UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 33 +++++++++++++-
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c | 29 +++++++++++-
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 15 +++++++
UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c | 63 ++++++++++++++++++++++++++-
4 files changed, 136 insertions(+), 4 deletions(-)


Join {devel@edk2.groups.io to automatically receive all group messages.