Skip to main content

ProcessorTopology

Struct 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_version(&self) -> GicVersion

Returns the GIC version and version-specific addresses.

Source

pub fn gic_distributor_base(&self) -> u64

Returns the GIC distributor base

Source

pub fn pmu_gsiv(&self) -> Option<u32>

Returns the PMU GSIV

Source

pub fn gic_msi(&self) -> GicMsiController

Returns the MSI controller configuration.

Source

pub fn virt_timer_ppi(&self) -> u32

Returns the virtual timer PPI (GIC INTID).

Source

pub fn gic_nr_irqs(&self) -> u32

Returns the total number of GIC interrupts to configure.

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 vps_per_socket(&self) -> u32

Returns the configured number of VPs per socket.

This is the logical socket size before power-of-two rounding. Use this for NUMA VP assignment and other logical topology queries.

Source

pub fn reserved_vps_per_socket(&self) -> u32

Returns the number of VPs per socket, rounded up to a power of 2.

This is the APIC-ID-space reservation per socket. 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.

This reports the topology the VM was configured with, which is only as accurate as that configuration. It is not recovered from the VP’s architectural identity, and callers should not treat it as a measurement of the underlying hardware.

Source

pub fn set_vnodes(&mut self, vnodes: &[u32])
where T::ArchVpInfo: AsMut<VpInfo>,

Sets the virtual NUMA node for each VP.

vnodes must have exactly vp_count() entries, where vnodes[i] is the vnode for VP index i.

§Panics

Panics if vnodes.len() != vp_count().

Trait Implementations§

Source§

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

Source§

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

Returns a duplicate 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>
where T: Inspect + ArchTopology, T::ArchVpInfo: Inspect,

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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.
§

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