Skip to content

Commit

Permalink
ghcb: remove DerefMut impl
Browse files Browse the repository at this point in the history
This impl is unused. It is also unsound because we can never have
unique ownership over the GHCB as long as it is shared with the host.

Signed-off-by: Tom Dohrmann <[email protected]>
  • Loading branch information
Freax13 committed Aug 30, 2024
1 parent 57fd31d commit 668512f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions kernel/src/sev/ghcb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::utils::MemoryRegion;
use crate::mm::PageBox;
use core::arch::global_asm;
use core::mem::{self, offset_of};
use core::ops::{Deref, DerefMut};
use core::ops::Deref;
use core::ptr;
use core::sync::atomic::{AtomicU16, AtomicU32, AtomicU64, AtomicU8, Ordering};

Expand Down Expand Up @@ -173,12 +173,6 @@ impl Deref for GhcbPage {
}
}

impl DerefMut for GhcbPage {
fn deref_mut(&mut self) -> &mut Self::Target {
self.0.deref_mut()
}
}

#[repr(C)]
#[derive(Debug)]
pub struct GHCB {
Expand Down

0 comments on commit 668512f

Please sign in to comment.