[][src]Struct xhypervisor::vCPU

pub struct vCPU {
    pub id: u32,
}

Virtual CPU

Fields

id: u32

Virtual CPU ID

Methods

impl vCPU[src]

pub fn new() -> Result<vCPU, Error>[src]

Creates a vCPU instance for the current thread

pub fn destroy(&self) -> Result<(), Error>[src]

Destroys the vCPU instance associated with the current thread

pub fn run(&self) -> Result<(), Error>[src]

Executes the vCPU

pub fn interrupt(&self) -> Result<(), Error>[src]

Forces an immediate VMEXIT of the vCPU

pub fn exec_time(&self) -> Result<u64, Error>[src]

Returns the cumulative execution time of the vCPU in nanoseconds

pub fn flush(&self) -> Result<(), Error>[src]

Forces flushing of cached vCPU state

pub fn invalidate_tlb(&self) -> Result<(), Error>[src]

Invalidates the translation lookaside buffer (TLB) of the vCPU

pub fn enable_native_msr(&self, msr: u32, enable: bool) -> Result<(), Error>[src]

Enables an MSR to be used natively by the VM

pub fn read_msr(&self, msr: u32) -> Result<u64, Error>[src]

Returns the current value of an MSR of the vCPU

pub fn write_msr(&self, msr: u32, value: u64) -> Result<(), Error>[src]

Set the value of an MSR of the vCPU

pub fn read_register(&self, reg: &x86Reg) -> Result<u64, Error>[src]

Returns the current value of an architectural x86 register of the vCPU

pub fn write_register(&self, reg: &x86Reg, value: u64) -> Result<(), Error>[src]

Sets the value of an architectural x86 register of the vCPU

pub fn read_vmcs(&self, field: u32) -> Result<u64, Error>[src]

Returns the current value of a VMCS field of the vCPU

pub fn write_vmcs(&self, field: u32, value: u64) -> Result<(), Error>[src]

Sets the value of a VMCS field of the vCPU

pub fn set_apic_addr(&self, gpa: u64) -> Result<(), Error>[src]

Sets the address of the guest APIC for the vCPU in the guest physical address space of the VM

pub fn read_fpstate(&self, buffer: &mut [u8]) -> Result<(), Error>[src]

Reads the current architectural x86 floating point and SIMD state of the vCPU

pub fn write_fpstate(&self, buffer: &[u8]) -> Result<(), Error>[src]

Sets the architectural x86 floating point and SIMD state of the vCPU

Trait Implementations

impl Debug for vCPU[src]

Auto Trait Implementations

impl RefUnwindSafe for vCPU

impl Send for vCPU

impl Sync for vCPU

impl Unpin for vCPU

impl UnwindSafe for vCPU

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.