TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemEncryptSevLib.h>
#include <Register/Amd/Cpuid.h>
#include <Register/Amd/Msr.h>
#include <Register/Cpuid.h>
Go to the source code of this file.
Functions | |
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) |
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) |
Secure Encrypted Virtualization (SEV) library helper function
Copyright (c) 2017 - 2020, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MemEncryptSevLib.c.
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 |
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.
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.
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.
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.