]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number
authorWei Yang <richardw.yang@linux.intel.com>
Fri, 15 Mar 2019 11:12:29 +0000 (11:12 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Mar 2019 11:12:29 +0000 (11:12 +0000)
This is more proper to use PCIE_MMCFG_BUS to retrieve end_bus_number.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20190312074953.16671-1-richardw.yang@linux.intel.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt-acpi-build.c

index aa02d8d74ec5f3887f858ed1ae555ca9af05bd6d..bf9c0bc2f49fb0fa55a5ca6c94108521b8505709 100644 (file)
@@ -560,8 +560,8 @@ build_mcfg(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
     /* Only a single allocation so no need to play with segments */
     mcfg->allocation[0].pci_segment = cpu_to_le16(0);
     mcfg->allocation[0].start_bus_number = 0;
-    mcfg->allocation[0].end_bus_number = (memmap[ecam_id].size
-                                          / PCIE_MMCFG_SIZE_MIN) - 1;
+    mcfg->allocation[0].end_bus_number =
+        PCIE_MMCFG_BUS(memmap[ecam_id].size - 1);
 
     build_header(linker, table_data, (void *)(table_data->data + mcfg_start),
                  "MCFG", table_data->len - mcfg_start, 1, NULL, NULL);