File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ pub(crate) static ENC_BIT_MASK: AtomicU64 = AtomicU64::new(0);
17
17
/// than encrypted)
18
18
static ENC_BIT_REVERSED : AtomicBool = AtomicBool :: new ( false ) ;
19
19
20
+ /// Defines the configuration for memory encryption
21
+ #[ derive( Debug ) ]
20
22
pub enum MemoryEncryptionConfiguration {
21
23
/// Defines that a memory page should be accessed encrypted if this bit of its physical address
22
24
/// is set in the page table entry.
@@ -33,6 +35,10 @@ pub enum MemoryEncryptionConfiguration {
33
35
34
36
/// Enable memory encryption by defining the physical address bit that is used to mark a page
35
37
/// encrypted (or shared) in a page table entry
38
+ ///
39
+ /// # Safety
40
+ /// Caller must make sure that any existing page table entry is discarded or adapted to take this
41
+ /// bit into consideration
36
42
pub unsafe fn enable_memory_encryption ( configuration : MemoryEncryptionConfiguration ) {
37
43
let ( bit_position, reversed) = match configuration {
38
44
MemoryEncryptionConfiguration :: EncryptBit ( pos) => ( pos as u64 , false ) ,
You can’t perform that action at this time.
0 commit comments