mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: tdx: make tdx_init_memory_region() unsafe
It takes a pointer to a userspace address that it accesses, so it should be marked unsafe. This was missed earlier. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
committed by
Rob Bradford
parent
021f450cdb
commit
969a3b57a3
@@ -1020,11 +1020,13 @@ impl vm::Vm for KvmVm {
|
||||
.map_err(vm::HypervisorVmError::FinalizeTdx)
|
||||
}
|
||||
|
||||
///
|
||||
/// Initialize memory regions for the TDX VM
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// `host_address` must be valid for `size` bytes
|
||||
#[cfg(feature = "tdx")]
|
||||
fn tdx_init_memory_region(
|
||||
unsafe fn tdx_init_memory_region(
|
||||
&self,
|
||||
host_address: *mut u8,
|
||||
guest_address: u64,
|
||||
|
||||
@@ -401,7 +401,11 @@ pub trait Vm: Send + Sync + Any {
|
||||
}
|
||||
#[cfg(feature = "tdx")]
|
||||
/// Initialize a TDX memory region for this VM
|
||||
fn tdx_init_memory_region(
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// `_host_address` must be valid for `_size` bytes
|
||||
unsafe fn tdx_init_memory_region(
|
||||
&self,
|
||||
_host_address: *mut u8,
|
||||
_guest_address: u64,
|
||||
|
||||
Reference in New Issue
Block a user