pub struct KernelVmPager {
    pub loaders: BTreeMap<Gpa, PageLoader>,
    /* private fields */
}
Expand description

Vm Pager of the kernel.

Fields§

§loaders: BTreeMap<Gpa, PageLoader>

Implementations§

source§

impl KernelVmPager

source

pub fn from_image(kernel: File, ram_in_kb: usize) -> Option<Self>

Create a new vm pager from the kernel image.

source

pub fn finalize_mem(&mut self) -> Option<usize>

Setup the page for mbinfo.

source

pub fn entry(&self) -> usize

Get a entry point of the this kernel.

source

pub fn map_mmio_page( &mut self, gpa: Gpa, page: Page ) -> Result<(), EptMappingError>

Attach a mmio page at gpa.

source

pub fn map_page(&mut self, gpa: Gpa, loader: PageLoader) -> bool

Attach a page at gpa.

source

pub fn ept_ptr(&self) -> Pa

Get ept ptr of the pager.

source

pub fn try_lazy_paging( &mut self, reason: ExitReason ) -> Result<VmexitResult, VmError>

Handle the ept violation and load the corresponding page.

Trait Implementations§

source§

impl Probe for KernelVmPager

source§

fn gpa2hpa(&self, vmcs: &ActiveVmcs, gpa: Gpa) -> Option<Pa>

Translate guest physical address to host physical address
source§

fn gva2hpa(&self, vmcs: &ActiveVmcs, gva: Gva) -> Option<Pa>

Translate guest virtual address to host physical address
source§

fn gpa2hva(&self, vmcs: &ActiveVmcs, gpa: Gpa) -> Option<Va>

Translate guest physical address to host virtual address
source§

fn gva2hva(&self, vmcs: &ActiveVmcs, gva: Gva) -> Option<Va>

Translate guest virtual address to host virtual address

Auto Trait Implementations§

§

impl !RefUnwindSafe for KernelVmPager

§

impl Send for KernelVmPager

§

impl Sync for KernelVmPager

§

impl Unpin for KernelVmPager

§

impl !UnwindSafe for KernelVmPager

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

const: unstable§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

const: unstable§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

const: unstable§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

const: unstable§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable§

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

Performs the conversion.
§

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

§

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

The type returned in the event of a conversion error.
const: unstable§

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

Performs the conversion.