From 668512f585826c8a0bc6fdd4bb478d4383b5304c Mon Sep 17 00:00:00 2001 From: Tom Dohrmann Date: Fri, 30 Aug 2024 06:56:24 +0000 Subject: [PATCH] ghcb: remove DerefMut impl 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 --- kernel/src/sev/ghcb.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/kernel/src/sev/ghcb.rs b/kernel/src/sev/ghcb.rs index e728ec404..34113624d 100644 --- a/kernel/src/sev/ghcb.rs +++ b/kernel/src/sev/ghcb.rs @@ -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}; @@ -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 {