diff options
author | Zhihao Li <zhihao.li@intel.com> | 2023-05-10 10:45:35 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-05-31 09:23:01 +0000 |
commit | 5bb7bfbe81e3fd6ffbc3909a96a87e685cfc267d (patch) | |
tree | dc5dc2683f3ea0f64e3d87f77a5eb9312a8b02b7 | |
parent | d15d2667d58d40c0748919ac4b5771b875c0780b (diff) | |
download | edk2-5bb7bfbe81e3fd6ffbc3909a96a87e685cfc267d.tar.gz edk2-5bb7bfbe81e3fd6ffbc3909a96a87e685cfc267d.tar.bz2 edk2-5bb7bfbe81e3fd6ffbc3909a96a87e685cfc267d.zip |
UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4431
In Ap relaxed mode, some SMI handlers should call SmmWaitForApArrival() to let all ap arrive in SmmCpuRendezvous(). But in traditional mode, these SMI handlers don't need to call SmmWaitForApArrival() again. So it need to be check cpu sync mode before calling SmmWaitForApArrival().
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhihao Li <zhihao.li@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c index 2ebf4543c3..391b64e9f2 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c @@ -1,7 +1,7 @@ /** @file
Implementation of SMM CPU Services Protocol.
-Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -421,11 +421,18 @@ SmmCpuRendezvous ( goto ON_EXIT;
}
- //
- // There are some APs outside SMM, Wait for all avaiable APs to arrive.
- //
- SmmWaitForApArrival ();
- Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : EFI_TIMEOUT;
+ if ((mSmmMpSyncData->EffectiveSyncMode != SmmCpuSyncModeTradition) && !SmmCpuFeaturesNeedConfigureMtrrs ()) {
+ //
+ // There are some APs outside SMM, Wait for all avaiable APs to arrive.
+ //
+ SmmWaitForApArrival ();
+ Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : EFI_TIMEOUT;
+ } else {
+ //
+ // BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode selected or need config MTRR.
+ //
+ Status = EFI_TIMEOUT;
+ }
ON_EXIT:
if (!mSmmMpSyncData->AllApArrivedWithException) {
|