/* Validate System RAM used for decompressing the PEI and DXE firmware volumes when SEV-SNP is active. The PCDs SecValidatedStart and SecValidatedEnd are set in OvmfPkg/Include/Fdf/FvmainCompactScratchEnd.fdf.inc.  */
VOID SecValidateSystemRam(VOID)
/* Validate System RAM used for decompressing the PEI and DXE firmware volumes when SEV-SNP is active. The PCDs SecValidatedStart and SecValidatedEnd are set in OvmfPkg/Include/Fdf/FvmainCompactScratchEnd.fdf.inc.  */
VOID SecValidateSystemRam(VOID)
{
  PHYSICAL_ADDRESS  Start, End;
  if (IsSevGuest () && SevSnpIsEnabled ()) {
    Start = (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32 (PcdOvmfSecValidatedStart);
    End   = (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32 (PcdOvmfSecValidatedEnd);
    MemEncryptSevSnpPreValidateSystemRam (Start, EFI_SIZE_TO_PAGES ((UINTN)(End - Start)));
  }
}