audk/UefiCpuPkg/Library/MpInitLib
Lendacky, Thomas dbc22a1785 UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3324

The SEV-ES stacks currently share a page with the reset code and data.
Separate the SEV-ES stacks from the reset vector code and data to avoid
possible stack overflows from overwriting the code and/or data.

When SEV-ES is enabled, invoke the GetWakeupBuffer() routine a second time
to allocate a new area, below the reset vector and data.

Both the PEI and DXE versions of GetWakeupBuffer() are changed so that
when PcdSevEsIsEnabled is true, they will track the previous reset buffer
allocation in order to ensure that the new buffer allocation is below the
previous allocation. When PcdSevEsIsEnabled is false, the original logic
is followed.

Fixes: 7b7508ad78
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Message-Id: <3cae2ac836884b131725866264e0a0e1897052de.1621024125.git.thomas.lendacky@amd.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
2021-05-29 11:33:16 +00:00
..
Ia32 UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO 2021-03-08 02:22:37 +00:00
X64 UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO 2021-03-08 02:22:37 +00:00
DxeMpInitLib.inf UefiCpuPkg/MpInitLib: Consume MicrocodeLib to remove duplicated code 2021-04-09 01:43:18 +00:00
DxeMpInitLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
DxeMpLib.c UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area 2021-05-29 11:33:16 +00:00
Microcode.c UefiCpuPkg/MpInitLib: Consume MicrocodeLib to remove duplicated code 2021-04-09 01:43:18 +00:00
MpEqu.inc UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO 2021-03-08 02:22:37 +00:00
MpLib.c UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area 2021-05-29 11:33:16 +00:00
MpLib.h UefiCpuPkg/MpInitLib: Consume MicrocodeLib to remove duplicated code 2021-04-09 01:43:18 +00:00
PeiMpInitLib.inf UefiCpuPkg/MpInitLib: Consume MicrocodeLib to remove duplicated code 2021-04-09 01:43:18 +00:00
PeiMpInitLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PeiMpLib.c UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area 2021-05-29 11:33:16 +00:00