public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "duntan" <dun.tan@intel.com>
To: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
	Rahul Kumar <rahul1.kumar@intel.com>
Subject: [edk2-devel] [Patch V2 3/5] UefiCpuPkg/S3Resume2Pei: assert for invalid excution mode combo
Date: Mon, 21 Aug 2023 10:09:45 +0800	[thread overview]
Message-ID: <20230821020947.346-4-dun.tan@intel.com> (raw)
In-Reply-To: <20230821020947.346-1-dun.tan@intel.com>

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>
---
 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.
     //
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107903): https://edk2.groups.io/g/devel/message/107903
Mute This Topic: https://groups.io/mt/100866132/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2023-08-21  2:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  2:09 [edk2-devel] [Patch V2 0/5] Use MpService2Ppi to wakeup CPU in Smm CpuS3 duntan
2023-08-21  2:09 ` [edk2-devel] [Patch V2 1/5] MdeModulePkg: add MpService2Ppi field in SMM_S3_RESUME_STATE duntan
2023-08-21  2:09 ` [edk2-devel] [Patch V2 2/5] UefiCpuPkg/S3Resume2Pei: prepare MpService2Ppi in S3Resume duntan
2023-09-06  3:11   ` Ni, Ray
2023-08-21  2:09 ` duntan [this message]
2023-09-06  3:11   ` [edk2-devel] [Patch V2 3/5] UefiCpuPkg/S3Resume2Pei: assert for invalid excution mode combo Ni, Ray
2023-08-21  2:09 ` [edk2-devel] [Patch V2 4/5] UefiCpuPkg/PiSmmCpuDxe: code refinement for CpuS3.c duntan
2023-08-21  2:09 ` [edk2-devel] [Patch V2 5/5] UefiCpuPkg/PiSmmCpuDxe: use MpService2Ppi to wakeup AP in s3 duntan
     [not found] ` <177D440115CF68CB.15959@groups.io>
2023-09-06  3:22   ` [edk2-devel] [Patch V2 1/5] MdeModulePkg: add MpService2Ppi field in SMM_S3_RESUME_STATE duntan
2023-09-06  5:37     ` Ni, Ray
2023-09-07 15:02     ` Wang, Jian J

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230821020947.346-4-dun.tan@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox