Struct MemoryController

Source
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,

Source§

type Driver = Driver

VMI driver type.
Source§

fn new() -> Self

Creates a new TapController.
Source§

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>

Inserts a breakpoint at the given physical address.
Source§

fn remove_breakpoint( &mut self, _vmi: &VmiCore<Driver>, _pa: Pa, _view: View, ) -> Result<(), VmiError>

Removes a breakpoint at the given physical address.
Source§

fn monitor( &mut self, vmi: &VmiCore<Driver>, gfn: Gfn, view: View, ) -> Result<(), VmiError>

Monitors the given guest frame number.
Source§

fn unmonitor( &mut self, vmi: &VmiCore<Driver>, gfn: Gfn, view: View, ) -> Result<(), VmiError>

Unmonitors the given guest frame number.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,