On Mon, Sep 06, 2021 at 02:58:55PM +0200, Eric Auger wrote: > Hi Jean, > > On 9/3/21 4:32 PM, Jean-Philippe Brucker wrote: > > Add a function that generates a Virtual I/O Translation table (VIOT), > > describing the topology of paravirtual IOMMUs. The table is created when > > instantiating a virtio-iommu device. It contains a virtio-iommu node and > > PCI Range nodes for endpoints managed by the IOMMU. By default, a single > > node describes all PCI devices. When passing the "default_bus_bypass_iommu" > > machine option and "bypass_iommu" PXB option, only buses that do not > > bypass the IOMMU are described by PCI Range nodes. > > You may consider to add a test for the new VIOT table (However this may > be added afterwards). See tests/qtest/bios-tables-test.c for the process > and examples.
Sure, it adds 5 patches to the series > > +/* > > + * Generate a VIOT table with one PCI-based virtio-iommu that manages PCI > > + * endpoints. > Add a link to the doc + Table refs? > > https://jpbrucker.net/virtio-iommu/viot/viot-v9.pdf No, this document is only temporary until the next ACPI release. Although the titles and text should be the same, I don't know the refs in the final document but they will be different > > > + */ > > +void build_viot(GArray *table_data, BIOSLinker *linker, > > + uint16_t virtio_iommu_bdf, const char *oem_id, > > + const char *oem_table_id) > > +{ > > + /* virtio-iommu node follows the header */ > > + int viommu_off = sizeof(AcpiViot); > > + int viot_start = table_data->len; > > + struct viot_pci_ranges pci_ranges = { > > + .output_node = viommu_off, > > + .blob = g_array_new(false, true, 1), > > + }; > > + > > + /* Build the list of PCI ranges that this viommu manages */ > > + object_child_foreach_recursive(object_get_root(), viot_host_bridges, > > + &pci_ranges); > > + > > + /* VIOT header */ > > + acpi_data_push(table_data, sizeof(AcpiTableHeader)); > Depending on the order of landing, this may be replaced by Igor's > > acpi_init_table() and associated with acpi_table_composed(). Ok I'll prepare that as a fixup, and send it or squash it after the ACPI series lands > <<<<<<< HEAD > acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) > acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) > acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: > files('acpi-pci-hotplug-stub.c')) > ======= > acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('piix4.c', 'pcihp.c')) > acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) > >>>>>>> hw/acpi: Add VIOT table Indeed, fixed Thanks, Jean