Skip to content

Commit 0571129

Browse files
committed
Ensure that the memory mapped file handle is passed to the HypervWindowsDriver
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 879a0e0 commit 0571129

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/hyperlight_host/src/hypervisor/hypervisor_handler.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,17 @@ fn set_up_hypervisor_partition(
893893

894894
#[cfg(target_os = "windows")]
895895
Some(HypervisorType::Whp) => {
896+
let mmap_file_handle = mgr
897+
.shared_mem
898+
.with_exclusivity(|e| e.get_mmap_file_handle())?;
896899
let hv = crate::hypervisor::hyperv_windows::HypervWindowsDriver::new(
897900
regions,
898901
mgr.shared_mem.raw_mem_size(), // we use raw_* here because windows driver requires 64K aligned addresses,
899902
mgr.shared_mem.raw_ptr() as *mut c_void, // and instead convert it to base_addr where needed in the driver itself
900903
pml4_ptr.absolute()?,
901904
entrypoint_ptr.absolute()?,
902905
rsp_ptr.absolute()?,
906+
mmap_file_handle,
903907
)?;
904908
Ok(Box::new(hv))
905909
}

0 commit comments

Comments
 (0)