]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/BaseMemEncryptSevLib/X64/DxeSnpSystemRamValidate.c
OvmfPkg/MemEncryptSevLib: add support to validate system RAM
[mirror_edk2.git] / OvmfPkg / Library / BaseMemEncryptSevLib / X64 / DxeSnpSystemRamValidate.c
1 /** @file
2
3 SEV-SNP Page Validation functions.
4
5 Copyright (c) 2021 AMD Incorporated. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #include <Uefi/UefiBaseType.h>
12 #include <Library/BaseLib.h>
13 #include <Library/DebugLib.h>
14 #include <Library/MemEncryptSevLib.h>
15
16 #include "SnpPageStateChange.h"
17
18 /**
19 Pre-validate the system RAM when SEV-SNP is enabled in the guest VM.
20
21 @param[in] BaseAddress Base address
22 @param[in] NumPages Number of pages starting from the base address
23
24 **/
25 VOID
26 EFIAPI
27 MemEncryptSevSnpPreValidateSystemRam (
28 IN PHYSICAL_ADDRESS BaseAddress,
29 IN UINTN NumPages
30 )
31 {
32 if (!MemEncryptSevSnpIsEnabled ()) {
33 return;
34 }
35
36 //
37 // All the pre-validation must be completed in the PEI phase.
38 //
39 ASSERT (FALSE);
40 }