Skip to content

Commit

Permalink
UefiCpuPkg/MpLib: Remove NotifyOnS3SmmInitDonePpi
Browse files Browse the repository at this point in the history
Previously, the SMM S3 resume code required taking control of APs to
perform SMM rebase, which would overwrite the context set by MpLib.
As a result, MpLib needed to wake up APs using InitSipiSipi to restore
the context after SMM S3 resume.

With the recent change where SMM rebase occurs in the early PEI phase,
the SMM S3 resume code no longer modifies AP context. Therefore, the
forced use of InitSipiSipi after SMM S3 resume is no longer necessary.

Signed-off-by: Zhiguang Liu <[email protected]>
  • Loading branch information
LiuZhiguang001 authored and mergify[bot] committed Oct 10, 2024
1 parent 6f17bd5 commit 0bae161
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 65 deletions.
1 change: 0 additions & 1 deletion UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
gEdkiiPeiShadowMicrocodePpiGuid ## SOMETIMES_CONSUMES

[Guids]
gEdkiiS3SmmInitDoneGuid
gEdkiiMicrocodePatchHobGuid
gGhcbApicIdsGuid ## SOMETIMES_CONSUMES
gEdkiiEndOfS3ResumeGuid
Expand Down
64 changes: 0 additions & 64 deletions UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,6 @@

STATIC UINT64 mSevEsPeiWakeupBuffer = BASE_1MB;

/**
S3 SMM Init Done notification function.
@param PeiServices Indirect reference to the PEI Services Table.
@param NotifyDesc Address of the notification descriptor data structure.
@param InvokePpi Address of the PPI that was invoked.
@retval EFI_SUCCESS The function completes successfully.
**/
EFI_STATUS
EFIAPI
NotifyOnS3SmmInitDonePpi (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
IN VOID *InvokePpi
);

//
// Global function
//
EFI_PEI_NOTIFY_DESCRIPTOR mS3SmmInitDoneNotifyDesc = {
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
&gEdkiiS3SmmInitDoneGuid,
NotifyOnS3SmmInitDonePpi
};

/**
S3 SMM Init Done notification function.
@param PeiServices Indirect reference to the PEI Services Table.
@param NotifyDesc Address of the notification descriptor data structure.
@param InvokePpi Address of the PPI that was invoked.
@retval EFI_SUCCESS The function completes successfully.
**/
EFI_STATUS
EFIAPI
NotifyOnS3SmmInitDonePpi (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
IN VOID *InvokePpi
)
{
CPU_MP_DATA *CpuMpData;

CpuMpData = GetCpuMpData ();

//
// PiSmmCpuDxeSmm driver hardcode change the loop mode to HLT mode.
// So in this notify function, code need to check the current loop
// mode, if it is not HLT mode, code need to change loop mode back
// to the original mode.
//
if (CpuMpData->ApLoopMode != ApInHltLoop) {
CpuMpData->WakeUpByInitSipiSipi = TRUE;
}

return EFI_SUCCESS;
}

/**
Enable Debug Agent to support source debugging on AP function.
Expand Down Expand Up @@ -510,8 +448,6 @@ InitMpGlobalData (
///
/// Install Notify
///
Status = PeiServicesNotifyPpi (&mS3SmmInitDoneNotifyDesc);
ASSERT_EFI_ERROR (Status);

Status = PeiServicesNotifyPpi (&mEndOfS3ResumeNotifyDesc);
ASSERT_EFI_ERROR (Status);
Expand Down

0 comments on commit 0bae161

Please sign in to comment.