Struct vm_topology::processor::ProcessorTopology

source ·
pub struct ProcessorTopology<T: ArchTopology = TargetTopology> { /* private fields */ }
Expand description

A description of the VM’s processor topology.

Currently this just tracks the APIC IDs for the processors.

Build one with TopologyBuilder.

Implementations§

source§

impl ProcessorTopology<Aarch64Topology>

source

pub fn gic_distributor_base(&self) -> u64

Returns the GIC distributor base

source

pub fn gic_redistributors_base(&self) -> u64

Returns the GIC redistributors base

source§

impl ProcessorTopology<X86Topology>

source

pub fn max_apic_id(&self) -> u32

Returns the largest APIC ID in use.

source

pub fn apic_mode(&self) -> ApicMode

Returns the APIC mode configured for the processors.

source§

impl<T: ArchTopology + Inspect> ProcessorTopology<T>

source

pub fn vp_count(&self) -> u32

Returns the number of VPs.

source

pub fn vp(&self, vp_index: VpIndex) -> VpInfo

Returns information for the given processor by VP index.

Panics if the VP index is out of range.

source

pub fn vp_arch(&self, vp_index: VpIndex) -> T::ArchVpInfo

Returns information for the given processor by VP index, including architecture-specific information.

Panics if the VP index is out of range.

source

pub fn vps(&self) -> impl '_ + ExactSizeIterator<Item = VpInfo> + Clone

Returns an iterator over all VPs.

source

pub fn vps_arch( &self, ) -> impl '_ + ExactSizeIterator<Item = T::ArchVpInfo> + Clone

Returns an iterator over all VPs, including architecture-specific information.

source

pub fn smt_enabled(&self) -> bool

Returns whether SMT (hyperthreading) is enabled.

source

pub fn reserved_vps_per_socket(&self) -> u32

Returns the number of VPs per socket.

This will always be a power of 2. The number of VPs actually populated in a socket may be smaller than this.

source

pub fn vp_topology(&self, vp_index: VpIndex) -> VpTopologyInfo

Computes the processor topology information for a VP.

Trait Implementations§

source§

impl<T: Clone + ArchTopology> Clone for ProcessorTopology<T>
where T::ArchVpInfo: Clone,

source§

fn clone(&self) -> ProcessorTopology<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + ArchTopology> Debug for ProcessorTopology<T>
where T::ArchVpInfo: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Inspect for ProcessorTopology<T>

source§

fn inspect(&self, req: Request<'_>)

Inspects the object.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T, U> Upcast<U> for T
where U: Downcast<T>,