Skip to content

Commit

Permalink
UefiPkg/PiSmmCpuDxeSmm: Set SmmProfile Variable only for DXE SMM
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
yanxinzh committed Dec 19, 2024
1 parent 4af5849 commit dedf187
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit dedf187

Please sign in to comment.