Struct xhypervisor::x86_64::VirtualCpu
source · [−]pub struct VirtualCpu { /* private fields */ }
Expand description
Virtual CPU
Implementations
sourceimpl VirtualCpu
impl VirtualCpu
sourcepub fn new() -> Result<VirtualCpu, Error>
pub fn new() -> Result<VirtualCpu, Error>
Creates a VirtualCpu instance for the current thread
pub fn get_id(&self) -> hv_vcpuid_t
sourcepub fn exec_time(&self) -> Result<u64, Error>
pub fn exec_time(&self) -> Result<u64, Error>
Returns the cumulative execution time of the VirtualCpu in nanoseconds
sourcepub fn invalidate_tlb(&self) -> Result<(), Error>
pub fn invalidate_tlb(&self) -> Result<(), Error>
Invalidates the translation lookaside buffer (TLB) of the VirtualCpu
sourcepub fn enable_native_msr(&self, msr: u32, enable: bool) -> Result<(), Error>
pub fn enable_native_msr(&self, msr: u32, enable: bool) -> Result<(), Error>
Enables an MSR to be used natively by the VM
sourcepub fn read_msr(&self, msr: u32) -> Result<u64, Error>
pub fn read_msr(&self, msr: u32) -> Result<u64, Error>
Returns the current value of an MSR of the VirtualCpu
sourcepub fn write_msr(&self, msr: u32, value: u64) -> Result<(), Error>
pub fn write_msr(&self, msr: u32, value: u64) -> Result<(), Error>
Set the value of an MSR of the VirtualCpu
sourcepub fn read_register(&self, reg: &Register) -> Result<u64, Error>
pub fn read_register(&self, reg: &Register) -> Result<u64, Error>
Returns the current value of an architectural x86 register of the VirtualCpu
sourcepub fn write_register(&self, reg: &Register, value: u64) -> Result<(), Error>
pub fn write_register(&self, reg: &Register, value: u64) -> Result<(), Error>
Sets the value of an architectural x86 register of the VirtualCpu
sourcepub fn read_vmcs(&self, field: u32) -> Result<u64, Error>
pub fn read_vmcs(&self, field: u32) -> Result<u64, Error>
Returns the current value of a VMCS field of the VirtualCpu
sourcepub fn write_vmcs(&self, field: u32, value: u64) -> Result<(), Error>
pub fn write_vmcs(&self, field: u32, value: u64) -> Result<(), Error>
Sets the value of a VMCS field of the VirtualCpu
sourcepub fn set_apic_addr(&self, gpa: u64) -> Result<(), Error>
pub fn set_apic_addr(&self, gpa: u64) -> Result<(), Error>
Sets the address of the guest APIC for the VirtualCpu in the guest physical address space of the VM
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for VirtualCpu
impl Send for VirtualCpu
impl Sync for VirtualCpu
impl Unpin for VirtualCpu
impl UnwindSafe for VirtualCpu
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more