UefiCpuPkg/PiSmmCpuDxeSmm: Fix S3 failure in SmmRestoreCpu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4368

This issue is caused by the commit:
ec07fd0e35

GetFirstGuidHob() should not be used after exit boot service.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Wu, Jiaxin 2023-03-13 15:03:57 +08:00 committed by mergify[bot]
parent e4c1d8d231
commit a1386bb252
1 changed files with 1 additions and 13 deletions

View File

@ -823,19 +823,7 @@ SmmRestoreCpu (
InitializeCpuBeforeRebase ();
}
//
// Make sure the gSmmBaseHobGuid existence status is the same between normal and S3 boot.
//
ASSERT (mSmmRelocated == (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid) != NULL));
if (mSmmRelocated != (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid) != NULL)) {
DEBUG ((
DEBUG_ERROR,
"gSmmBaseHobGuid %a produced in normal boot but %a in S3 boot!",
mSmmRelocated ? "is" : "is not",
mSmmRelocated ? "is not" : "is"
));
CpuDeadLoop ();
}
DEBUG ((DEBUG_INFO, "SmmRestoreCpu: mSmmRelocated is %d\n", mSmmRelocated));
//
// Check whether Smm Relocation is done or not.