summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Universal
diff options
context:
space:
mode:
authorDun Tan <dun.tan@intel.com>2023-07-21 17:44:08 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-09-08 06:19:34 +0000
commit48de494bb4befce3b1c466c4ec132540d504047f (patch)
tree26d32379184f016e345fe2ae498e0ec93dd92f25 /UefiCpuPkg/Universal
parentbc19f50c7076917e6b74f3bf0d7839c0d0cceb9d (diff)
downloadedk2-48de494bb4befce3b1c466c4ec132540d504047f.tar.gz
edk2-48de494bb4befce3b1c466c4ec132540d504047f.tar.bz2
edk2-48de494bb4befce3b1c466c4ec132540d504047f.zip
UefiCpuPkg/S3Resume2Pei: assert for invalid excution mode combo
Add assert for invalid excution mode combination of 64bit PEI + 32bit DXE. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com>
Diffstat (limited to 'UefiCpuPkg/Universal')
-rw-r--r--UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index 1fd5670c7f..4cf676fb3e 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -1107,6 +1107,13 @@ S3RestoreConfig2 (
DEBUG ((DEBUG_INFO, "SMM S3 Smst = %x\n", SmmS3ResumeState->Smst));
//
+ // 64bit PEI and 32bit DXE is not a supported combination.
+ //
+ if (SmmS3ResumeState->Signature == SMM_S3_RESUME_SMM_32) {
+ ASSERT (sizeof (UINTN) == sizeof (UINT32));
+ }
+
+ //
// Directly do the switch stack when PEI and SMM env run in the same execution mode.
//
if (((SmmS3ResumeState->Signature == SMM_S3_RESUME_SMM_32) && (sizeof (UINTN) == sizeof (UINT32))) ||