audk/UefiCpuPkg/Library/MpInitLib
Lendacky, Thomas via groups.io 67a6f414aa UefiCpuPkg/MpInitLib: Ensure SEV-SNP VMSA allocations are not 2MB aligned
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4353

Due to AMD erratum #1467, an SEV-SNP VMSA should not be 2MB aligned. To
work around this issue, allocate two pages instead of one. Because of the
way that page allocation is implemented, always try to use the second
page. If the second page is not 2MB aligned, free the first page and use
the second page. If the second page is 2MB aligned, free the second page
and use the first page. Freeing in this way reduces holes in the memory
map.

Fixes: 06544455d0 ("UefiCpuPkg/MpInitLib: Use SEV-SNP AP Creation ...")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Ray Ni <ray.ni@intel.com>
2023-04-01 03:15:51 +00:00
..
Ia32 UefiCpuPkg: Put APs in 64 bit mode before handoff to OS. 2023-03-07 08:14:59 +00:00
X64 UefiCpuPkg/MpInitLib: Ensure SEV-SNP VMSA allocations are not 2MB aligned 2023-04-01 03:15:51 +00:00
AmdSev.c OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib 2022-11-14 04:55:34 +00:00
DxeMpInitLib.inf UefiCpuPkg: Remove UefiCpuLib from module INFs. 2023-03-10 08:23:56 +00:00
DxeMpInitLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
DxeMpLib.c UefiCpuPkg: Rename AsmRelocateApLoopStart. 2023-03-07 08:14:59 +00:00
Microcode.c UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MpEqu.inc UefiCpuPkg: Rename AsmRelocateApLoopStart. 2023-03-07 08:14:59 +00:00
MpLib.c OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib 2022-11-14 04:55:34 +00:00
MpLib.h UefiCpuPkg: Remove UefiCpuLib from module INFs. 2023-03-10 08:23:56 +00:00
PeiMpInitLib.inf UefiCpuPkg: Remove UefiCpuLib from module INFs. 2023-03-10 08:23:56 +00:00
PeiMpInitLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PeiMpLib.c UefiCpuPkg: Use Top of each AP's stack to save CpuMpData 2022-08-31 04:23:55 +00:00