summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDong, Eric <eric.dong@intel.com>2020-04-24 16:47:16 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-04-30 04:11:13 +0000
commitf07fb43b2d3f92a15d6992205b72ba5df0e74fe2 (patch)
treef482a3d0e5a4a0e213d41f590265b888928d4b73
parent052aa07da46d96d7069d12f28fc31deb68a6d75e (diff)
UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2683 In PEI phase, AP already been waked up through ApInitConfig, so it can directly wake up it through change wakup buffer instead of use ApInitReconfig flag. It can save some time. Change code to only use ApInitReconfig flag in DXE phase which must need to update the wake up buffer. Regression-tested-by: Laszlo Ersek <lersek@redhat.com> Cc: Chandana Kumar <chandana.c.kumar@intel.com> Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index ada3969b68..cbc5594c78 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1820,7 +1820,14 @@ MpInitLibInitialize (
// Wakeup APs to do some AP initialize sync (Microcode & MTRR)
//
if (CpuMpData->CpuCount > 1) {
- CpuMpData->InitFlag = ApInitReconfig;
+ if (OldCpuMpData != NULL) {
+ //
+ // Only needs to use this flag for DXE phase to update the wake up
+ // buffer. Wakeup buffer allocated in PEI phase is no longer valid
+ // in DXE.
+ //
+ CpuMpData->InitFlag = ApInitReconfig;
+ }
WakeUpAP (CpuMpData, TRUE, 0, ApInitializeSync, CpuMpData, TRUE);
//
// Wait for all APs finished initialization
@@ -1828,7 +1835,9 @@ MpInitLibInitialize (
while (CpuMpData->FinishedCount < (CpuMpData->CpuCount - 1)) {
CpuPause ();
}
- CpuMpData->InitFlag = ApInitDone;
+ if (OldCpuMpData != NULL) {
+ CpuMpData->InitFlag = ApInitDone;
+ }
for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
SetApState (&CpuMpData->CpuData[Index], CpuStateIdle);
}