On physical hardware especially server platforms, there are multiple
root pci buses and they can exhaust all the pci bus numbers. So when
scanning the pci bus, we need to allow the bus number up to 255. This
only applies to CSM on physical hardware, not the case of CSM on QEMU.

Signed-off-by: Bin Gao <gao...@amazon.com>
---
 src/hw/pcidevice.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/hw/pcidevice.c b/src/hw/pcidevice.c
index 8853cf7..b36183f 100644
--- a/src/hw/pcidevice.c
+++ b/src/hw/pcidevice.c
@@ -26,6 +26,13 @@ pci_probe_devices(void)
     struct hlist_node **pprev = &PCIDevices.first;
     int extraroots = romfile_loadint("etc/extra-pci-roots", 0);
     int bus = -1, lastbus = 0, rootbuses = 0, count=0;
+
+    // On physical hardware especially server platforms, there exists
+    // multiple pci roots, so the pci bus number could run up to the
+    // top value, i.e. 0xff
+    if (CONFIG_CSM && !CONFIG_QEMU_HARDWARE)
+        extraroots = 0xff;
+
     while (bus < 0xff && (bus < MaxPCIBus || rootbuses < extraroots)) {
         bus++;
         int bdf;
-- 
2.17.1
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-le...@seabios.org

Reply via email to