Struct project3::ept::ExtendedPageTable
source · pub struct ExtendedPageTable(_);
Expand description
Second level page table that holds guest-physical to host-physical mapping.
Implementations§
source§impl ExtendedPageTable
impl ExtendedPageTable
pub fn new() -> Self
pub fn pa(&self) -> Pa
sourcepub fn map(
&mut self,
gpa: Gpa,
pg: Page,
perm: Permission
) -> Result<(), EptMappingError>
pub fn map( &mut self, gpa: Gpa, pg: Page, perm: Permission ) -> Result<(), EptMappingError>
Map pg
into va
with permission perm
.
sourcepub unsafe fn do_map(
&mut self,
gpa: Gpa,
hpa: Pa,
perm: Permission
) -> Result<(), EptMappingError>
pub unsafe fn do_map( &mut self, gpa: Gpa, hpa: Pa, perm: Permission ) -> Result<(), EptMappingError>
Map hpa
into pa
with permission perm
.
sourcepub fn unmap(&mut self, gpa: Gpa) -> Result<Page, EptMappingError>
pub fn unmap(&mut self, gpa: Gpa) -> Result<Page, EptMappingError>
Unmap the gpa
and returns Page
that was mapped to gpa
.
sourcepub fn walk(&self, gpa: Gpa) -> Result<&EptPte, EptMappingError>
pub fn walk(&self, gpa: Gpa) -> Result<&EptPte, EptMappingError>
Walk the extended page table and return corresponding eptpte of the gpa
if exist.
Trait Implementations§
source§impl Probe for ExtendedPageTable
impl Probe for ExtendedPageTable
source§fn gpa2hpa(&self, _vmcs: &ActiveVmcs, gpa: Gpa) -> Option<Pa>
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>
fn gva2hpa(&self, vmcs: &ActiveVmcs, gva: Gva) -> Option<Pa>
Translate guest virtual address to host physical address
Auto Trait Implementations§
impl RefUnwindSafe for ExtendedPageTable
impl Send for ExtendedPageTable
impl Sync for ExtendedPageTable
impl Unpin for ExtendedPageTable
impl UnwindSafe for ExtendedPageTable
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
const: unstable§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more