pub struct CpuIdContext {
vcpu_id: usize,
cpu_count: usize,
x2apic: bool,
tsc_deadline_timer: bool,
apic_frequency: u32,
tsc_frequency: Option<u64>,
cpu_config: CpuConfigX86_64,
cpuid_count: unsafe fn(u32, u32) -> CpuidResult,
cpuid: unsafe fn(u32) -> CpuidResult,
}Expand description
All of the context required to emulate the CPUID instruction.
Fields§
§vcpu_id: usizeId of the Vcpu associated with this context.
cpu_count: usizeThe total number of vcpus on this VM.
x2apic: boolWhether or not the IrqChip’s APICs support X2APIC.
tsc_deadline_timer: boolWhether or not the IrqChip’s APICs support a TSC deadline timer.
apic_frequency: u32The frequency at which the IrqChip’s APICs run.
tsc_frequency: Option<u64>The TSC frequency in Hz, if it could be determined.
cpu_config: CpuConfigX86_64CPU feature configurations.
cpuid_count: unsafe fn(u32, u32) -> CpuidResult__cpuid_count or a fake function for test.
cpuid: unsafe fn(u32) -> CpuidResult__cpuid or a fake function for test.
Implementations§
Source§impl CpuIdContext
impl CpuIdContext
pub fn new( vcpu_id: usize, cpu_count: usize, irq_chip: Option<&dyn IrqChipX86_64>, cpu_config: CpuConfigX86_64, calibrated_tsc_leaf_required: bool, cpuid_count: unsafe fn(u32, u32) -> CpuidResult, cpuid: unsafe fn(u32) -> CpuidResult, ) -> CpuIdContext
Trait Implementations§
Source§impl Clone for CpuIdContext
impl Clone for CpuIdContext
Source§fn clone(&self) -> CpuIdContext
fn clone(&self) -> CpuIdContext
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CpuIdContext
impl Debug for CpuIdContext
Source§impl PartialEq for CpuIdContext
impl PartialEq for CpuIdContext
impl Eq for CpuIdContext
impl StructuralPartialEq for CpuIdContext
Auto Trait Implementations§
impl Freeze for CpuIdContext
impl RefUnwindSafe for CpuIdContext
impl Send for CpuIdContext
impl Sync for CpuIdContext
impl Unpin for CpuIdContext
impl UnwindSafe for CpuIdContext
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.