kvm

Struct Processor

Source
pub struct Processor<'a>(/* private fields */);

Implementations§

Source§

impl<'a> Processor<'a>

Source

pub fn enable_synic(&self) -> Result<(), Error>

Source

pub fn set_cpuid(&self, entries: &[kvm_cpuid_entry2]) -> Result<(), Error>

Source

pub fn force_exit(&self)

Forces an exit to be returned from the next call to VpRunner::run.

Note that this does nothing if a VpRunner does not currently exist for this VP, or if this is called from the same thread as the runner.

Source

pub fn interrupt(&self, vector: u32) -> Result<(), Error>

Source

pub fn set_reg64(&self, reg_id: u64, value: u64) -> Result<(), Error>

Very not structured way of setting the register. Could enjoy using an enum.

Source

pub fn set_regs(&self, regs: &kvm_regs) -> Result<(), Error>

Source

pub fn set_sregs(&self, sregs: &kvm_sregs) -> Result<(), Error>

Source

pub fn get_reg64(&self, reg_id: u64) -> Result<u64, Error>

Very not structured way of getting the register. Could enjoy using an enum.

Source

pub fn get_regs(&self) -> Result<kvm_regs, Error>

Source

pub fn get_sregs(&self) -> Result<kvm_sregs, Error>

Source

pub fn get_msrs(&self, msrs: &[u32], values: &mut [u64]) -> Result<(), Error>

Source

pub fn set_msrs(&self, msrs: &[(u32, u64)]) -> Result<(), Error>

Source

pub fn get_lapic(&self, state: &mut [u8; 1024]) -> Result<(), Error>

Source

pub fn set_lapic(&self, state: &[u8; 1024]) -> Result<(), Error>

Source

pub fn get_xsave(&self, state: &mut [u8; 4096]) -> Result<(), Error>

Source

pub fn set_xsave(&self, state: &[u8; 4096]) -> Result<(), Error>

Source

pub fn set_debug_regs(&self, regs: &DebugRegisters) -> Result<(), Error>

Source

pub fn get_debug_regs(&self) -> Result<DebugRegisters, Error>

Source

pub fn set_xcr0(&self, value: u64) -> Result<(), Error>

Source

pub fn get_xcr0(&self) -> Result<u64, Error>

Source

pub fn set_mp_state(&self, state: u32) -> Result<(), Error>

Source

pub fn get_mp_state(&self) -> Result<u32, Error>

Source

pub fn set_vcpu_events(&self, events: &kvm_vcpu_events) -> Result<(), Error>

Source

pub fn get_vcpu_events(&self) -> Result<kvm_vcpu_events, Error>

Source

pub fn translate_gva(&self, gva: u64) -> Result<kvm_translation, Error>

Source

pub fn set_guest_debug( &self, control: u32, db: [u64; 4], dr7: u64, ) -> Result<(), Error>

Sets the guest debugging state: control bits KVM_GUESTDBG_*, db containing DR0 through DR3, and dr7.

Source

pub unsafe fn set_device_attr<T>( &self, group: u32, attr: u32, addr: &T, flags: u32, ) -> Result<c_int>

§Safety

addr must point to the appropriate input for the attribute being set.

Source

pub fn runner(&self) -> VpRunner<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Processor<'a>

§

impl<'a> !RefUnwindSafe for Processor<'a>

§

impl<'a> Send for Processor<'a>

§

impl<'a> Sync for Processor<'a>

§

impl<'a> Unpin for Processor<'a>

§

impl<'a> !UnwindSafe for Processor<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more