Skip to content

Commit

Permalink
unsafe func from_bits_unchecked was deprecated, use safe func from_bi…
Browse files Browse the repository at this point in the history
…ts_retain instead.

Signed-off-by: Ping Zhao <ping.zhao@intel.com>
  • Loading branch information
pingzhaozz authored and jyao1 committed Feb 2, 2024
1 parent 18c94ec commit 9b4e454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion td-shim/src/bin/td-shim/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl<'a> Memory<'a> {
pub fn set_shared_bit(&mut self, address: u64, size: u64) {
let shared_page_flag = td::get_shared_page_mask();
let mut flags = Flags::PRESENT | Flags::WRITABLE;
flags = unsafe { Flags::from_bits_unchecked(flags.bits() | shared_page_flag) };
flags = Flags::from_bits_retain(flags.bits() | shared_page_flag);

td_paging::set_page_flags(&mut self.pt, VirtAddr::new(address), size as i64, flags);
}
Expand Down

0 comments on commit 9b4e454

Please sign in to comment.