Skip to content

Commit cb0e562

Browse files
simongdaviesludfjig
authored andcommitted
Add method to retrieve and clear dirty pages as a bitmap
Signed-off-by: Simon Davies <[email protected]>
1 parent 113ca64 commit cb0e562

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
@@ -196,6 +196,11 @@ pub(crate) trait Hypervisor: Debug + Sync + Send {
196196
None
197197
}
198198

199+
/// Get dirty pages as a bitmap (Vec<u64>).
200+
/// Each bit in a u64 represents a page.
201+
/// This also clears the bitflags, marking the pages as non-dirty.
202+
fn get_and_clear_dirty_pages(&mut self) -> Result<Vec<u64>>;
203+
199204
/// Get InterruptHandle to underlying VM
200205
fn interrupt_handle(&self) -> Arc<dyn InterruptHandle>;
201206

@@ -557,12 +562,14 @@ pub(crate) mod tests {
557562
let rt_cfg: SandboxRuntimeConfig = Default::default();
558563
let sandbox =
559564
UninitializedSandbox::new(GuestBinary::FilePath(filename.clone()), Some(config))?;
565+
let tracker = sandbox.tracker;
560566
let (_hshm, mut gshm) = sandbox.mgr.build();
561567
let mut vm = set_up_hypervisor_partition(
562568
&mut gshm,
563569
&config,
564570
#[cfg(any(crashdump, gdb))]
565571
&rt_cfg,
572+
tracker,
566573
)?;
567574
vm.initialise(
568575
RawPtr::from(0x230000),

0 commit comments

Comments
 (0)