]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: fix incorrect stack top init for cpu0
authorJian J Wang <jian.j.wang@intel.com>
Thu, 4 Jan 2018 02:57:26 +0000 (10:57 +0800)
committerEric Dong <eric.dong@intel.com>
Wed, 10 Jan 2018 00:25:11 +0000 (08:25 +0800)
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 <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/MpInitLib/MpLib.c

index 1a6cdb678e494a3bd6d466a1a0c634f3491193b3..cdc03113e5998116ad78d7d89ad088a569ca6980 100644 (file)
@@ -1502,7 +1502,7 @@ MpInitLibInitialize (
   //\r
   // Set BSP basic information\r
   //\r
   //\r
   // Set BSP basic information\r
   //\r
-  InitializeApData (CpuMpData, 0, 0, CpuMpData->Buffer);\r
+  InitializeApData (CpuMpData, 0, 0, CpuMpData->Buffer + ApStackSize);\r
   //\r
   // Save assembly code information\r
   //\r
   //\r
   // Save assembly code information\r
   //\r