public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Support 64bit FspResetType in X64 build.
@ 2022-07-19  4:42 Chiu, Chasel
  2022-07-19  4:42 ` [PATCH 1/2] IntelFsp2Pkg: Support 64bit FspResetType for " Chiu, Chasel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chiu, Chasel @ 2022-07-19  4:42 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3999
FspResetType will be either 32bit or 64 bit basing on
the build type

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>

Chasel Chiu (2):
  IntelFsp2Pkg: Support 64bit FspResetType for X64 build.
  IntelFsp2WrapperPkg: Support 64bit FspResetType for X64 build.

 IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c                                      | 10 +++++-----
 IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c                             |  6 +++---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c                                     | 10 +++++-----
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c                                     | 15 +++++++--------
 IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c                    |  5 ++++-
 IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c |  2 +-
 IntelFsp2Pkg/Include/FspEas/FspApi.h                                                      | 61 +++++++++++++++++++++++++++++++++----------------------------
 IntelFsp2Pkg/Include/Library/FspCommonLib.h                                               |  2 +-
 IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h                                          |  4 ++--
 IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h                               |  2 +-
 10 files changed, 62 insertions(+), 55 deletions(-)

--
2.35.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] IntelFsp2Pkg: Support 64bit FspResetType for X64 build.
  2022-07-19  4:42 [PATCH 0/2] Support 64bit FspResetType in X64 build Chiu, Chasel
@ 2022-07-19  4:42 ` Chiu, Chasel
  2022-07-19  4:42 ` [PATCH 2/2] IntelFsp2WrapperPkg: " Chiu, Chasel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Chiu, Chasel @ 2022-07-19  4:42 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3999
FspResetType will be either 32bit or 64 bit basing on
the build type.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
 IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c | 10 +++++-----
 IntelFsp2Pkg/Include/FspEas/FspApi.h                 | 61 +++++++++++++++++++++++++++++++++----------------------------
 IntelFsp2Pkg/Include/Library/FspCommonLib.h          |  2 +-
 IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h     |  4 ++--
 4 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
index 67e08a9e7e..a22b0e7825 100644
--- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
+++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
@@ -200,13 +200,13 @@ SetFspCoreStackPointer (
   UINT32           StackContextLen;
 
   FspData         = GetFspGlobalDataPointer ();
-  StackContextLen = sizeof(CONTEXT_STACK) / sizeof(UINTN);
+  StackContextLen = sizeof (CONTEXT_STACK) / sizeof (UINTN);
 
   //
   // Reserve space for the ContinuationFunc two parameters
   //
-  OldStack = (UINTN *)FspData->CoreStack;
-  NewStack = (UINTN *)NewStackTop - StackContextLen - 2;
+  OldStack           = (UINTN *)FspData->CoreStack;
+  NewStack           = (UINTN *)NewStackTop - StackContextLen - 2;
   FspData->CoreStack = (UINTN)NewStack;
   while (StackContextLen-- != 0) {
     *NewStack++ = *OldStack++;
@@ -533,7 +533,7 @@ SetPhaseStatusCode (
 VOID
 EFIAPI
 FspApiReturnStatusReset (
-  IN UINT32  FspResetType
+  IN EFI_STATUS  FspResetType
   )
 {
   volatile BOOLEAN  LoopUntilReset;
@@ -546,7 +546,7 @@ FspApiReturnStatusReset (
     /// calls the FSP API without honoring the reset request by FSP
     ///
     do {
-      SetFspApiReturnStatus ((EFI_STATUS)FspResetType);
+      SetFspApiReturnStatus (FspResetType);
       Pei2LoaderSwitchStack ();
       DEBUG ((DEBUG_ERROR, "!!!ERROR: FSP has requested BootLoader for reset. But BootLoader has not honored the reset\n"));
       DEBUG ((DEBUG_ERROR, "!!!ERROR: Please add support in BootLoader to honor the reset request from FSP\n"));
diff --git a/IntelFsp2Pkg/Include/FspEas/FspApi.h b/IntelFsp2Pkg/Include/FspEas/FspApi.h
index b36bc2b9ae..5e47f475db 100644
--- a/IntelFsp2Pkg/Include/FspEas/FspApi.h
+++ b/IntelFsp2Pkg/Include/FspEas/FspApi.h
@@ -11,19 +11,24 @@
 #define _FSP_API_H_
 
 #include <Pi/PiStatusCode.h>
+#include <Base.h>
 
 ///
 /// FSP Reset Status code
-/// These are defined in FSP EAS v2.0 section 11.2.2 - OEM Status Code
+/// These are defined in FSP EAS v2.4 section 13.2.2 - OEM Status Code
 /// @{
-#define FSP_STATUS_RESET_REQUIRED_COLD  0x40000001
-#define FSP_STATUS_RESET_REQUIRED_WARM  0x40000002
-#define FSP_STATUS_RESET_REQUIRED_3     0x40000003
-#define FSP_STATUS_RESET_REQUIRED_4     0x40000004
-#define FSP_STATUS_RESET_REQUIRED_5     0x40000005
-#define FSP_STATUS_RESET_REQUIRED_6     0x40000006
-#define FSP_STATUS_RESET_REQUIRED_7     0x40000007
-#define FSP_STATUS_RESET_REQUIRED_8     0x40000008
+
+#define ENCODE_RESET_REQUEST(ResetType)  \
+        ((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))
+#define FSP_STATUS_RESET_REQUIRED_COLD  ENCODE_RESET_REQUEST(1)
+#define FSP_STATUS_RESET_REQUIRED_WARM  ENCODE_RESET_REQUEST(2)
+#define FSP_STATUS_RESET_REQUIRED_3     ENCODE_RESET_REQUEST(3)
+#define FSP_STATUS_RESET_REQUIRED_4     ENCODE_RESET_REQUEST(4)
+#define FSP_STATUS_RESET_REQUIRED_5     ENCODE_RESET_REQUEST(5)
+#define FSP_STATUS_RESET_REQUIRED_6     ENCODE_RESET_REQUEST(6)
+#define FSP_STATUS_RESET_REQUIRED_7     ENCODE_RESET_REQUEST(7)
+#define FSP_STATUS_RESET_REQUIRED_8     ENCODE_RESET_REQUEST(8)
+#define FSP_STATUS_VARIABLE_REQUEST     ENCODE_RESET_REQUEST(10)
 /// @}
 
 ///
@@ -135,18 +140,18 @@ typedef struct {
   ///
   /// Revision of the structure is 2 for this version of the specification.
   ///
-  UINT8                Revision;
-  UINT8                Reserved[3];
+  UINT8                   Revision;
+  UINT8                   Reserved[3];
   ///
   /// Length of the structure in bytes. The current value for this field is 32.
   ///
-  UINT32               Length;
+  UINT32                  Length;
   ///
   /// FspDebugHandler Optional debug handler for the bootloader to receive debug messages
   /// occurring during FSP execution.
   ///
-  EFI_PHYSICAL_ADDRESS FspDebugHandler;
-  UINT8                Reserved1[16];
+  EFI_PHYSICAL_ADDRESS    FspDebugHandler;
+  UINT8                   Reserved1[16];
 } FSPT_ARCH2_UPD;
 
 ///
@@ -197,37 +202,37 @@ typedef struct {
   ///
   /// Revision of the structure is 3 for this version of the specification.
   ///
-  UINT8                Revision;
-  UINT8                Reserved[3];
+  UINT8                   Revision;
+  UINT8                   Reserved[3];
   ///
   /// Length of the structure in bytes. The current value for this field is 64.
   ///
-  UINT32               Length;
+  UINT32                  Length;
   ///
   /// Pointer to the temporary stack base address to be
   /// consumed inside FspMemoryInit() API.
   ///
-  EFI_PHYSICAL_ADDRESS StackBase;
+  EFI_PHYSICAL_ADDRESS    StackBase;
   ///
   /// Temporary stack size to be consumed inside
   /// FspMemoryInit() API.
   ///
-  UINT64               StackSize;
+  UINT64                  StackSize;
   ///
   /// Size of memory to be reserved by FSP below "top
   /// of low usable memory" for bootloader usage.
   ///
-  UINT32               BootLoaderTolumSize;
+  UINT32                  BootLoaderTolumSize;
   ///
   /// Current boot mode.
   ///
-  UINT32               BootMode;
+  UINT32                  BootMode;
   ///
   /// Optional event handler for the bootloader to be informed of events occurring during FSP execution.
   /// This value is only valid if Revision is >= 2.
   ///
-  EFI_PHYSICAL_ADDRESS FspEventHandler;
-  UINT8                Reserved1[24];
+  EFI_PHYSICAL_ADDRESS    FspEventHandler;
+  UINT8                   Reserved1[24];
 } FSPM_ARCH2_UPD;
 
 ///
@@ -266,18 +271,18 @@ typedef struct {
   ///
   /// Revision of the structure is 2 for this version of the specification.
   ///
-  UINT8                Revision;
-  UINT8                Reserved[3];
+  UINT8                   Revision;
+  UINT8                   Reserved[3];
   ///
   /// Length of the structure in bytes. The current value for this field is 32.
   ///
-  UINT32               Length;
+  UINT32                  Length;
   ///
   /// FspEventHandler Optional event handler for the bootloader to be informed of events
   /// occurring during FSP execution.
   ///
-  EFI_PHYSICAL_ADDRESS FspEventHandler;
-  UINT8                Reserved1[16];
+  EFI_PHYSICAL_ADDRESS    FspEventHandler;
+  UINT8                   Reserved1[16];
 } FSPS_ARCH2_UPD;
 
 ///
diff --git a/IntelFsp2Pkg/Include/Library/FspCommonLib.h b/IntelFsp2Pkg/Include/Library/FspCommonLib.h
index b5e38568e2..13b67f8822 100644
--- a/IntelFsp2Pkg/Include/Library/FspCommonLib.h
+++ b/IntelFsp2Pkg/Include/Library/FspCommonLib.h
@@ -302,7 +302,7 @@ SetPhaseStatusCode (
 VOID
 EFIAPI
 FspApiReturnStatusReset (
-  IN UINT32  FspResetType
+  IN EFI_STATUS  FspResetType
   );
 
 #endif
diff --git a/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h b/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h
index f049361d78..ff66e48ae2 100644
--- a/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h
+++ b/IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h
@@ -30,7 +30,7 @@
 
 
 **/
-UINT32
+EFI_STATUS
 EFIAPI
 Pei2LoaderSwitchStack (
   VOID
@@ -46,7 +46,7 @@ Pei2LoaderSwitchStack (
 
 
 **/
-UINT32
+EFI_STATUS
 EFIAPI
 Loader2PeiSwitchStack (
   VOID
-- 
2.35.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] IntelFsp2WrapperPkg: Support 64bit FspResetType for X64 build.
  2022-07-19  4:42 [PATCH 0/2] Support 64bit FspResetType in X64 build Chiu, Chasel
  2022-07-19  4:42 ` [PATCH 1/2] IntelFsp2Pkg: Support 64bit FspResetType for " Chiu, Chasel
@ 2022-07-19  4:42 ` Chiu, Chasel
  2022-07-19 20:59 ` [PATCH 0/2] Support 64bit FspResetType in " Nate DeSimone
  2022-07-19 22:27 ` Chiu, Chasel
  3 siblings, 0 replies; 5+ messages in thread
From: Chiu, Chasel @ 2022-07-19  4:42 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3999
FspResetType will be either 32bit or 64 bit basing on
the build type.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
 IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c                             |  6 +++---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c                                     | 10 +++++-----
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c                                     | 15 +++++++--------
 IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c                    |  5 ++++-
 IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c |  2 +-
 IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h                               |  2 +-
 6 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
index 21385ac0b2..7aa2c93e99 100644
--- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
+++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
@@ -97,7 +97,7 @@ OnPciEnumerationComplete (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   if (Status != EFI_SUCCESS) {
@@ -140,7 +140,7 @@ OnReadyToBoot (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   if (Status != EFI_SUCCESS) {
@@ -184,7 +184,7 @@ OnEndOfFirmware (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   if (Status != EFI_SUCCESS) {
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 047c2965a3..ac27524d08 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -43,16 +43,15 @@ extern EFI_GUID  gFspHobGuid;
 
   @return FSP-M UPD Data Address
 **/
-
 UINTN
 GetFspmUpdDataAddress (
   VOID
   )
 {
   if (PcdGet64 (PcdFspmUpdDataAddress64) != 0) {
-    return (UINTN) PcdGet64 (PcdFspmUpdDataAddress64);
+    return (UINTN)PcdGet64 (PcdFspmUpdDataAddress64);
   } else {
-    return (UINTN) PcdGet32 (PcdFspmUpdDataAddress);
+    return (UINTN)PcdGet32 (PcdFspmUpdDataAddress);
   }
 }
 
@@ -97,7 +96,7 @@ PeiFspMemoryInit (
     //
     // External UPD is ready, get the buffer from PCD pointer.
     //
-    FspmUpdDataPtr = (VOID *) GetFspmUpdDataAddress();
+    FspmUpdDataPtr = (VOID *)GetFspmUpdDataAddress ();
     ASSERT (FspmUpdDataPtr != NULL);
   }
 
@@ -115,6 +114,7 @@ PeiFspMemoryInit (
     DEBUG ((DEBUG_INFO, "  BootLoaderTolumSize - 0x%x\n", ((FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootLoaderTolumSize));
     DEBUG ((DEBUG_INFO, "  BootMode            - 0x%x\n", ((FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootMode));
   }
+
   DEBUG ((DEBUG_INFO, "  HobListPtr          - 0x%x\n", &FspHobListPtr));
 
   TimeStampCounterStart = AsmReadTsc ();
@@ -129,7 +129,7 @@ PeiFspMemoryInit (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   if (EFI_ERROR (Status)) {
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
index fadadd40e6..ee48dd69d3 100644
--- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
@@ -96,7 +96,7 @@ S3EndOfPeiNotify (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   NotifyPhaseParams.Phase = EnumInitPhaseReadyToBoot;
@@ -108,7 +108,7 @@ S3EndOfPeiNotify (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   NotifyPhaseParams.Phase = EnumInitPhaseEndOfFirmware;
@@ -120,7 +120,7 @@ S3EndOfPeiNotify (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   return EFI_SUCCESS;
@@ -186,16 +186,15 @@ FspSiliconInitDoneGetFspHobList (
 
   @return FSP-S UPD Data Address
 **/
-
 UINTN
 GetFspsUpdDataAddress (
   VOID
   )
 {
   if (PcdGet64 (PcdFspsUpdDataAddress64) != 0) {
-    return (UINTN) PcdGet64 (PcdFspsUpdDataAddress64);
+    return (UINTN)PcdGet64 (PcdFspsUpdDataAddress64);
   } else {
-    return (UINTN) PcdGet32 (PcdFspsUpdDataAddress);
+    return (UINTN)PcdGet32 (PcdFspsUpdDataAddress);
   }
 }
 
@@ -310,7 +309,7 @@ PeiMemoryDiscoveredNotify (
     SourceData = (UINTN *)((UINTN)FspsHeaderPtr->ImageBase + (UINTN)FspsHeaderPtr->CfgRegionOffset);
     CopyMem (FspsUpdDataPtr, SourceData, (UINTN)FspsHeaderPtr->CfgRegionSize);
   } else {
-    FspsUpdDataPtr = (FSPS_UPD_COMMON *) GetFspsUpdDataAddress();
+    FspsUpdDataPtr = (FSPS_UPD_COMMON *)GetFspsUpdDataAddress ();
     ASSERT (FspsUpdDataPtr != NULL);
   }
 
@@ -327,7 +326,7 @@ PeiMemoryDiscoveredNotify (
   //
   if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
     DEBUG ((DEBUG_INFO, "FspSiliconInitApi requested reset 0x%x\n", Status));
-    CallFspWrapperResetSystem ((UINT32)Status);
+    CallFspWrapperResetSystem (Status);
   }
 
   if (EFI_ERROR (Status)) {
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
index 591a5c7a55..22e009ace3 100644
--- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
+++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
@@ -121,6 +121,10 @@ Execute32BitCode (
   //
   AsmReadIdtr (&Idtr);
   Status = AsmExecute32BitCode (Function, Param1, Param2, &mGdt);
+  //
+  // Convert FSP Status code from 32bit to 64bit to match caller expectation.
+  //
+  Status = (Status & ~(BIT31 + BIT30)) | LShiftU64 (Status & (BIT31 + BIT30), 32);
   AsmWriteIdtr (&Idtr);
 
   return Status;
@@ -150,4 +154,3 @@ Execute64BitCode (
 
   return Status;
 }
-
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c
index fa7d60c292..00b4799fb4 100644
--- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c
+++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c
@@ -86,7 +86,7 @@ GetS3MemoryInfo (
 VOID
 EFIAPI
 CallFspWrapperResetSystem (
-  IN UINT32  FspStatusResetType
+  IN EFI_STATUS  FspStatusResetType
   )
 {
   //
diff --git a/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h b/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h
index a6ade2551e..fe9f0d7408 100644
--- a/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h
+++ b/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h
@@ -74,7 +74,7 @@ GetS3MemoryInfo (
 VOID
 EFIAPI
 CallFspWrapperResetSystem (
-  IN UINT32  FspStatusResetType
+  IN EFI_STATUS  FspStatusResetType
   );
 
 #endif
-- 
2.35.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Support 64bit FspResetType in X64 build.
  2022-07-19  4:42 [PATCH 0/2] Support 64bit FspResetType in X64 build Chiu, Chasel
  2022-07-19  4:42 ` [PATCH 1/2] IntelFsp2Pkg: Support 64bit FspResetType for " Chiu, Chasel
  2022-07-19  4:42 ` [PATCH 2/2] IntelFsp2WrapperPkg: " Chiu, Chasel
@ 2022-07-19 20:59 ` Nate DeSimone
  2022-07-19 22:27 ` Chiu, Chasel
  3 siblings, 0 replies; 5+ messages in thread
From: Nate DeSimone @ 2022-07-19 20:59 UTC (permalink / raw)
  To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Zeng, Star

For the series...

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Monday, July 18, 2022 9:42 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH 0/2] Support 64bit FspResetType in X64 build.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3999
> FspResetType will be either 32bit or 64 bit basing on the build type
> 
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> 
> Chasel Chiu (2):
>   IntelFsp2Pkg: Support 64bit FspResetType for X64 build.
>   IntelFsp2WrapperPkg: Support 64bit FspResetType for X64 build.
> 
>  IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
> | 10 +++++-----
>  IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> |  6 +++---
>  IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> | 10 +++++-----
>  IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> | 15 +++++++--------
> 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.
> c                    |  5 ++++-
> 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrap
> perPlatformLibSample.c |  2 +-
>  IntelFsp2Pkg/Include/FspEas/FspApi.h                                                      | 61
> +++++++++++++++++++++++++++++++++----------------------------
>  IntelFsp2Pkg/Include/Library/FspCommonLib.h                                               |  2 +-
>  IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h                                          |  4
> ++--
>  IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h
> |  2 +-
>  10 files changed, 62 insertions(+), 55 deletions(-)
> 
> --
> 2.35.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Support 64bit FspResetType in X64 build.
  2022-07-19  4:42 [PATCH 0/2] Support 64bit FspResetType in X64 build Chiu, Chasel
                   ` (2 preceding siblings ...)
  2022-07-19 20:59 ` [PATCH 0/2] Support 64bit FspResetType in " Nate DeSimone
@ 2022-07-19 22:27 ` Chiu, Chasel
  3 siblings, 0 replies; 5+ messages in thread
From: Chiu, Chasel @ 2022-07-19 22:27 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Desimone, Nathaniel L, Zeng, Star

patch series merged:
https://github.com/tianocore/edk2/commit/140446cd595cad870a0e8cef7a367bae8f09effa
https://github.com/tianocore/edk2/commit/24eac4caf31afae48349af44588a52783c1819b8

Thanks,
Chasel


> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Monday, July 18, 2022 9:42 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH 0/2] Support 64bit FspResetType in X64 build.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3999
> FspResetType will be either 32bit or 64 bit basing on the build type
> 
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> 
> Chasel Chiu (2):
>   IntelFsp2Pkg: Support 64bit FspResetType for X64 build.
>   IntelFsp2WrapperPkg: Support 64bit FspResetType for X64 build.
> 
>  IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
> | 10 +++++-----
>  IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> |  6 +++---
>  IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> | 10 +++++-----
>  IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> | 15 +++++++--------
>  IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
> |  5 ++++-
> 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperP
> latformLibSample.c |  2 +-
>  IntelFsp2Pkg/Include/FspEas/FspApi.h                                                      | 61
> +++++++++++++++++++++++++++++++++----------------------------
>  IntelFsp2Pkg/Include/Library/FspCommonLib.h                                               |  2 +-
>  IntelFsp2Pkg/Include/Library/FspSwitchStackLib.h                                          |  4 ++-
> -
>  IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h
> |  2 +-
>  10 files changed, 62 insertions(+), 55 deletions(-)
> 
> --
> 2.35.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-19 22:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19  4:42 [PATCH 0/2] Support 64bit FspResetType in X64 build Chiu, Chasel
2022-07-19  4:42 ` [PATCH 1/2] IntelFsp2Pkg: Support 64bit FspResetType for " Chiu, Chasel
2022-07-19  4:42 ` [PATCH 2/2] IntelFsp2WrapperPkg: " Chiu, Chasel
2022-07-19 20:59 ` [PATCH 0/2] Support 64bit FspResetType in " Nate DeSimone
2022-07-19 22:27 ` Chiu, Chasel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox