diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
index a43a310ffd..712898e3a7 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
@@ -87,6 +87,7 @@
gUefiCpuPkgTokenSpaceGuid.PcdGhcbHypervisorFeatures ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase ## SOMETIMES_CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdFirstTimeWakeUpAPsBySipi
+ gUefiCpuPkgTokenSpaceGuid.PcdCpuApWakeupBufferReserved ## CONSUMES MU_CHANGE
# MU_CHANGE START Remove memory protection PCD references
# gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES
# MU_CHANGE END
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
index c74e6e7953..4005396506 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
@@ -292,8 +292,12 @@ GetWakeupBuffer (
EFI_PHYSICAL_ADDRESS StartAddress;
EFI_MEMORY_TYPE MemoryType;
- if (ConfidentialComputingGuestHas (CCAttrAmdSevEs) &&
- !ConfidentialComputingGuestHas (CCAttrAmdSevSnp))
+ // MU_CHANGE START Add PCD to make wakeup buffer reserved
+ if (PcdGetBool (PcdCpuApWakeupBufferReserved)) {
+ MemoryType = EfiReservedMemoryType;
+ // MU_CHANGE END
+ } else if (ConfidentialComputingGuestHas (CCAttrAmdSevEs) &&
+ !ConfidentialComputingGuestHas (CCAttrAmdSevSnp))
{
//
// An SEV-ES-only guest requires the memory to be reserved. SEV-SNP, which
diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index 17be01dc1d..688dc7baff 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -186,9 +186,9 @@
# @Prompt Support SmmFeatureControl.
gUefiCpuPkgTokenSpaceGuid.PcdSmmFeatureControlEnable|TRUE|BOOLEAN|0x32132110
## MS_CHANGE
- ## If TRUE, Install the protocol to communicate to the Smm Exception
- # handler so automated testing can be performed.
- #
+ ## If TRUE, Install the protocol to communicate to the Smm Exception
+ # handler so automated testing can be performed.
+ #
gUefiCpuPkgTokenSpaceGuid.PcdSmmExceptionTestModeSupport|FALSE|BOOLEAN|0x00000021
## Indicates if SMM perf logging in APs will be enabled.
@@ -222,7 +222,7 @@
gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize|0x0|UINT32|0x30002006
## MS_CHANGE
- ## If TRUE, the default Cpu Exception Handler in SMM will reboot
+ ## If TRUE, the default Cpu Exception Handler in SMM will reboot
# This handler state can be changed by using the Exception Test Protocol
gUefiCpuPkgTokenSpaceGuid.PcdSmmExceptionRebootInsteadOfHaltDefault|TRUE|BOOLEAN|0x00000020
@@ -390,6 +390,13 @@
# FASLE - Performance collecting will be disabled in processor trace.
# @Prompt Enable performance collecting when processor trace is enabled.
gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTracePerformanceCollecting|FALSE|BOOLEAN|0x60000020
+
+ # MU_CHANGE START Add PCD to make wakeup buffer reserved
+ ## Specifies that the wake-up buffer for AP startup should be permanently
+ # allocated as reserved.
+ # @Prompt Allocates CPU wake-up buffer as reserved.
+ gUefiCpuPkgTokenSpaceGuid.PcdCpuApWakeupBufferReserved|FALSE|BOOLEAN|0x0000001F
+ # MU_CHANGE END
[PcdsFixedAtBuild.X64, PcdsPatchableInModule.X64, PcdsDynamic.X64, PcdsDynamicEx.X64]
## Indicate access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock.