From 3912aa3d32dbd8a684d78d23bb938b3dc920d300 Mon Sep 17 00:00:00 2001 From: Zhiguang Liu Date: Tue, 23 Jul 2024 09:49:03 +0800 Subject: [PATCH] UefiCpuPkg: Combine the code to set ApInitDone In previoud commit, we remove the ApInitReconfig status. Now there are only two status ApInitConfig and ApInitDone. Only the very first waking up AP needs to set ApInitConfig status. Therefore, if this is not the first wake up, set ApInitDone status Signed-off-by: Zhiguang Liu --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 8b2bacb65e..7eee646312 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -2237,6 +2237,7 @@ MpInitLibInitialize ( // APs have been wakeup before, just get the CPU Information // from HOB // + CpuMpData->InitFlag = ApInitDone; if (CpuMpData->UseSevEsAPMethod) { AmdSevUpdateCpuMpData (CpuMpData); } @@ -2280,7 +2281,6 @@ MpInitLibInitialize ( ASSERT (CpuMpData->ApLoopMode != ApInHltLoop); CpuMpData->FinishedCount = 0; - CpuMpData->InitFlag = ApInitDone; CpuMpData->EnableExecuteDisableForSwitchContext = IsBspExecuteDisableEnabled (); SaveCpuMpData (CpuMpData); // @@ -2355,10 +2355,6 @@ MpInitLibInitialize ( CpuPause (); } - if (FirstMpHandOff != NULL) { - CpuMpData->InitFlag = ApInitDone; - } - for (Index = 0; Index < CpuMpData->CpuCount; Index++) { SetApState (&CpuMpData->CpuData[Index], CpuStateIdle); }