mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: acpi: Clarify device ID partitioning in IORT table
The IORT table's ID mapping uses a 256-ID offset per PCI segment to
ensure unique device IDs across all segments. This partitioning scheme
(output_base = 256 * segment_id) must match the device ID encoding used
in KVM MSI routing configuration [1].
This mapping assumes one bus per PCI segment, and supports up to 256 PCI
segments in the system.
[1] c9374d87ac
Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
@@ -582,7 +582,12 @@ fn create_iort_table(pci_segments: &[PciSegment]) -> Sdt {
|
||||
// 1 (bus) x 32 (devices) x 8 (functions) = 256
|
||||
// Note: Currently only 1 bus is supported in a segment.
|
||||
iort.write(mapping_offset + 4, (255_u32).to_le());
|
||||
// The lowest value in the output range
|
||||
// Output base maps to ITS device IDs which must match the
|
||||
// device ID encoding used in KVM MSI routing setup, which
|
||||
// shares the same limitation - only 1 bus per segment and
|
||||
// up to 256 segments.
|
||||
// See: https://github.com/cloud-hypervisor/cloud-hypervisor/commit/c9374d87ac453d49185aa7b734df089444166484
|
||||
assert!(segment.id < 256, "Up to 256 PCI segments are supported.");
|
||||
iort.write(mapping_offset + 8, ((256 * segment.id) as u32).to_le());
|
||||
// id_mapping_array_output_reference should be
|
||||
// the ITS group node (the first node) if no SMMU
|
||||
|
||||
Reference in New Issue
Block a user