pub struct AcpiTablesBuilder<'a, T: AcpiTopology> {
pub processor_topology: &'a ProcessorTopology<T>,
pub mem_layout: &'a MemoryLayout,
pub cache_topology: Option<&'a CacheTopology>,
pub pcie_host_bridges: &'a Vec<PcieHostBridge>,
pub slit_info: Option<&'a SlitInfo>,
pub generic_initiators: &'a [GenericInitiator],
pub arch: AcpiArchConfig,
}Expand description
Builder to construct a set of BuiltAcpiTables
Fields§
§processor_topology: &'a ProcessorTopology<T>The processor topology.
It is assumed that the MADT processor UID should start at 1 and enumerate each of these APIC IDs in turn.
mem_layout: &'a MemoryLayoutThe memory layout of the VM.
cache_topology: Option<&'a CacheTopology>The cache topology of the VM.
If and only if this is set, then the PPTT table will be generated.
pcie_host_bridges: &'a Vec<PcieHostBridge>The PCIe topology.
If and only if this has root complexes, then an MCFG will be generated.
slit_info: Option<&'a SlitInfo>NUMA distance information for SLIT generation.
If set, a SLIT table will be generated.
generic_initiators: &'a [GenericInitiator]PCI generic initiators to expose in the SRAT, associating passthrough devices with (typically CPU-less) NUMA nodes.
arch: AcpiArchConfigArchitecture-specific ACPI configuration.
Implementations§
Source§impl<T: AcpiTopology> AcpiTablesBuilder<'_, T>
impl<T: AcpiTopology> AcpiTablesBuilder<'_, T>
Sourcepub fn build_acpi_tables<F>(
&self,
gpa: u64,
add_devices_to_dsdt: F,
) -> BuiltAcpiTableswhere
F: FnOnce(&mut Dsdt),
pub fn build_acpi_tables<F>(
&self,
gpa: u64,
add_devices_to_dsdt: F,
) -> BuiltAcpiTableswhere
F: FnOnce(&mut Dsdt),
Build ACPI tables based on the supplied closure that adds devices to the DSDT.
The RSDP is assumed to take one whole page.
Returns tables that should be loaded at the supplied gpa.
Sourcepub fn build_madt(&self) -> Vec<u8> ⓘ
pub fn build_madt(&self) -> Vec<u8> ⓘ
Helper method to construct an MADT without constructing the rest of the ACPI tables.
Sourcepub fn build_srat(&self) -> Vec<u8> ⓘ
pub fn build_srat(&self) -> Vec<u8> ⓘ
Helper method to construct an SRAT without constructing the rest of the ACPI tables.
Sourcepub fn build_slit(&self) -> Option<Vec<u8>>
pub fn build_slit(&self) -> Option<Vec<u8>>
Helper method to construct a SLIT without constructing the rest of
the ACPI tables. Returns None if no SLIT info is configured.
Sourcepub fn build_mcfg(&self) -> Vec<u8> ⓘ
pub fn build_mcfg(&self) -> Vec<u8> ⓘ
Helper method to construct a MCFG without constructing the rest of the ACPI tables.
Sourcepub fn build_iort(&self) -> Option<Vec<u8>>
pub fn build_iort(&self) -> Option<Vec<u8>>
Helper method to construct an IORT without constructing the rest of the
ACPI tables. Returns None if IORT is not needed for this configuration.
Sourcepub fn build_ivrs(&self) -> Option<Vec<u8>>
pub fn build_ivrs(&self) -> Option<Vec<u8>>
Helper method to construct an IVRS without constructing the rest of the
ACPI tables. Returns None if AMD IOMMU is not configured.
Sourcepub fn build_dmar(&self) -> Option<Vec<u8>>
pub fn build_dmar(&self) -> Option<Vec<u8>>
Helper method to construct a DMAR without constructing the rest of the
ACPI tables. Returns None if Intel VT-d is not configured.
Sourcepub fn build_pptt(&self) -> Vec<u8> ⓘ
pub fn build_pptt(&self) -> Vec<u8> ⓘ
Helper method to construct a PPTT without constructing the rest of the ACPI tables.
§Panics
Panics if self.cache_topology is not set.