diff options
author | Khor Swee Aun <swee.aun.khor@intel.com> | 2025-01-20 22:38:47 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-01-22 01:22:05 +0000 |
commit | f6afd876631e2f7d1e0eeda70c2bf299c5d83deb (patch) | |
tree | bcff3ca00bf32309e4a4f8f2ac74a51b896ee74b /UefiCpuPkg | |
parent | cbfae3e8a945e0621cfb6ca77c067806e8693056 (diff) | |
download | edk2-f6afd876631e2f7d1e0eeda70c2bf299c5d83deb.tar.gz |
UefiCpuPkg/PiSmmCpuDxeSmm: SmmWaitForApArrival first sync check
Restructured the SmmWaitForApArrival first CPU synchronization
conditional checks and added new IsCpuSyncAlwaysNeeded check to determine
whether the sync should be executed unconditionally when a SMI occurs.
The first CPU synchronization shall executed unconditionally if the new
IsCpuSyncAlwaysNeeded check return TRUE. Otherwise, first CPU
synchronization is not executed unconditionally, and the decision to
synchronize should be based on the system configuration and status.
Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index 546c94bae5..b19906b610 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -234,10 +234,9 @@ SmmWaitForApArrival ( {
UINT64 Timer;
UINTN Index;
- BOOLEAN LmceEn;
- BOOLEAN LmceSignal;
UINT32 DelayedCount;
UINT32 BlockedCount;
+ BOOLEAN SyncNeeded;
PERF_FUNCTION_BEGIN ();
@@ -246,11 +245,9 @@ SmmWaitForApArrival ( ASSERT (SmmCpuSyncGetArrivedCpuCount (mSmmMpSyncData->SyncContext) <= mNumberOfCpus);
- LmceEn = FALSE;
- LmceSignal = FALSE;
- if (mMachineCheckSupported) {
- LmceEn = IsLmceOsEnabled ();
- LmceSignal = IsLmceSignaled ();
+ SyncNeeded = IsCpuSyncAlwaysNeeded ();
+ if (!SyncNeeded) {
+ SyncNeeded = !(mMachineCheckSupported && IsLmceOsEnabled () && IsLmceSignaled ());
}
//
@@ -268,7 +265,7 @@ SmmWaitForApArrival ( // Sync with APs 1st timeout
//
for (Timer = StartSyncTimer ();
- !IsSyncTimerTimeout (Timer, mTimeoutTicker) && !(LmceEn && LmceSignal);
+ !IsSyncTimerTimeout (Timer, mTimeoutTicker) && SyncNeeded;
)
{
mSmmMpSyncData->AllApArrivedWithException = AllCpusInSmmExceptBlockedDisabled ();
|