pub struct MemoryController<Driver>where
Driver: VmiDriver,{ /* private fields */ }Expand description
Implements “memory breakpoints” by manipulating memory access permissions rather than modifying instructions.
When a breakpoint is inserted, the page is marked as non-executable - the guest can read or write to the page but cannot execute code from it without triggering an exception.
When a VCPU tries to execute code from the protected page, a VmiEvent is
generated with a memory access reason. As with the BreakpointController,
you can check if the event came from a breakpoint manager using
BreakpointManager::contains_by_event or BreakpointManager::get_by_event.
Regular read and write operations proceed normally without generating events.
Trait Implementations§
Source§impl<Driver> TapController for MemoryController<Driver>where
Driver: VmiDriver,
impl<Driver> TapController for MemoryController<Driver>where
Driver: VmiDriver,
Source§fn check_event(
&self,
event: &VmiEvent<Driver::Architecture>,
) -> Option<(View, Gfn)>
fn check_event( &self, event: &VmiEvent<Driver::Architecture>, ) -> Option<(View, Gfn)>
Checks if the given event was caused by a breakpoint.
Source§fn insert_breakpoint(
&mut self,
_vmi: &VmiCore<Driver>,
_pa: Pa,
_view: View,
) -> Result<(), VmiError>
fn insert_breakpoint( &mut self, _vmi: &VmiCore<Driver>, _pa: Pa, _view: View, ) -> Result<(), VmiError>
Inserts a breakpoint at the given physical address.
Source§fn remove_breakpoint(
&mut self,
_vmi: &VmiCore<Driver>,
_pa: Pa,
_view: View,
) -> Result<(), VmiError>
fn remove_breakpoint( &mut self, _vmi: &VmiCore<Driver>, _pa: Pa, _view: View, ) -> Result<(), VmiError>
Removes a breakpoint at the given physical address.
Auto Trait Implementations§
impl<Driver> Freeze for MemoryController<Driver>
impl<Driver> RefUnwindSafe for MemoryController<Driver>where
Driver: RefUnwindSafe,
impl<Driver> Send for MemoryController<Driver>where
Driver: Send,
impl<Driver> Sync for MemoryController<Driver>where
Driver: Sync,
impl<Driver> Unpin for MemoryController<Driver>where
Driver: Unpin,
impl<Driver> UnwindSafe for MemoryController<Driver>where
Driver: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more