summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2024-04-23 14:00:44 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-05-08 01:53:58 +0000
commitc56ea95b2845d2846eda8ceb740586fe936627c9 (patch)
treecff472509c16ceb06cbf54deb100e2b919d7aae1
parent9783dc01cccf557e6955dfc938f8b4acd7b16c88 (diff)
downloadedk2-c56ea95b2845d2846eda8ceb740586fe936627c9.zip
edk2-c56ea95b2845d2846eda8ceb740586fe936627c9.tar.gz
edk2-c56ea95b2845d2846eda8ceb740586fe936627c9.tar.bz2
UefiCpuPkg/SmmRelocationLib: Remove unnecessary CpuIndex
This patch is to remove unnecessary CpuIndex. Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
-rw-r--r--UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c3
-rw-r--r--UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h5
-rw-r--r--UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c12
-rw-r--r--UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c3
-rw-r--r--UefiCpuPkg/Library/SmmRelocationLib/X64/Semaphore.c3
5 files changed, 3 insertions, 23 deletions
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c b/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c
index ba329d6..5d9eea3 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c
@@ -17,14 +17,12 @@ volatile BOOLEAN *mRebasedFlag;
can be executed immediately after AP exits SMM to indicate to
the BSP that an AP has exited SMM after SMBASE relocation.
- @param[in] CpuIndex The processor index.
@param[in] RebasedFlag A pointer to a flag that is set to TRUE
immediately after AP exits SMM.
**/
VOID
SemaphoreHook (
- IN UINTN CpuIndex,
IN volatile BOOLEAN *RebasedFlag
)
{
@@ -34,7 +32,6 @@ SemaphoreHook (
CpuState = (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);
mSmmRelocationOriginalAddress = (UINTN)HookReturnFromSmm (
- CpuIndex,
CpuState,
(UINT64)(UINTN)&SmmRelocationSemaphoreComplete,
(UINT64)(UINTN)&SmmRelocationSemaphoreComplete
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h b/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h
index ede61b9..d1387f2 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h
+++ b/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h
@@ -83,8 +83,6 @@ SmmRelocationSemaphoreComplete (
detected, and the appropriate hook must be selected. Always clear the auto
HALT restart flag if it is set.
- @param[in] CpuIndex The processor index for the currently
- executing CPU.
@param[in,out] CpuState Pointer to SMRAM Save State Map for the
currently executing CPU.
@param[in] NewInstructionPointer32 Instruction pointer to use if resuming to
@@ -98,7 +96,6 @@ SmmRelocationSemaphoreComplete (
UINT64
EFIAPI
HookReturnFromSmm (
- IN UINTN CpuIndex,
IN OUT SMRAM_SAVE_STATE_MAP *CpuState,
IN UINT64 NewInstructionPointer32,
IN UINT64 NewInstructionPointer
@@ -109,14 +106,12 @@ HookReturnFromSmm (
can be executed immediately after AP exits SMM to indicate to
the BSP that an AP has exited SMM after SMBASE relocation.
- @param[in] CpuIndex The processor index.
@param[in] RebasedFlag A pointer to a flag that is set to TRUE
immediately after AP exits SMM.
**/
VOID
SemaphoreHook (
- IN UINTN CpuIndex,
IN volatile BOOLEAN *RebasedFlag
);
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c b/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
index 86df66a..7e65bbf 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
@@ -31,11 +31,6 @@ UINT64 mSmBase;
//
volatile BOOLEAN mRebased;
-//
-// CpuIndex for current CPU
-//
-UINTN mCpuIndex;
-
/**
This function will get the SmBase for CpuIndex.
@@ -155,7 +150,7 @@ SmmInitHandler (
// SMM re-based flag can't be set before RSM, because SMM save state context might be override
// by next AP flow before it take effect.
//
- SemaphoreHook (mCpuIndex, &mRebased);
+ SemaphoreHook (&mRebased);
}
/**
@@ -227,9 +222,8 @@ SmmRelocateBases (
ASSERT_EFI_ERROR (Status);
if (BspApicId != (UINT32)ProcessorInfo.ProcessorId) {
- mRebased = FALSE;
- mSmBase = GetSmBase (Index, SmmRelocationStart, TileSize);
- mCpuIndex = Index;
+ mRebased = FALSE;
+ mSmBase = GetSmBase (Index, SmmRelocationStart, TileSize);
SendSmiIpi ((UINT32)ProcessorInfo.ProcessorId);
//
// Wait for this AP to finish its 1st SMI
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c b/UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c
index d3a0bb9..76d798a 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c
@@ -84,8 +84,6 @@ ConfigureSmBase (
detected, and the appropriate hook must be selected. Always clear the auto
HALT restart flag if it is set.
- @param[in] CpuIndex The processor index for the currently
- executing CPU.
@param[in,out] CpuState Pointer to SMRAM Save State Map for the
currently executing CPU.
@param[in] NewInstructionPointer32 Instruction pointer to use if resuming to
@@ -99,7 +97,6 @@ ConfigureSmBase (
UINT64
EFIAPI
HookReturnFromSmm (
- IN UINTN CpuIndex,
IN OUT SMRAM_SAVE_STATE_MAP *CpuState,
IN UINT64 NewInstructionPointer32,
IN UINT64 NewInstructionPointer
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/X64/Semaphore.c b/UefiCpuPkg/Library/SmmRelocationLib/X64/Semaphore.c
index 53f3084..cd6778e 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/X64/Semaphore.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/X64/Semaphore.c
@@ -28,14 +28,12 @@ SmmRelocationSemaphoreComplete32 (
can be executed immediately after AP exits SMM to indicate to
the BSP that an AP has exited SMM after SMBASE relocation.
- @param[in] CpuIndex The processor index.
@param[in] RebasedFlag A pointer to a flag that is set to TRUE
immediately after AP exits SMM.
**/
VOID
SemaphoreHook (
- IN UINTN CpuIndex,
IN volatile BOOLEAN *RebasedFlag
)
{
@@ -51,7 +49,6 @@ SemaphoreHook (
CpuState = (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);
mSmmRelocationOriginalAddress = HookReturnFromSmm (
- CpuIndex,
CpuState,
(UINT64)(UINTN)&SmmRelocationSemaphoreComplete32,
(UINT64)(UINTN)&SmmRelocationSemaphoreComplete