3 Define Memory Encrypted Virtualization base library helper function
5 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef MEM_ENCRYPT_TDX_LIB_H_
13 #define MEM_ENCRYPT_TDX_LIB_H_
18 Returns boolean to indicate whether to indicate which, if any, memory encryption is enabled
20 @param[in] Type Bitmask of encryption technologies to check is enabled
22 @retval TRUE The encryption type(s) are enabled
23 @retval FALSE The encryption type(s) are not enabled
27 MemEncryptTdxIsEnabled (
32 This function clears memory encryption bit for the memory region specified by
33 BaseAddress and NumPages from the current page table context.
35 @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use
37 @param[in] BaseAddress The physical address that is the start
38 address of a memory region.
39 @param[in] NumPages The number of pages from start memory
42 @retval RETURN_SUCCESS The attributes were cleared for the
44 @retval RETURN_INVALID_PARAMETER Number of pages is zero.
45 @retval RETURN_UNSUPPORTED Clearing the memory encryption attribute
50 MemEncryptTdxSetPageSharedBit (
51 IN PHYSICAL_ADDRESS Cr3BaseAddress
,
52 IN PHYSICAL_ADDRESS BaseAddress
,
57 This function sets memory encryption bit for the memory region specified by
58 BaseAddress and NumPages from the current page table context.
60 @param[in] Cr3BaseAddress Cr3 Base Address (if zero then use
62 @param[in] BaseAddress The physical address that is the start
63 address of a memory region.
64 @param[in] NumPages The number of pages from start memory
67 @retval RETURN_SUCCESS The attributes were set for the memory
69 @retval RETURN_INVALID_PARAMETER Number of pages is zero.
70 @retval RETURN_UNSUPPORTED Setting the memory encryption attribute
75 MemEncryptTdxClearPageSharedBit (
76 IN PHYSICAL_ADDRESS Cr3BaseAddress
,
77 IN PHYSICAL_ADDRESS BaseAddress
,
81 #endif // _MEM_ENCRYPT_TDX_LIB_H_