[edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Fix S3 failure in SmmRestoreCpu

Ni, Ray ray.ni at intel.com
Mon Mar 13 08:44:24 UTC 2023


Jiaxin,
Thanks for fixing the bug.

Reviewed-by: Ray Ni <ray.ni at intel.com> 

> -----Original Message-----
> From: Wu, Jiaxin <jiaxin.wu at intel.com>
> Sent: Monday, March 13, 2023 3:04 PM
> To: devel at edk2.groups.io
> Cc: Dong, Eric <eric.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Zeng, Star
> <star.zeng at intel.com>; Laszlo Ersek <lersek at redhat.com>; Gerd Hoffmann
> <kraxel at redhat.com>
> Subject: [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Fix S3 failure in
> SmmRestoreCpu
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4368
> 
> This issue is caused by the commit:
> ec07fd0e35d90dbcc36be300a9ceeac29c5de2ad
> 
> GetFirstGuidHob() should not be used after exit boot service.
> 
> Cc: Eric Dong <eric.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Zeng Star <star.zeng at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> Signed-off-by: Jiaxin Wu <jiaxin.wu at intel.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> index d408b3f9f7..240eee6a7d 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> @@ -821,23 +821,11 @@ SmmRestoreCpu (
>      // First time microcode load and restore MTRRs
>      //
>      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.
>    // If not, will do the SmmBases Relocation here!!!
>    //
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101085): https://edk2.groups.io/g/devel/message/101085
Mute This Topic: https://groups.io/mt/97575696/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list