From: "Zhang, Hongbin1" <hongbin1.zhang@intel.com>
To: devel@edk2.groups.io
Cc: "Zhang, Hongbin1" <hongbin1.zhang@intel.com>,
Jiewen Yao <jiewen.yao@intel.com>, Ray Ni <ray.ni@intel.com>,
Star Zeng <star.zeng@intel.com>, Jiaxin Wu <jiaxin.wu@intel.com>,
Sami Mujawar <sami.mujawar@arm.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Subject: [PATCH v4 4/5] StandaloneMmPkg: Add StandaloneMmIplPei driver.
Date: Mon, 19 Jun 2023 15:46:38 +0800 [thread overview]
Message-ID: <20230619074639.1569-4-hongbin1.zhang@intel.com> (raw)
In-Reply-To: <20230619074639.1569-1-hongbin1.zhang@intel.com>
Add StandaloneMmIplPei IA32/X64 driver at PEI stage.
FSP will use this driver to load Standalone MM code
to dispatch other Standalone MM drivers.
Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
---
StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c
index 47cc18ecbd..0d0c678f90 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c
@@ -400,8 +400,17 @@ ExecuteSmmCoreFromSmram (
DEBUG ((DEBUG_INFO, "SMM IPL calling Standalone MM Core at SMRAM address - 0x%016lx\n", gMmCorePrivate->MmCoreEntryPoint));
//
- // If StandaloneMmIpl driver is IA32 image, but Standalone MM core is X64 image
- // Switch 32 bit protect mode to X64 mode and load SMM core
+ // If StandaloneMmIpl driver is X64 image, but Standalone MM core is IA32 image
+ // This case is not supported
+ //
+ if ((sizeof (UINTN) == sizeof (UINT64)) && (ImageContext.Machine == EFI_IMAGE_MACHINE_IA32)) {
+ DEBUG ((DEBUG_ERROR, "X64 SMM IPL call IA32 MM core is not supported !\n"));
+ CpuDeadLoop ();
+ }
+
+ //
+ // If StandaloneMmIpl driver is IA32 image, but Standalone MM core is X64 image,
+ // Switch 32 bit protect mode to X64 mode and load SMM core.
//
if ((sizeof (UINTN) == sizeof (UINT32)) && (ImageContext.Machine == EFI_IMAGE_MACHINE_X64)) {
//
--
2.37.0.windows.1
next prev parent reply other threads:[~2023-06-19 7:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 7:46 [PATCH v4 1/5] StandaloneMmPkg: Add StandaloneMmIplPei driver Zhang, Hongbin1
2023-06-19 7:46 ` [PATCH v4 2/5] " Zhang, Hongbin1
2023-06-19 7:46 ` [PATCH v4 3/5] " Zhang, Hongbin1
2023-06-19 7:46 ` Zhang, Hongbin1 [this message]
2023-06-19 7:46 ` [PATCH v4 5/5] " Zhang, Hongbin1
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=20230619074639.1569-4-hongbin1.zhang@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