Skip to content

Commit 0a575d4

Browse files
committed
[whp] Remove initial_memory_setup_done, which is no longer used
whp can now map any region as long as it contains a file handle (which, presently, only snapshot and scratch regions do---not user-provided regions). Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
1 parent 9209f1c commit 0a575d4

3 files changed

Lines changed: 0 additions & 19 deletions

File tree

src/hyperlight_host/src/hypervisor/hyperlight_vm.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,6 @@ impl HyperlightVm {
367367
};
368368
}
369369

370-
// Mark initial setup as complete for Windows - subsequent map_memory calls will fail
371-
#[cfg(target_os = "windows")]
372-
vm.complete_initial_memory_setup();
373-
374370
#[cfg(feature = "init-paging")]
375371
vm.set_sregs(&CommonSpecialRegisters::standard_64bit_defaults(_pml4_addr))
376372
.map_err(VmError::Register)?;

src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,6 @@ pub(crate) trait VirtualMachine: Debug + Send {
324324
/// Get partition handle
325325
#[cfg(target_os = "windows")]
326326
fn partition_handle(&self) -> windows::Win32::System::Hypervisor::WHV_PARTITION_HANDLE;
327-
328-
/// Mark that initial memory setup is complete. After this, map_memory will fail.
329-
/// This is only needed on Windows where dynamic memory mapping is not yet supported.
330-
#[cfg(target_os = "windows")]
331-
fn complete_initial_memory_setup(&mut self);
332327
}
333328

334329
#[cfg(test)]

src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ pub(crate) struct WhpVm {
6969
partition: WHV_PARTITION_HANDLE,
7070
// Surrogate process for memory mapping
7171
surrogate_process: SurrogateProcess,
72-
// Track if initial memory setup is complete.
73-
// Used to reject later memory mapping since it's not supported on windows.
74-
// TODO remove this flag once memory mapping is supported on windows.
75-
initial_memory_setup_done: bool,
7672
}
7773

7874
// Safety: `WhpVm` is !Send because it holds `SurrogateProcess` which contains a raw pointer
@@ -111,7 +107,6 @@ impl WhpVm {
111107
Ok(WhpVm {
112108
partition,
113109
surrogate_process,
114-
initial_memory_setup_done: false,
115110
})
116111
}
117112

@@ -505,11 +500,6 @@ impl VirtualMachine for WhpVm {
505500
Ok(xsave_buffer)
506501
}
507502

508-
/// Mark that initial memory setup is complete. After this, map_memory will fail.
509-
fn complete_initial_memory_setup(&mut self) {
510-
self.initial_memory_setup_done = true;
511-
}
512-
513503
/// Get the partition handle for this VM
514504
fn partition_handle(&self) -> WHV_PARTITION_HANDLE {
515505
self.partition

0 commit comments

Comments
 (0)