Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Brijesh Singh 13b5d743c8 OvmfPkg/PlatformPei: Set memory encryption PCD when SEV is enabled
Secure Encrypted Virtualization (SEV) guest VMs have the concept of
private and shared memory. Private memory is encrypted with the
guest-specific key, while shared memory may be encrypted with hypervisor
key.  Certain types of memory (namely instruction pages and guest page
tables) are always treated as private memory by the hardware.
For data memory, SEV guest VMs can choose which pages they would like
to be private. The choice is done using the standard CPU page tables
using the C-bit. When building the initial page table we mark all the
memory as private.

The patch sets the memory encryption PCD. The PCD is consumed by the
following edk2 modules, which manipulate page tables:

- PEI phase modules: CapsulePei, DxeIplPeim, S3Resume2Pei.

CapsulePei is not used by OVMF. DxeIplPeim consumes the PCD at the
end of the PEI phase, when it builds the initial page tables for the
DXE core / DXE phase. S3Resume2Pei does not consume the PCD in its
entry point function, only when DxeIplPeim branches to the S3 resume
path at the end of the PEI phase, and calls S3Resume2Pei's
EFI_PEI_S3_RESUME2_PPI.S3RestoreConfig2() member function.

Therefore it is safe to set the PCD for these modules in PlatformPei.

- DXE phase modules: BootScriptExecutorDxe, CpuDxe, PiSmmCpuDxeSmm.

They are all dispatched after the PEI phase, so setting the PCD for
them in PlatformPei is safe. (BootScriptExecutorDxe is launched "for
real" in the PEI phase during S3 resume, but it caches the PCD into a
static variable when its entry point is originally invoked in DXE.)

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-07-10 21:17:27 -07:00
AppPkg AppPkg/Applications/Python/PyMod-2.7.2: Replace non-ascii characters 2017-04-10 08:34:08 +08:00
ArmPkg ArmPkg: implement ResetSystemLib using PSCI 0.2 calls 2017-07-03 16:53:33 +01:00
ArmPlatformPkg ArmPlatformPkg: convert VExpress ResetSystemLib to ResetSystemLib 2017-07-05 16:28:35 +01:00
ArmVirtPkg ArmVirtPkg: remove status code support 2017-07-05 16:30:26 +01:00
BaseTools BaseTools: Report Fd File Path in build log 2017-07-10 09:59:57 +08:00
BeagleBoardPkg BeagleBoardPkg: switch to use MdeModulePkg ResetSystemLib 2017-07-03 22:30:22 +01:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg CorebootPayloadPkg/CbSupportPei: Fix the memory map issue 2016-11-17 14:49:11 -08:00
CorebootPayloadPkg CorebootPayloadPkg: Use EfiEventGroupSignal from UefiLib 2017-01-20 15:55:41 +08:00
CryptoPkg CryptoPkg/BaseCryptLib: Add NULL pointer checks in DH and P7Verify 2017-05-22 08:57:48 +08:00
DuetPkg DuetPkg FsVariable: Update GetNextVariableName to follow UEFI 2.7 2017-06-27 13:58:01 +08:00
EdkCompatibilityPkg EdkCompatibilityPkg: Fix some typos of "according" 2017-02-08 14:49:21 +08:00
EdkShellBinPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EdkShellPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EmbeddedPkg EmbeddedPkg/MmcDxe: Align the ExtCSD buffer 2017-07-05 16:07:54 +01:00
EmulatorPkg EmulatorPkg/Unix/Host: Add GCC5 CC/DLINK commands (for GCC >= 5) 2017-07-07 15:38:13 -07:00
FatBinPkg FatBinPkg: New EnhancedFatDxe binaries for IA32, X64, EBC and IPF 2017-04-07 13:14:20 +08:00
FatPkg FatPkg: Refine casting expression result to bigger size 2017-03-06 14:33:21 +08:00
IntelFrameworkModulePkg IntelFrameworkModulePkg: Update comments in SimpleTextInEx 2017-06-20 09:29:41 +08:00
IntelFrameworkPkg IntelFrameworkPkg/UefiLib: Avoid mis-calculate of graphic console size 2017-04-14 13:16:12 +08:00
IntelFsp2Pkg IntelFsp2Pkg: Convert files to CRLF line ending 2017-04-06 15:42:56 +08:00
IntelFsp2WrapperPkg IntelFsp2WrapperPkg: Convert files to CRLF line ending 2017-04-06 15:43:08 +08:00
IntelFspPkg IntelFspPkg: Fix typos in comments 2016-10-24 09:26:28 +08:00
IntelFspWrapperPkg IntelFspWrapperPkg: Refine casting expression result to bigger size 2017-03-06 14:33:23 +08:00
IntelSiliconPkg IntelSiliconPkg: Add package DSC file 2017-06-26 09:37:28 +08:00
MdeModulePkg MdeModulePkg/XhciDxe: Make comments align with function 2017-07-11 08:51:13 +08:00
MdePkg MdePkg: Add EFI Partition Information Protocol definitions 2017-07-11 08:42:56 +08:00
NetworkPkg NetworkPkg: Fix GCC build issue. 2017-06-23 09:08:47 +08:00
Nt32Pkg Nt32Pkg/FvbServicesRuntimeDxe: correct NumOfLba vararg type in EraseBlocks() 2017-05-29 14:42:12 +02:00
Omap35xxPkg ArmPkg: remove unused PcdArmUncachedMemoryMask PCD 2017-02-27 16:18:29 +00:00
OptionRomPkg OptionRomPkg: Fix calling convention issue for UndiRuntiumeDxe driver. 2017-04-24 10:10:45 +08:00
OvmfPkg OvmfPkg/PlatformPei: Set memory encryption PCD when SEV is enabled 2017-07-10 21:17:27 -07:00
PcAtChipsetPkg PcAtChipsetPkg/SerialIoLib: Remove negative value shift 2017-05-19 12:12:06 -07:00
PerformancePkg PerformancePkg Dp_App: Handle "/" separator in debug path for GCC build 2017-03-16 11:08:44 +08:00
QuarkPlatformPkg QuarkPlatformPkg/SpiFvbServices: correct NumOfLba vararg type in EraseBlocks() 2017-05-29 14:42:36 +02:00
QuarkSocPkg QuarkSocPkg: Remove use of IntelFrameworkModulePkg legacy libs 2016-12-02 15:59:19 +00:00
SecurityPkg SecurityPkg TcgDxe: Simplify debug msg when "TPM not working properly" 2017-06-10 13:19:59 +08:00
ShellBinPkg ShellBinPkg: Ia32/X64 Shell binary update. 2017-06-13 16:23:18 +08:00
ShellPkg ShellPkg: Update dh command to reflect correct driver field information 2017-06-29 16:31:10 +08:00
SignedCapsulePkg SignedCapsulePkg: Convert files to CRLF line ending 2017-04-06 15:43:14 +08:00
SourceLevelDebugPkg PeCoffGetEntryPointLib: Fix spelling issue 2017-04-26 08:58:18 +08:00
StdLib StdLib: GCC 6 build fixes 2017-04-28 17:06:59 +01:00
StdLibPrivateInternalFiles StdLib: Clarify and improve comments. 2016-01-06 00:31:42 +00:00
UefiCpuPkg UefiCpuPkg MpInitLib: Update return status to follow spec. 2017-07-07 08:54:11 +08:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg Vlv2DeviceRefCodePkg: Fixed thermal issue. 2017-02-08 15:32:39 +08:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg/FvbRuntimeDxe: correct NumOfLba vararg type in EraseBlocks() 2017-05-26 14:41:13 +08:00
.gitignore edk2: Add .DS_Store to .gitignore for macOS 2017-05-19 15:14:34 -07:00
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-03-25 09:46:44 +08:00
Edk2Setup.bat Edk2Setup.bat: Fix build errors from VS tools PREFIX ENV missing 2016-11-05 09:10:58 +08:00
Maintainers.txt Maintainers.txt: Update maintainers for DuetPkg & Nt32Pkg 2017-06-01 09:01:49 +08:00
edksetup.bat BaseTools: suppress usage instructions with rebuild options 2017-07-04 10:16:13 +08:00
edksetup.sh edksetup.sh, BaseTools/BuildEnv: add --reconfig support 2016-10-24 13:53:16 +01:00