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.zh...@intel.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Ray Ni <ray...@intel.com>
Cc: Star Zeng <star.z...@intel.com>
Cc: Jiaxin Wu <jiaxin...@intel.com>
Cc: Sami Mujawar <sami.muja...@arm.com>
Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Supreeth Venkatesh <supreeth.venkat...@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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106193): https://edk2.groups.io/g/devel/message/106193
Mute This Topic: https://groups.io/mt/99640661/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to