diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf index fe2c1ba030..eaf5e14daa 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf @@ -81,6 +81,7 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuApStatusCheckIntervalInMicroSeconds ## CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdGhcbHypervisorFeatures ## CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase ## SOMETIMES_CONSUMES + 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 8d987b9b58..98feb5ea6f 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -291,8 +291,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 5c8bb16f1b..858970e00d 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -169,9 +169,9 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmFeatureControlMsrLock|TRUE|BOOLEAN|0x3213210B ## 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 [PcdsFixedAtBuild] @@ -199,7 +199,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 @@ -342,6 +342,13 @@ # @Prompt Current boot is a power-on reset. gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset|FALSE|BOOLEAN|0x0000001B + # 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. # MMIO access is always allowed regardless of the value of this PCD.