pub trait VcpuX86_64: Vcpu {
Show 29 methods fn set_interrupt_window_requested(&self, requested: bool); fn ready_for_interrupt(&self) -> bool; fn interrupt(&self, irq: u32) -> Result<()>; fn inject_nmi(&self) -> Result<()>; fn get_regs(&self) -> Result<Regs>; fn set_regs(&self, regs: &Regs) -> Result<()>; fn get_sregs(&self) -> Result<Sregs>; fn set_sregs(&self, sregs: &Sregs) -> Result<()>; fn get_fpu(&self) -> Result<Fpu>; fn set_fpu(&self, fpu: &Fpu) -> Result<()>; fn get_debugregs(&self) -> Result<DebugRegs>; fn set_debugregs(&self, debugregs: &DebugRegs) -> Result<()>; fn get_xcrs(&self) -> Result<Vec<Register>>; fn set_xcrs(&self, xcrs: &[Register]) -> Result<()>; fn get_xsave(&self) -> Result<Xsave>; fn set_xsave(&self, xsave: &Xsave) -> Result<()>; fn get_interrupt_state(&self) -> Result<Value>; fn set_interrupt_state(&self, data: Value) -> Result<()>; fn get_msrs(&self, msrs: &mut Vec<Register>) -> Result<()>; fn get_all_msrs(&self) -> Result<Vec<Register>>; fn set_msrs(&self, msrs: &[Register]) -> Result<()>; fn set_cpuid(&self, cpuid: &CpuId) -> Result<()>; fn get_hyperv_cpuid(&self) -> Result<CpuId>; fn set_guest_debug(
        &self,
        addrs: &[GuestAddress],
        enable_singlestep: bool
    ) -> Result<()>; fn handle_cpuid(&mut self, entry: &CpuIdEntry) -> Result<()>; fn get_tsc_offset(&self) -> Result<u64>; fn set_tsc_offset(&self, offset: u64) -> Result<()>; fn snapshot(&self) -> Result<VcpuSnapshot> { ... } fn restore(&mut self, snapshot: &VcpuSnapshot) -> Result<()> { ... }
}
Expand description

A wrapper around creating and using a VCPU on x86_64.

Required Methods§

Sets or clears the flag that requests the VCPU to exit when it becomes possible to inject interrupts into the guest.

Checks if we can inject an interrupt into the VCPU.

Injects interrupt vector irq into the VCPU.

Injects a non-maskable interrupt into the VCPU.

Gets the VCPU general purpose registers.

Sets the VCPU general purpose registers.

Gets the VCPU special registers.

Sets the VCPU special registers.

Gets the VCPU FPU registers.

Sets the VCPU FPU registers.

Gets the VCPU debug registers.

Sets the VCPU debug registers.

Gets the VCPU extended control registers.

Sets the VCPU extended control registers.

Gets the VCPU x87 FPU, MMX, XMM, YMM and MXCSR registers.

Sets the VCPU x87 FPU, MMX, XMM, YMM and MXCSR registers.

Gets interrupt state (hypervisor specific) for this VCPU that must be saved/restored for snapshotting.

Sets interrupt state (hypervisor specific) for this VCPU. Only used for snapshotting.

Gets the model-specific registers. msrs specifies the MSR indexes to be queried, and on success contains their indexes and values.

Gets the model-specific registers. Returns all the MSRs for the VCPU.

Sets the model-specific registers.

Sets up the data returned by the CPUID instruction.

Gets the system emulated hyper-v CPUID values.

Sets up debug registers and configure vcpu for handling guest debug events.

This function should be called after Vcpu::run returns VcpuExit::Cpuid, and entry should represent the result of emulating the CPUID instruction. The handle_cpuid function will then set the appropriate registers on the vcpu.

Get the guest->host TSC offset

Set the guest->host TSC offset

Provided Methods§

Snapshot vCPU state

Implementations§

Returns true if the trait object wraps an object of type __T.

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Implementors§