TianoCore EDK2 master
Loading...
Searching...
No Matches
MemEncryptSevLib.c File Reference

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)
 

Detailed Description

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.

Function Documentation

◆ MemEncryptSevClearMmioPageEncMask()

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.

Parameters
[in]Cr3BaseAddressCr3 Base Address (if zero then use current CR3)
[in]BaseAddressThe physical address that is the start address of a mmio region.
[in]NumPagesThe number of pages from start memory region.
Return values
RETURN_SUCCESSThe attributes were cleared for the memory region.
RETURN_INVALID_PARAMETERNumber of pages is zero.
RETURN_UNSUPPORTEDClearing the memory encryption attribute is not supported

Definition at line 133 of file MemEncryptSevLib.c.

◆ MemEncryptSevClearPageEncMask()

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.

Parameters
[in]Cr3BaseAddressCr3 Base Address (if zero then use current CR3)
[in]BaseAddressThe physical address that is the start address of a memory region.
[in]NumPagesThe number of pages from start memory region.
Return values
RETURN_SUCCESSThe attributes were cleared for the memory region.
RETURN_INVALID_PARAMETERNumber of pages is zero.
RETURN_UNSUPPORTEDClearing the memory encryption attribute is not supported

Definition at line 39 of file MemEncryptSevLib.c.

◆ MemEncryptSevGetAddressRangeState()

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.

Parameters
[in]Cr3BaseAddressCr3 Base Address (if zero then use current CR3)
[in]BaseAddressBase address to check
[in]LengthLength of virtual address range
Return values
MemEncryptSevAddressRangeUnencryptedAddress range is mapped unencrypted
MemEncryptSevAddressRangeEncryptedAddress range is mapped encrypted
MemEncryptSevAddressRangeMixedAddress range is mapped mixed
MemEncryptSevAddressRangeErrorAddress range is not mapped

Definition at line 101 of file MemEncryptSevLib.c.

◆ MemEncryptSevSetPageEncMask()

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.

Parameters
[in]Cr3BaseAddressCr3 Base Address (if zero then use current CR3)
[in]BaseAddressThe physical address that is the start address of a memory region.
[in]NumPagesThe number of pages from start memory region.
Return values
RETURN_SUCCESSThe attributes were set for the memory region.
RETURN_INVALID_PARAMETERNumber of pages is zero.
RETURN_UNSUPPORTEDSetting the memory encryption attribute is not supported

Definition at line 71 of file MemEncryptSevLib.c.