From 48de494bb4befce3b1c466c4ec132540d504047f Mon Sep 17 00:00:00 2001 From: Dun Tan Date: Fri, 21 Jul 2023 17:44:08 +0800 Subject: 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 Cc: Eric Dong Reviewed-by: Ray Ni Cc: Rahul Kumar --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 @@ -1106,6 +1106,13 @@ S3RestoreConfig2 ( DEBUG ((DEBUG_INFO, "SMM S3 Return Stack Pointer = %x\n", SmmS3ResumeState->ReturnStackPointer)); 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. // -- cgit v1.2.3