UefiCpuPkg/MpInitLib: Fix S3 resume hang issue.
authorEric Dong <eric.dong@intel.com>
Wed, 27 Jun 2018 08:42:51 +0000 (16:42 +0800)
committerEric Dong <eric.dong@intel.com>
Thu, 19 Jul 2018 05:06:49 +0000 (13:06 +0800)
commit58942277bcbf41abda5f6e3a1c89d571105d5983
treeb062713fd02c90e99bdedba15f98d305a881fe91
parentf63a3e286765f47b79a73d56f8d687c4f3733979
UefiCpuPkg/MpInitLib: Fix S3 resume hang issue.

When resume from S3 and CPU loop mode is MWait mode,
if driver calls APs to do task at EndOfPei point, the
APs can't been wake up and bios hang at that point.

The root cause is PiSmmCpuDxeSmm driver wakes up APs
with HLT mode during S3 resume phase to do SMM relocation.
After this task, PiSmmCpuDxeSmm driver not restore APs
context which make CpuMpPei driver saved wake up buffer
not works.

The solution for this issue is let CpuMpPei driver hook
S3SmmInitDone ppi notification. In this notify function,
it check whether Cpu Loop mode is not HLT mode. If yes,
CpuMpPei driver will set a flag to force BSP use INIT-SIPI
-SIPI command to wake up the APs.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
UefiCpuPkg/Library/MpInitLib/MpLib.c
UefiCpuPkg/Library/MpInitLib/MpLib.h
UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
UefiCpuPkg/Library/MpInitLib/PeiMpLib.c