public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib
@ 2023-07-12  6:24 Abdul Lateef Attar
  2023-07-12  6:24 ` [PATCH v1 1/1] " Abdul Lateef Attar
  0 siblings, 1 reply; 4+ messages in thread
From: Abdul Lateef Attar @ 2023-07-12  6:24 UTC (permalink / raw)
  To: devel
  Cc: Abdul Lateef Attar, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann,
	Abner Chang, Abdul Lateef Attar

PR: https://github.com/tianocore/edk2/pull/4625
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182

Use gMmst instead of gSmst.
Replace SmmServicesTableLib with MmServicesTableLib.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>

Abdul Lateef Attar (1):
  UefiCpuPkg: Uses gMmst in MmSaveStateLib

 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf   | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h           | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c        | 4 ++--
 UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c      | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c     | 8 ++++----
 6 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.25.1


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

* [PATCH v1 1/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib
  2023-07-12  6:24 [PATCH v1 0/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib Abdul Lateef Attar
@ 2023-07-12  6:24 ` Abdul Lateef Attar
  2023-07-12  7:42   ` Chang, Abner
  2023-07-17  8:57   ` [edk2-devel] " Ni, Ray
  0 siblings, 2 replies; 4+ messages in thread
From: Abdul Lateef Attar @ 2023-07-12  6:24 UTC (permalink / raw)
  To: devel
  Cc: Abdul Lateef Attar, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann,
	Abner Chang

From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182

Use gMmst instead of gSmst.
Replace SmmServicesTableLib with MmServicesTableLib.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Abner Chang <abner.chang@amd.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
---
 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf   | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h           | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c        | 4 ++--
 UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c      | 2 +-
 UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c     | 8 ++++----
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
index 5c0685f283d3..dcee6c401d30 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
+++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
@@ -31,4 +31,4 @@ [LibraryClasses]
   BaseLib
   BaseMemoryLib
   DebugLib
-  SmmServicesTableLib
+  MmServicesTableLib
diff --git a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
index b92dfa643203..b7fd4078f58a 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
+++ b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
@@ -31,4 +31,4 @@ [LibraryClasses]
   BaseLib
   BaseMemoryLib
   DebugLib
-  SmmServicesTableLib
+  MmServicesTableLib
diff --git a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
index c3499cbb3b17..6c7e8abd5f62 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
+++ b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
@@ -14,7 +14,7 @@
 #include <Protocol/MmCpu.h>
 #include <Library/DebugLib.h>
 #include <Library/MmSaveStateLib.h>
-#include <Library/SmmServicesTableLib.h>
+#include <Library/MmServicesTableLib.h>
 #include <Library/BaseMemoryLib.h>
 
 // Macro used to simplify the lookup table entries of type CPU_MM_SAVE_STATE_REGISTER_RANGE
diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
index 9fed52896f5c..3315a6cc44ff 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
+++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
@@ -108,7 +108,7 @@ MmSaveStateReadRegister (
   UINT8                      DataWidth;
 
   // Read CPU State
-  CpuSaveState = (AMD_SMRAM_SAVE_STATE_MAP *)gSmst->CpuSaveState[CpuIndex];
+  CpuSaveState = (AMD_SMRAM_SAVE_STATE_MAP *)gMmst->CpuSaveState[CpuIndex];
 
   // Check for special EFI_MM_SAVE_STATE_REGISTER_LMA
   if (Register == EFI_MM_SAVE_STATE_REGISTER_LMA) {
@@ -226,7 +226,7 @@ MmSaveStateWriteRegister (
     return EFI_NOT_FOUND;
   }
 
-  CpuSaveState = gSmst->CpuSaveState[CpuIndex];
+  CpuSaveState = gMmst->CpuSaveState[CpuIndex];
 
   //
   // Do not write non-writable SaveState, because it will cause exception.
diff --git a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
index fd321bb571d5..c2ccd65b1dc4 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
+++ b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
@@ -296,7 +296,7 @@ MmSaveStateWriteRegister (
     return EFI_NOT_FOUND;
   }
 
-  CpuSaveState = gSmst->CpuSaveState[CpuIndex];
+  CpuSaveState = gMmst->CpuSaveState[CpuIndex];
 
   //
   // Do not write non-writable SaveState, because it will cause exception.
diff --git a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
index 09c6c3f96fed..f66245b82c40 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
+++ b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
@@ -99,8 +99,8 @@ MmSaveStateReadRegisterByIndex (
     //
     // Write return buffer
     //
-    ASSERT (gSmst->CpuSaveState[CpuIndex] != NULL);
-    CopyMem (Buffer, (UINT8 *)gSmst->CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset32, Width);
+    ASSERT (gMmst->CpuSaveState[CpuIndex] != NULL);
+    CopyMem (Buffer, (UINT8 *)gMmst->CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset32, Width);
   } else {
     //
     // If 64-bit mode width is zero, then the specified register can not be accessed
@@ -119,12 +119,12 @@ MmSaveStateReadRegisterByIndex (
     //
     // Write lower 32-bits of return buffer
     //
-    CopyMem (Buffer, (UINT8 *)gSmst->CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset64Lo, MIN (4, Width));
+    CopyMem (Buffer, (UINT8 *)gMmst->CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset64Lo, MIN (4, Width));
     if (Width > 4) {
       //
       // Write upper 32-bits of return buffer
       //
-      CopyMem ((UINT8 *)Buffer + 4, (UINT8 *)gSmst->CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset64Hi, Width - 4);
+      CopyMem ((UINT8 *)Buffer + 4, (UINT8 *)gMmst->CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset64Hi, Width - 4);
     }
   }
 
-- 
2.25.1


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

* Re: [PATCH v1 1/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib
  2023-07-12  6:24 ` [PATCH v1 1/1] " Abdul Lateef Attar
@ 2023-07-12  7:42   ` Chang, Abner
  2023-07-17  8:57   ` [edk2-devel] " Ni, Ray
  1 sibling, 0 replies; 4+ messages in thread
From: Chang, Abner @ 2023-07-12  7:42 UTC (permalink / raw)
  To: Attar, AbdulLateef (Abdul Lateef), devel@edk2.groups.io
  Cc: Attar, AbdulLateef (Abdul Lateef), Eric Dong, Ray Ni, Rahul Kumar,
	Gerd Hoffmann

[AMD Official Use Only - General]

Acked-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Abdul Lateef Attar <abdattar@amd.com>
> Sent: Wednesday, July 12, 2023 2:24 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Eric
> Dong <eric.dong@intel.com>; Ray Ni <ray.ni@intel.com>; Rahul Kumar
> <rahul1.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Chang,
> Abner <Abner.Chang@amd.com>
> Subject: [PATCH v1 1/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib
>
> From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182
>
> Use gMmst instead of gSmst.
> Replace SmmServicesTableLib with MmServicesTableLib.
>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> ---
>  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf   | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h           | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c        | 4 ++--
>  UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c      | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c     | 8 ++++---
> -
>  6 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> index 5c0685f283d3..dcee6c401d30 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> @@ -31,4 +31,4 @@ [LibraryClasses]
>    BaseLib
>    BaseMemoryLib
>    DebugLib
> -  SmmServicesTableLib
> +  MmServicesTableLib
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> index b92dfa643203..b7fd4078f58a 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> @@ -31,4 +31,4 @@ [LibraryClasses]
>    BaseLib
>    BaseMemoryLib
>    DebugLib
> -  SmmServicesTableLib
> +  MmServicesTableLib
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> index c3499cbb3b17..6c7e8abd5f62 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> @@ -14,7 +14,7 @@
>  #include <Protocol/MmCpu.h>
>  #include <Library/DebugLib.h>
>  #include <Library/MmSaveStateLib.h>
> -#include <Library/SmmServicesTableLib.h>
> +#include <Library/MmServicesTableLib.h>
>  #include <Library/BaseMemoryLib.h>
>
>  // Macro used to simplify the lookup table entries of type
> CPU_MM_SAVE_STATE_REGISTER_RANGE
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> index 9fed52896f5c..3315a6cc44ff 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> @@ -108,7 +108,7 @@ MmSaveStateReadRegister (
>    UINT8                      DataWidth;
>
>    // Read CPU State
> -  CpuSaveState = (AMD_SMRAM_SAVE_STATE_MAP *)gSmst-
> >CpuSaveState[CpuIndex];
> +  CpuSaveState = (AMD_SMRAM_SAVE_STATE_MAP *)gMmst-
> >CpuSaveState[CpuIndex];
>
>    // Check for special EFI_MM_SAVE_STATE_REGISTER_LMA
>    if (Register == EFI_MM_SAVE_STATE_REGISTER_LMA) {
> @@ -226,7 +226,7 @@ MmSaveStateWriteRegister (
>      return EFI_NOT_FOUND;
>    }
>
> -  CpuSaveState = gSmst->CpuSaveState[CpuIndex];
> +  CpuSaveState = gMmst->CpuSaveState[CpuIndex];
>
>    //
>    // Do not write non-writable SaveState, because it will cause exception.
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> index fd321bb571d5..c2ccd65b1dc4 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> @@ -296,7 +296,7 @@ MmSaveStateWriteRegister (
>      return EFI_NOT_FOUND;
>    }
>
> -  CpuSaveState = gSmst->CpuSaveState[CpuIndex];
> +  CpuSaveState = gMmst->CpuSaveState[CpuIndex];
>
>    //
>    // Do not write non-writable SaveState, because it will cause exception.
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> index 09c6c3f96fed..f66245b82c40 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> @@ -99,8 +99,8 @@ MmSaveStateReadRegisterByIndex (
>      //
>      // Write return buffer
>      //
> -    ASSERT (gSmst->CpuSaveState[CpuIndex] != NULL);
> -    CopyMem (Buffer, (UINT8 *)gSmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset32, Width);
> +    ASSERT (gMmst->CpuSaveState[CpuIndex] != NULL);
> +    CopyMem (Buffer, (UINT8 *)gMmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset32, Width);
>    } else {
>      //
>      // If 64-bit mode width is zero, then the specified register can not be
> accessed
> @@ -119,12 +119,12 @@ MmSaveStateReadRegisterByIndex (
>      //
>      // Write lower 32-bits of return buffer
>      //
> -    CopyMem (Buffer, (UINT8 *)gSmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset64Lo, MIN (4, Width));
> +    CopyMem (Buffer, (UINT8 *)gMmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset64Lo, MIN (4, Width));
>      if (Width > 4) {
>        //
>        // Write upper 32-bits of return buffer
>        //
> -      CopyMem ((UINT8 *)Buffer + 4, (UINT8 *)gSmst-
> >CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset64Hi,
> Width - 4);
> +      CopyMem ((UINT8 *)Buffer + 4, (UINT8 *)gMmst-
> >CpuSaveState[CpuIndex] + mCpuWidthOffset[RegisterIndex].Offset64Hi,
> Width - 4);
>      }
>    }
>
> --
> 2.25.1


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

* Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib
  2023-07-12  6:24 ` [PATCH v1 1/1] " Abdul Lateef Attar
  2023-07-12  7:42   ` Chang, Abner
@ 2023-07-17  8:57   ` Ni, Ray
  1 sibling, 0 replies; 4+ messages in thread
From: Ni, Ray @ 2023-07-17  8:57 UTC (permalink / raw)
  To: Abdul Lateef Attar, devel@edk2.groups.io
  Cc: Abdul Lateef Attar, Dong, Eric, Kumar, Rahul R, Gerd Hoffmann,
	Abner Chang

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Abdul Lateef Attar <abdattar@amd.com>
> Sent: Wednesday, July 12, 2023 2:24 PM
> To: devel@edk2.groups.io
> Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>; Dong, Eric
> <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R
> <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Abner Chang
> <abner.chang@amd.com>
> Subject: [PATCH v1 1/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib
> 
> From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182
> 
> Use gMmst instead of gSmst.
> Replace SmmServicesTableLib with MmServicesTableLib.
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> ---
>  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf   | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h           | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c        | 4 ++--
>  UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c      | 2 +-
>  UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c     | 8 ++++----
>  6 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> index 5c0685f283d3..dcee6c401d30 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
> @@ -31,4 +31,4 @@ [LibraryClasses]
>    BaseLib
>    BaseMemoryLib
>    DebugLib
> -  SmmServicesTableLib
> +  MmServicesTableLib
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> index b92dfa643203..b7fd4078f58a 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf
> @@ -31,4 +31,4 @@ [LibraryClasses]
>    BaseLib
>    BaseMemoryLib
>    DebugLib
> -  SmmServicesTableLib
> +  MmServicesTableLib
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> index c3499cbb3b17..6c7e8abd5f62 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
> @@ -14,7 +14,7 @@
>  #include <Protocol/MmCpu.h>
>  #include <Library/DebugLib.h>
>  #include <Library/MmSaveStateLib.h>
> -#include <Library/SmmServicesTableLib.h>
> +#include <Library/MmServicesTableLib.h>
>  #include <Library/BaseMemoryLib.h>
> 
>  // Macro used to simplify the lookup table entries of type
> CPU_MM_SAVE_STATE_REGISTER_RANGE
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> index 9fed52896f5c..3315a6cc44ff 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> @@ -108,7 +108,7 @@ MmSaveStateReadRegister (
>    UINT8                      DataWidth;
> 
>    // Read CPU State
> -  CpuSaveState = (AMD_SMRAM_SAVE_STATE_MAP *)gSmst-
> >CpuSaveState[CpuIndex];
> +  CpuSaveState = (AMD_SMRAM_SAVE_STATE_MAP *)gMmst-
> >CpuSaveState[CpuIndex];
> 
>    // Check for special EFI_MM_SAVE_STATE_REGISTER_LMA
>    if (Register == EFI_MM_SAVE_STATE_REGISTER_LMA) {
> @@ -226,7 +226,7 @@ MmSaveStateWriteRegister (
>      return EFI_NOT_FOUND;
>    }
> 
> -  CpuSaveState = gSmst->CpuSaveState[CpuIndex];
> +  CpuSaveState = gMmst->CpuSaveState[CpuIndex];
> 
>    //
>    // Do not write non-writable SaveState, because it will cause exception.
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> index fd321bb571d5..c2ccd65b1dc4 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c
> @@ -296,7 +296,7 @@ MmSaveStateWriteRegister (
>      return EFI_NOT_FOUND;
>    }
> 
> -  CpuSaveState = gSmst->CpuSaveState[CpuIndex];
> +  CpuSaveState = gMmst->CpuSaveState[CpuIndex];
> 
>    //
>    // Do not write non-writable SaveState, because it will cause exception.
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> index 09c6c3f96fed..f66245b82c40 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
> @@ -99,8 +99,8 @@ MmSaveStateReadRegisterByIndex (
>      //
>      // Write return buffer
>      //
> -    ASSERT (gSmst->CpuSaveState[CpuIndex] != NULL);
> -    CopyMem (Buffer, (UINT8 *)gSmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset32, Width);
> +    ASSERT (gMmst->CpuSaveState[CpuIndex] != NULL);
> +    CopyMem (Buffer, (UINT8 *)gMmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset32, Width);
>    } else {
>      //
>      // If 64-bit mode width is zero, then the specified register can not be accessed
> @@ -119,12 +119,12 @@ MmSaveStateReadRegisterByIndex (
>      //
>      // Write lower 32-bits of return buffer
>      //
> -    CopyMem (Buffer, (UINT8 *)gSmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset64Lo, MIN (4, Width));
> +    CopyMem (Buffer, (UINT8 *)gMmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset64Lo, MIN (4, Width));
>      if (Width > 4) {
>        //
>        // Write upper 32-bits of return buffer
>        //
> -      CopyMem ((UINT8 *)Buffer + 4, (UINT8 *)gSmst->CpuSaveState[CpuIndex] +
> mCpuWidthOffset[RegisterIndex].Offset64Hi, Width - 4);
> +      CopyMem ((UINT8 *)Buffer + 4, (UINT8 *)gMmst->CpuSaveState[CpuIndex]
> + mCpuWidthOffset[RegisterIndex].Offset64Hi, Width - 4);
>      }
>    }
> 
> --
> 2.25.1



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



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

end of thread, other threads:[~2023-07-17  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12  6:24 [PATCH v1 0/1] UefiCpuPkg: Uses gMmst in MmSaveStateLib Abdul Lateef Attar
2023-07-12  6:24 ` [PATCH v1 1/1] " Abdul Lateef Attar
2023-07-12  7:42   ` Chang, Abner
2023-07-17  8:57   ` [edk2-devel] " Ni, Ray

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