#[repr(C, align(4096))]pub struct Vmcb {
bytes: [u8; 4096],
}Expand description
One VMCB: 4 KiB, page-aligned, zero-initialized.
Fields§
§bytes: [u8; 4096]Implementations§
Source§impl Vmcb
impl Vmcb
Sourcepub fn write_segment(
&mut self,
offset: usize,
selector: u16,
attrib: u16,
limit: u32,
base: u64,
)
pub fn write_segment( &mut self, offset: usize, selector: u16, attrib: u16, limit: u32, base: u64, )
Writes a segment register (selector, attributes, limit, base).
attrib uses the VMCB packed format: bits 0-7 = type/S/DPL/P,
bits 8-11 = AVL/L/D/B/G (the access-rights byte followed by the
flags nibble of a descriptor).
Sourcepub fn read_segment(&self, offset: usize) -> (u16, u16, u32, u64)
pub fn read_segment(&self, offset: usize) -> (u16, u16, u32, u64)
Reads a segment register as (selector, attrib, limit, base).
Sourcepub fn install_mandatory_intercepts(&mut self)
pub fn install_mandatory_intercepts(&mut self)
Installs the always-on intercepts (see MANDATORY_INTERCEPT4).
Sourcepub fn enable_nested_paging(&mut self, ncr3: u64, asid: u32)
pub fn enable_nested_paging(&mut self, ncr3: u64, asid: u32)
Enables nested paging with the given nCR3 and guest ASID.
ASID 0 is reserved for the host: the guest ASID must be non-zero.
Sourcepub fn exit_class(&self) -> ExitClass
pub fn exit_class(&self) -> ExitClass
Class of the last #VMEXIT.
Sourcepub fn nested_fault(&self) -> Option<NestedFault>
pub fn nested_fault(&self) -> Option<NestedFault>
Decoded nested page fault, if the last exit was one.
Sourcepub fn inject(&mut self, event: u32, error_code: u32)
pub fn inject(&mut self, event: u32, error_code: u32)
Queues an event for injection at the next vmrun.
Sourcepub fn advance_rip_from_next(&mut self) -> bool
pub fn advance_rip_from_next(&mut self) -> bool
Advances the guest RIP past the intercepted instruction using the
hardware-provided NEXT_RIP (requires NRIP_SAVE). Returns false
if NEXT_RIP is zero (feature absent): the caller must decode.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Vmcb
impl Freeze for Vmcb
impl Move for Vmcb
impl RefUnwindSafe for Vmcb
impl Send for Vmcb
impl Sync for Vmcb
impl Unpin for Vmcb
impl UnsafeUnpin for Vmcb
impl UnwindSafe for Vmcb
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more