Skip to content

Commit bace96b

Browse files
committed
Add method to retrieve and clear dirty pages as a bitmap
Signed-off-by: Simon Davies <[email protected]>
1 parent 0d52440 commit bace96b

File tree

1 file changed

+7
-0
lines changed
  • src/hyperlight_host/src/hypervisor

1 file changed

+7
-0
lines changed

src/hyperlight_host/src/hypervisor/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ pub(crate) trait Hypervisor: Debug + Sync + Send {
187187
None
188188
}
189189

190+
/// Get dirty pages as a bitmap (Vec<u64>).
191+
/// Each bit in a u64 represents a page.
192+
/// This also clears the bitflags, marking the pages as non-dirty.
193+
fn get_and_clear_dirty_pages(&mut self) -> Result<Vec<u64>>;
194+
190195
/// Get InterruptHandle to underlying VM
191196
fn interrupt_handle(&self) -> Arc<dyn InterruptHandle>;
192197

@@ -548,12 +553,14 @@ pub(crate) mod tests {
548553
let rt_cfg: SandboxRuntimeConfig = Default::default();
549554
let sandbox =
550555
UninitializedSandbox::new(GuestBinary::FilePath(filename.clone()), Some(config))?;
556+
let tracker = sandbox.tracker;
551557
let (_hshm, mut gshm) = sandbox.mgr.build();
552558
let mut vm = set_up_hypervisor_partition(
553559
&mut gshm,
554560
&config,
555561
#[cfg(any(crashdump, gdb))]
556562
&rt_cfg,
563+
tracker,
557564
)?;
558565
vm.initialise(
559566
RawPtr::from(0x230000),

0 commit comments

Comments
 (0)