audk/OvmfPkg/PlatformPei
Adam Dunlap 3e3f5bb21c OvmfPkg/PlatformPei: Validate SEC's GHCB page
When running under SEV-ES, a page of shared memory is allocated for the
GHCB during the SEC phase at address 0x809000. This page of memory is
eventually passed to the OS as EfiConventionalMemory. When running
SEV-SNP, this page is not PVALIDATE'd in the RMP table, meaning that if
the guest OS tries to access the page, it will think that the host has
voilated the security guarantees and will likely crash.

This patch validates this page immediately after EDK2 switches to using
the GHCB page allocated for the PEI phase.

This was tested by writing a UEFI application that reads to and writes
from one byte of each page of memory and checks to see if a #VC
exception is generated indicating that the page was not validated.

Fixes: 6995a1b79b ("OvmfPkg: Create a GHCB page for use during Sec phase")

Signed-off-by: Adam Dunlap <acdunlap@google.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
2022-12-15 08:05:52 +00:00
..
AmdSev.c OvmfPkg/PlatformPei: Validate SEC's GHCB page 2022-12-15 08:05:52 +00:00
ClearCache.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FeatureControl.c OvmfPkg/PlatformPei: remove mFeatureControlValue 2022-12-14 17:45:41 +00:00
Fv.c OvmfPkg/PlatformPei: PeiFv: stop using mPlatformInfoHob 2022-12-14 17:45:41 +00:00
IntelTdx.c OvmfPkg: Update PlatformPei to support Tdx guest 2022-04-02 08:15:12 +00:00
MemDetect.c OvmfPkg/PlatformPei: PeiMemory: stop using mPlatformInfoHob 2022-12-14 17:45:41 +00:00
MemTypeInfo.c OvmfPkg/PlatformPei: MemTypeInfo: stop using mPlatformInfoHob 2022-12-14 17:45:41 +00:00
Platform.c OvmfPkg/PlatformPei: remove mFeatureControlValue 2022-12-14 17:45:41 +00:00
Platform.h OvmfPkg/PlatformPei: remove mFeatureControlValue 2022-12-14 17:45:41 +00:00
PlatformPei.inf OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib 2022-11-14 04:55:34 +00:00