mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuPlatformHookBeforeMmiHandler func
This patch is for PiSmmCpuDxeSmm driver to add one round wait/release sync for BSP and AP to perform the SMM CPU Platform Hook before executing MMI Handler: SmmCpuPlatformHookBeforeMmiHandler (). With the function, SMM CPU driver can perform the platform specific items after one round BSP and AP sync (to make sure all APs in SMI) and before the MMI handlers. After the change, steps #1 and #2 are additional requirements if the MmCpuSyncModeTradition mode is selected. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
e34460c8b2
commit
fcd9570c8d
|
@ -520,16 +520,19 @@ BSPHandler (
|
||||||
ApCount = CpuCount - 1;
|
ApCount = CpuCount - 1;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Wait for all APs to get ready for programming MTRRs
|
// Wait for all APs of arrival at this point
|
||||||
//
|
//
|
||||||
SmmCpuSyncWaitForAPs (mSmmMpSyncData->SyncContext, ApCount, CpuIndex); /// #1: Wait APs
|
SmmCpuSyncWaitForAPs (mSmmMpSyncData->SyncContext, ApCount, CpuIndex); /// #1: Wait APs
|
||||||
|
|
||||||
|
//
|
||||||
|
// Signal all APs it's time for:
|
||||||
|
// 1. Backup MTRRs if needed.
|
||||||
|
// 2. Perform SMM CPU Platform Hook before executing MMI Handler.
|
||||||
|
//
|
||||||
|
ReleaseAllAPs (); /// #2: Signal APs
|
||||||
|
|
||||||
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
|
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
|
||||||
//
|
//
|
||||||
// Signal all APs it's time for backup MTRRs
|
|
||||||
//
|
|
||||||
ReleaseAllAPs (); /// #2: Signal APs
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// SmmCpuSyncWaitForAPs() may wait for ever if an AP happens to enter SMM at
|
// SmmCpuSyncWaitForAPs() may wait for ever if an AP happens to enter SMM at
|
||||||
// exactly this point. Please make sure PcdCpuSmmMaxSyncLoops has been set
|
// exactly this point. Please make sure PcdCpuSmmMaxSyncLoops has been set
|
||||||
|
@ -564,6 +567,11 @@ BSPHandler (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Perform SMM CPU Platform Hook before executing MMI Handler
|
||||||
|
//
|
||||||
|
SmmCpuPlatformHookBeforeMmiHandler ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// The BUSY lock is initialized to Acquired state
|
// The BUSY lock is initialized to Acquired state
|
||||||
//
|
//
|
||||||
|
@ -806,14 +814,16 @@ APHandler (
|
||||||
// Notify BSP of arrival at this point
|
// Notify BSP of arrival at this point
|
||||||
//
|
//
|
||||||
SmmCpuSyncReleaseBsp (mSmmMpSyncData->SyncContext, CpuIndex, BspIndex); /// #1: Signal BSP
|
SmmCpuSyncReleaseBsp (mSmmMpSyncData->SyncContext, CpuIndex, BspIndex); /// #1: Signal BSP
|
||||||
|
|
||||||
|
//
|
||||||
|
// Wait for the signal from BSP to:
|
||||||
|
// 1. Backup MTRRs if needed.
|
||||||
|
// 2. Perform SMM CPU Platform Hook before executing MMI Handler.
|
||||||
|
//
|
||||||
|
SmmCpuSyncWaitForBsp (mSmmMpSyncData->SyncContext, CpuIndex, BspIndex); /// #2: Wait BSP
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
|
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
|
||||||
//
|
|
||||||
// Wait for the signal from BSP to backup MTRRs
|
|
||||||
//
|
|
||||||
SmmCpuSyncWaitForBsp (mSmmMpSyncData->SyncContext, CpuIndex, BspIndex); /// #2: Wait BSP
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Backup OS MTRRs
|
// Backup OS MTRRs
|
||||||
//
|
//
|
||||||
|
@ -840,6 +850,11 @@ APHandler (
|
||||||
SmmCpuSyncReleaseBsp (mSmmMpSyncData->SyncContext, CpuIndex, BspIndex); /// #5: Signal BSP
|
SmmCpuSyncReleaseBsp (mSmmMpSyncData->SyncContext, CpuIndex, BspIndex); /// #5: Signal BSP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Perform SMM CPU Platform Hook before executing MMI Handler
|
||||||
|
//
|
||||||
|
SmmCpuPlatformHookBeforeMmiHandler ();
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
//
|
//
|
||||||
// Wait for something to happen
|
// Wait for something to happen
|
||||||
|
|
Loading…
Reference in New Issue