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>
impl ProcessorTopology<Aarch64Topology>
Sourcepub fn gic_version(&self) -> GicVersion
pub fn gic_version(&self) -> GicVersion
Returns the GIC version and version-specific addresses.
Sourcepub fn gic_distributor_base(&self) -> u64
pub fn gic_distributor_base(&self) -> u64
Returns the GIC distributor base
Sourcepub fn gic_msi(&self) -> GicMsiController
pub fn gic_msi(&self) -> GicMsiController
Returns the MSI controller configuration.
Sourcepub fn virt_timer_ppi(&self) -> u32
pub fn virt_timer_ppi(&self) -> u32
Returns the virtual timer PPI (GIC INTID).
Sourcepub fn gic_nr_irqs(&self) -> u32
pub fn gic_nr_irqs(&self) -> u32
Returns the total number of GIC interrupts to configure.
Source§impl<T: ArchTopology + Inspect> ProcessorTopology<T>
impl<T: ArchTopology + Inspect> ProcessorTopology<T>
Sourcepub fn vp(&self, vp_index: VpIndex) -> VpInfo
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.
Sourcepub fn vp_arch(&self, vp_index: VpIndex) -> T::ArchVpInfo
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.
Sourcepub fn vps(&self) -> impl '_ + ExactSizeIterator<Item = VpInfo> + Clone
pub fn vps(&self) -> impl '_ + ExactSizeIterator<Item = VpInfo> + Clone
Returns an iterator over all VPs.
Sourcepub fn vps_arch(
&self,
) -> impl '_ + ExactSizeIterator<Item = T::ArchVpInfo> + Clone
pub fn vps_arch( &self, ) -> impl '_ + ExactSizeIterator<Item = T::ArchVpInfo> + Clone
Returns an iterator over all VPs, including architecture-specific information.
Sourcepub fn smt_enabled(&self) -> bool
pub fn smt_enabled(&self) -> bool
Returns whether SMT (hyperthreading) is enabled.
Sourcepub fn vps_per_socket(&self) -> u32
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.
Sourcepub fn reserved_vps_per_socket(&self) -> u32
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.
Sourcepub fn vp_topology(&self, vp_index: VpIndex) -> VpTopologyInfo
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.
Sourcepub fn set_vnodes(&mut self, vnodes: &[u32])
pub fn set_vnodes(&mut self, vnodes: &[u32])
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,
impl<T: Clone + ArchTopology> Clone for ProcessorTopology<T>where
T::ArchVpInfo: Clone,
Source§fn clone(&self) -> ProcessorTopology<T>
fn clone(&self) -> ProcessorTopology<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more