Skip to content

Commit

Permalink
hw/arm/virt: Write extra pci roots into fw_cfg
Browse files Browse the repository at this point in the history
Add bus property to virt machine for primary PCI root bus and use it to add
extra pci roots behind it.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Signed-off-by: Yubo Miao <miaoyubo@huawei.com>
Message-Id: <20201119014841.7298-4-cenjiahui@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
poiiiicen authored and mstsirkin committed Dec 8, 2020
1 parent 0abd388 commit 09fad16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hw/arm/virt.c
Expand Up @@ -1289,7 +1289,8 @@ static void create_pcie(VirtMachineState *vms)
}

pci = PCI_HOST_BRIDGE(dev);
if (pci->bus) {
vms->bus = pci->bus;
if (vms->bus) {
for (i = 0; i < nb_nics; i++) {
NICInfo *nd = &nd_table[i];

Expand Down Expand Up @@ -1346,7 +1347,7 @@ static void create_pcie(VirtMachineState *vms)

switch (vms->iommu) {
case VIRT_IOMMU_SMMUV3:
create_smmu(vms, pci->bus);
create_smmu(vms, vms->bus);
qemu_fdt_setprop_cells(vms->fdt, nodename, "iommu-map",
0x0, vms->iommu_phandle, 0x0, 0x10000);
break;
Expand Down Expand Up @@ -1481,6 +1482,8 @@ void virt_machine_done(Notifier *notifier, void *data)
exit(1);
}

fw_cfg_add_extra_pci_roots(vms->bus, vms->fw_cfg);

virt_acpi_setup(vms);
virt_build_smbios(vms);
}
Expand Down
1 change: 1 addition & 0 deletions include/hw/arm/virt.h
Expand Up @@ -163,6 +163,7 @@ struct VirtMachineState {
DeviceState *gic;
DeviceState *acpi_dev;
Notifier powerdown_notifier;
PCIBus *bus;
};

#define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM)
Expand Down

0 comments on commit 09fad16

Please sign in to comment.