audk/UefiCpuPkg/Library/MpInitLib
Jeff Fan bf2786dc79 UefiCpuPkg/DxeMpLib: Allocate new safe stack < 4GB
For long mode DXE, we will disable paging on AP to protected mode to execute AP
safe loop code in reserved memory range under 4GB. But we forget to allocate
stack for AP under 4GB and AP still are using original AP stack. If original AP
stack is larger than 4GB, it cannot be used after AP is transferred to protected
mode. Besides MwaitSupport == TRUE, AP stack is still required during phase of
disabling paging in long mode DXE.

Moreover, even though AP stack is always under 4GB (a) in Ia32 DXE and (b) with
this patch, after transferring to protected mode from X64 DXE, AP stack
(in BootServiceData) maybe crashed by OS after Exit Boot Service event.

This fix is to allocate reserved memory range under 4GB together with AP safe
loop code. APs will switch to new stack in safe loop code.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-11-28 08:56:36 +08:00
..
Ia32 UefiCpuPkg/DxeMpLib: Allocate new safe stack < 4GB 2016-11-28 08:56:36 +08:00
X64 UefiCpuPkg/DxeMpLib: Allocate new safe stack < 4GB 2016-11-28 08:56:36 +08:00
DxeMpInitLib.inf UefiCpuPkg/DxeMpInitLib: remove duplicate HobLib class dependency 2016-11-17 10:57:33 +01:00
DxeMpInitLib.uni UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib 2016-08-17 19:58:07 +08:00
DxeMpLib.c UefiCpuPkg/DxeMpLib: Allocate new safe stack < 4GB 2016-11-28 08:56:36 +08:00
Microcode.c UefiCpuPkg/MpInitLib: Fix function header comments typo 2016-08-25 16:12:46 +08:00
MpLib.c UefiCpuPkg/MpInitLib: support 64-bit AP stack addresses 2016-11-17 10:58:18 +01:00
MpLib.h UefiCpuPkg/DxeMpLib: Allocate new safe stack < 4GB 2016-11-28 08:56:36 +08:00
PeiMpInitLib.inf UefiCpuPkg/MpInitLib: Add MicrocodeDetect() and load microcode on BSP 2016-08-17 20:00:23 +08:00
PeiMpInitLib.uni UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib 2016-08-17 19:58:07 +08:00
PeiMpLib.c UefiCpuPkg/MpInitLib: Do not wakeup AP if only one processor supported 2016-11-09 16:01:13 +08:00