Skip to content

Commit cbac50b

Browse files
committed
Windows fix
Signed-off-by: Simon Davies <[email protected]>
1 parent d3b06f6 commit cbac50b

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

src/hyperlight_host/src/hypervisor/hyperv_windows.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -610,24 +610,7 @@ impl Hypervisor for HypervWindowsDriver {
610610
fn get_and_clear_dirty_pages(&mut self) -> Result<Vec<u64>> {
611611
// For now we just mark all pages dirty which is the equivalent of taking a full snapshot
612612
let total_size = self.mem_regions.iter().map(|r| r.guest_region.len()).sum();
613-
let bitmap = new_page_bitmap(total_size, true)?;
614-
615-
// Count the number of set bits in the bitmap
616-
let set_bit_count = crate::mem::bitmap::bit_index_iterator(&bitmap).count();
617-
let expected_count = total_size.div_ceil(hyperlight_common::mem::PAGE_SIZE_USIZE);
618-
619-
if set_bit_count * hyperlight_common::mem::PAGE_SIZE_USIZE != total_size {
620-
println!(
621-
"Dirty page bitmap size mismatch: {} set bits * {} page size = {} bytes, but expected {} bytes and {} set bits",
622-
set_bit_count,
623-
hyperlight_common::mem::PAGE_SIZE_USIZE,
624-
set_bit_count * hyperlight_common::mem::PAGE_SIZE_USIZE,
625-
total_size,
626-
expected_count
627-
);
628-
}
629-
630-
Ok(bitmap)
613+
new_page_bitmap(total_size, true)
631614
}
632615

633616
#[instrument(err(Debug), skip_all, parent = Span::current(), level = "Trace")]

src/hyperlight_host/src/mem/windows_dirty_page_tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ impl DirtyPageTracking for WindowsDirtyPageTracker {
6262
/// until we implement actual dirty page tracking
6363
fn get_dirty_pages(self) -> Vec<usize> {
6464
// Return all page indices from 0 to num_pages-1
65-
(0..self.num_pages).collect()
65+
(0..self.num_pages - 2).collect() // exclude the guard pages
6666
}
6767
}

0 commit comments

Comments
 (0)