Skip to content

Commit

Permalink
feat(utils/ptm): use MemoryAccessOptions to ignore page walk updates …
Browse files Browse the repository at this point in the history
…in memory access monitoring
  • Loading branch information
wbenny committed Feb 4, 2025
1 parent 157f3bc commit 4eb108c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/vmi-utils/src/ptm/arch/amd64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::collections::{HashMap, HashSet};

use vmi_arch_amd64::{Amd64, PageTableEntry, PageTableLevel};
use vmi_core::{
AddressContext, Architecture as _, Gfn, MemoryAccess, Pa, VcpuId, View, VmiCore, VmiDriver,
VmiError,
AddressContext, Architecture as _, Gfn, MemoryAccess, MemoryAccessOptions, Pa, VcpuId, View, VmiCore, VmiDriver, VmiError
};

use super::{
Expand Down Expand Up @@ -111,7 +110,7 @@ where
/// Monitor a guest frame number for write access.
fn monitor(&mut self, vmi: &VmiCore<Driver>, gfn: Gfn, view: View) -> Result<(), VmiError> {
self.monitored_gfns.insert((view, gfn));
vmi.set_memory_access(gfn, view, MemoryAccess::R)
vmi.set_memory_access_with_options(gfn, view, MemoryAccess::R, MemoryAccessOptions::IGNORE_PAGE_WALK_UPDATES)
}

/// Unmonitor a guest frame number.
Expand Down

0 comments on commit 4eb108c

Please sign in to comment.