]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/MpInitLib: Allocate a separate SEV-ES AP reset stack area
authorLendacky, Thomas <thomas.lendacky@amd.com>
Fri, 14 May 2021 20:28:45 +0000 (15:28 -0500)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sat, 29 May 2021 11:33:16 +0000 (11:33 +0000)
commitdbc22a178546edb6373a4a1f331b0f16f04e2e3d
tree4e7725bae62a7e0df901eb0ea3166302bcf155df
parentb8ed8c0fb2c9a5e97d0286a23827f2b5356ca552
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: 7b7508ad784d16a5208c8d12dff43aef6df0835b
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>
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
UefiCpuPkg/Library/MpInitLib/MpLib.c
UefiCpuPkg/Library/MpInitLib/PeiMpLib.c