3 Define Secure Encrypted Virtualization (SEV) base library helper function
5 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef _MEM_ENCRYPT_SEV_LIB_H_
18 #define _MEM_ENCRYPT_SEV_LIB_H_
23 Returns a boolean to indicate whether SEV is enabled
25 @retval TRUE SEV is enabled
26 @retval FALSE SEV is not enabled
30 MemEncryptSevIsEnabled (
35 This function clears memory encryption bit for the memory region specified
36 by BaseAddress and Number of pages from the current page table context.
38 @param[in] BaseAddress The physical address that is the start
39 address of a memory region.
40 @param[in] NumberOfPages The number of pages from start memory
42 @param[in] Flush Flush the caches before clearing the bit
43 (mostly TRUE except MMIO addresses)
45 @retval RETURN_SUCCESS The attributes were cleared for the memory
47 @retval RETURN_INVALID_PARAMETER Number of pages is zero.
48 @retval RETURN_UNSUPPORTED Clearing memory encryption attribute is not
53 MemEncryptSevClearPageEncMask (
54 IN PHYSICAL_ADDRESS Cr3BaseAddress
,
55 IN PHYSICAL_ADDRESS BaseAddress
,
56 IN UINTN NumberOfPages
,
61 This function sets memory encryption bit for the memory region specified by
62 BaseAddress and Number of pages from the current page table context.
64 @param[in] BaseAddress The physical address that is the start
65 address of a memory region.
66 @param[in] NumberOfPages The number of pages from start memory
68 @param[in] Flush Flush the caches before clearing the bit
69 (mostly TRUE except MMIO addresses)
71 @retval RETURN_SUCCESS The attributes were set for the memory
73 @retval RETURN_INVALID_PARAMETER Number of pages is zero.
74 @retval RETURN_UNSUPPORTED Clearing memory encryption attribute is not
79 MemEncryptSevSetPageEncMask (
80 IN PHYSICAL_ADDRESS Cr3BaseAddress
,
81 IN PHYSICAL_ADDRESS BaseAddress
,
82 IN UINTN NumberOfPages
,
85 #endif // _MEM_ENCRYPT_SEV_LIB_H_