summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao,Yanxin <yanxin.zhao@intel.com>2024-12-18 10:45:40 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-20 02:17:40 +0000
commite8ce6c518973beab6b52ba6f783cfc7f53c1ce66 (patch)
treea49d2aeb476a3a3efd53eec16d64e25e599dae7f
parent4af58495561278551e1d4dd5a32be1c17b788b00 (diff)
downloadedk2-e8ce6c518973beab6b52ba6f783cfc7f53c1ce66.tar.gz
UefiPkg/PiSmmCpuDxeSmm: Set SmmProfile Variable only for DXE SMM
Some platforms plan to move the Standalone MM CPU driver into the FSP. However, there is no variable service support in FSP. Therefore, the SetVariable logic for the Standalone MM CPU will be removed. With this change, users can dump the SmmProfile data from the Memory Allocation HOB: gMmProfileDataHobGuid. This change does not impact the DXE SMM, which will still retrieve the SmmProfile data from the variable service. Signed-off-by: Yanxin Zhao <yanxin.zhao@intel.com>
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index 4862cf075f..f28da7e0fb 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -749,6 +749,7 @@ InitSmmProfileInternal (
UINTN MsrDsAreaSizePerCpu;
UINT64 SmmProfileSize;
+ Status = EFI_SUCCESS;
mPFEntryCount = (UINTN *)AllocateZeroPool (sizeof (UINTN) * mMaxNumberOfCpus);
ASSERT (mPFEntryCount != NULL);
mLastPFEntryValue = (UINT64 (*)[MAX_PF_ENTRY_COUNT])AllocateZeroPool (
@@ -840,12 +841,14 @@ InitSmmProfileInternal (
//
// Start SMM profile when SmmReadyToLock protocol is installed.
//
- Status = gMmst->MmRegisterProtocolNotify (
- &gEfiSmmReadyToLockProtocolGuid,
- InitSmmProfileCallBack,
- &Registration
- );
- ASSERT_EFI_ERROR (Status);
+ if (!mIsStandaloneMm) {
+ Status = gMmst->MmRegisterProtocolNotify (
+ &gEfiSmmReadyToLockProtocolGuid,
+ InitSmmProfileCallBack,
+ &Registration
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
return;
}