From f2655dcf28c4dbece5bdf6433a2624e68ea7aeb4 Mon Sep 17 00:00:00 2001 From: Jian J Wang Date: Thu, 4 Jan 2018 10:57:26 +0800 Subject: [PATCH] UefiCpuPkg/MpInitLib: fix incorrect stack top init for cpu0 As the name suggests, CpuMpData->CpuInfoInHob[0].ApTopOfStack must be init to the top of stack. But the MpInitLibInitialize() passed the base address of stack to InitializeApData(), which is not correct. Although this stack is not used for BSP, it's should be fixed in case of misunderstanding and future possible code changes. Cc: Jiewen Yao Cc: Eric Dong Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang Reviewed-by: Laszlo Ersek Reviewed-by: Eric Dong --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 1a6cdb678e..cdc03113e5 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -1502,7 +1502,7 @@ MpInitLibInitialize ( // // Set BSP basic information // - InitializeApData (CpuMpData, 0, 0, CpuMpData->Buffer); + InitializeApData (CpuMpData, 0, 0, CpuMpData->Buffer + ApStackSize); // // Save assembly code information // -- 2.39.2