TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | SEV_ES_PER_CPU_DATA |
Macros | |
#define | VMGEXIT_MAXIMUM_VC_COUNT 2 |
Enumerations | |
enum | MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE { MemEncryptSevAddressRangeUnencrypted , MemEncryptSevAddressRangeEncrypted , MemEncryptSevAddressRangeMixed , MemEncryptSevAddressRangeError } |
Functions | |
BOOLEAN EFIAPI | MemEncryptSevSnpIsEnabled (VOID) |
BOOLEAN EFIAPI | MemEncryptSevEsIsEnabled (VOID) |
BOOLEAN EFIAPI | MemEncryptSevIsEnabled (VOID) |
RETURN_STATUS EFIAPI | MemEncryptSevClearPageEncMask (IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages) |
RETURN_STATUS EFIAPI | MemEncryptSevSetPageEncMask (IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages) |
RETURN_STATUS EFIAPI | MemEncryptSevLocateInitialSmramSaveStateMapPages (OUT UINTN *BaseAddress, OUT UINTN *NumberOfPages) |
UINT64 EFIAPI | MemEncryptSevGetEncryptionMask (VOID) |
BOOLEAN EFIAPI | MemEncryptSevEsDebugVirtualizationIsEnabled (VOID) |
MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE EFIAPI | MemEncryptSevGetAddressRangeState (IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN Length) |
RETURN_STATUS EFIAPI | MemEncryptSevClearMmioPageEncMask (IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages) |
VOID EFIAPI | MemEncryptSevSnpPreValidateSystemRam (IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages) |
Define Secure Encrypted Virtualization (SEV) base library helper function
Copyright (c) 2017 - 2020, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MemEncryptSevLib.h.
#define VMGEXIT_MAXIMUM_VC_COUNT 2 |
Definition at line 24 of file MemEncryptSevLib.h.
enum MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE |
Definition at line 43 of file MemEncryptSevLib.h.
RETURN_STATUS EFIAPI MemEncryptSevClearMmioPageEncMask | ( | IN PHYSICAL_ADDRESS | Cr3BaseAddress, |
IN PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINTN | NumPages | ||
) |
This function clears memory encryption bit for the MMIO region specified by BaseAddress and NumPages.
[in] | Cr3BaseAddress | Cr3 Base Address (if zero then use current CR3) |
[in] | BaseAddress | The physical address that is the start address of a MMIO region. |
[in] | NumPages | The number of pages from start memory region. |
RETURN_SUCCESS | The attributes were cleared for the memory region. |
RETURN_INVALID_PARAMETER | Number of pages is zero. |
RETURN_UNSUPPORTED | Clearing the memory encryption attribute is not supported |
This function clears memory encryption bit for the mmio region specified by BaseAddress and NumPages.
[in] | Cr3BaseAddress | Cr3 Base Address (if zero then use current CR3) |
[in] | BaseAddress | The physical address that is the start address of a mmio region. |
[in] | NumPages | The number of pages from start memory region. |
RETURN_SUCCESS | The attributes were cleared for the memory region. |
RETURN_INVALID_PARAMETER | Number of pages is zero. |
RETURN_UNSUPPORTED | Clearing the memory encryption attribute is not supported |
Definition at line 128 of file MemEncryptSevLib.c.
RETURN_STATUS EFIAPI MemEncryptSevClearPageEncMask | ( | IN PHYSICAL_ADDRESS | Cr3BaseAddress, |
IN PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINTN | NumPages | ||
) |
This function clears memory encryption bit for the memory region specified by BaseAddress and NumPages from the current page table context.
[in] | Cr3BaseAddress | Cr3 Base Address (if zero then use current CR3) |
[in] | BaseAddress | The physical address that is the start address of a memory region. |
[in] | NumPages | The number of pages from start memory region. |
RETURN_SUCCESS | The attributes were cleared for the memory region. |
RETURN_INVALID_PARAMETER | Number of pages is zero. |
RETURN_UNSUPPORTED | Clearing the memory encryption attribute is not supported |
Definition at line 37 of file MemEncryptSevLib.c.
BOOLEAN EFIAPI MemEncryptSevEsDebugVirtualizationIsEnabled | ( | VOID | ) |
Returns a boolean to indicate whether DebugVirtualization is enabled.
TRUE | DebugVirtualization is enabled |
FALSE | DebugVirtualization is not enabled |
Definition at line 177 of file DxeMemEncryptSevLibInternal.c.
BOOLEAN EFIAPI MemEncryptSevEsIsEnabled | ( | VOID | ) |
Returns a boolean to indicate whether SEV-ES is enabled.
TRUE | SEV-ES is enabled |
FALSE | SEV-ES is not enabled |
Definition at line 128 of file DxeMemEncryptSevLibInternal.c.
MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE EFIAPI MemEncryptSevGetAddressRangeState | ( | IN PHYSICAL_ADDRESS | Cr3BaseAddress, |
IN PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINTN | Length | ||
) |
Returns the encryption state of the specified virtual address range.
[in] | Cr3BaseAddress | Cr3 Base Address (if zero then use current CR3) |
[in] | BaseAddress | Base address to check |
[in] | Length | Length of virtual address range |
MemEncryptSevAddressRangeUnencrypted | Address range is mapped unencrypted |
MemEncryptSevAddressRangeEncrypted | Address range is mapped encrypted |
MemEncryptSevAddressRangeMixed | Address range is mapped mixed |
MemEncryptSevAddressRangeError | Address range is not mapped |
Definition at line 97 of file MemEncryptSevLib.c.
UINT64 EFIAPI MemEncryptSevGetEncryptionMask | ( | VOID | ) |
Returns the SEV encryption mask.
Returns the SEV encryption mask.
Definition at line 157 of file DxeMemEncryptSevLibInternal.c.
BOOLEAN EFIAPI MemEncryptSevIsEnabled | ( | VOID | ) |
Returns a boolean to indicate whether SEV is enabled
TRUE | SEV is enabled |
FALSE | SEV is not enabled |
Returns a boolean to indicate whether SEV is enabled.
TRUE | SEV is enabled |
FALSE | SEV is not enabled |
Definition at line 143 of file DxeMemEncryptSevLibInternal.c.
RETURN_STATUS EFIAPI MemEncryptSevLocateInitialSmramSaveStateMapPages | ( | OUT UINTN * | BaseAddress, |
OUT UINTN * | NumberOfPages | ||
) |
Locate the page range that covers the initial (pre-SMBASE-relocation) SMRAM Save State Map.
[out] | BaseAddress | The base address of the lowest-address page that covers the initial SMRAM Save State Map. |
[out] | NumberOfPages | The number of pages in the page range that covers the initial SMRAM Save State Map. |
RETURN_SUCCESS | BaseAddress and NumberOfPages have been set on output. |
RETURN_UNSUPPORTED | SMM is unavailable. |
Definition at line 36 of file PeiDxeMemEncryptSevLibInternal.c.
RETURN_STATUS EFIAPI MemEncryptSevSetPageEncMask | ( | IN PHYSICAL_ADDRESS | Cr3BaseAddress, |
IN PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINTN | NumPages | ||
) |
This function sets memory encryption bit for the memory region specified by BaseAddress and NumPages from the current page table context.
[in] | Cr3BaseAddress | Cr3 Base Address (if zero then use current CR3) |
[in] | BaseAddress | The physical address that is the start address of a memory region. |
[in] | NumPages | The number of pages from start memory region. |
RETURN_SUCCESS | The attributes were set for the memory region. |
RETURN_INVALID_PARAMETER | Number of pages is zero. |
RETURN_UNSUPPORTED | Setting the memory encryption attribute is not supported |
Definition at line 68 of file MemEncryptSevLib.c.
BOOLEAN EFIAPI MemEncryptSevSnpIsEnabled | ( | VOID | ) |
Returns a boolean to indicate whether SEV-SNP is enabled
TRUE | SEV-SNP is enabled |
FALSE | SEV-SNP is not enabled |
Returns a boolean to indicate whether SEV-SNP is enabled.
TRUE | SEV-SNP is enabled |
FALSE | SEV-SNP is not enabled |
Definition at line 113 of file DxeMemEncryptSevLibInternal.c.
VOID EFIAPI MemEncryptSevSnpPreValidateSystemRam | ( | IN PHYSICAL_ADDRESS | BaseAddress, |
IN UINTN | NumPages | ||
) |
Pre-validate the system RAM when SEV-SNP is enabled in the guest VM.
[in] | BaseAddress | Base address |
[in] | NumPages | Number of pages starting from the base address |
Definition at line 149 of file MemEncryptSevLib.c.