Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PCD to allow the AP wakeup buffer to be reserved #209

Merged
merged 3 commits into from Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
Expand Up @@ -80,6 +80,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
Expand Down
8 changes: 6 additions & 2 deletions UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
Expand Up @@ -218,8 +218,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
Expand Down
15 changes: 11 additions & 4 deletions UefiCpuPkg/UefiCpuPkg.dec
Expand Up @@ -165,9 +165,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]
Expand Down Expand Up @@ -195,7 +195,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

Expand Down Expand Up @@ -338,6 +338,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.
cfernald marked this conversation as resolved.
Show resolved Hide resolved
# @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.
Expand Down