Index: /trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
===================================================================
--- /trunk/src/VBox/Devices/Bus/DevPciIch9.cpp	(revision 64699)
+++ /trunk/src/VBox/Devices/Bus/DevPciIch9.cpp	(revision 64700)
@@ -1690,5 +1690,5 @@
  * Initializes bridges registers used for routing.
  *
- * @returns nothing.
+ * @returns Max subordinate bus number.
  * @param   pPciRoot         Global device instance data used to generate unique bus numbers.
  * @param   pBus             The PCI bus to initialize.
@@ -1696,5 +1696,5 @@
  * @param   uBusSecondary    The secondary bus number, i.e. the bus number behind the bridge.
  */
-static void ich9pciBiosInitBridgeTopology(PDEVPCIROOT pPciRoot, PDEVPCIBUS pBus, unsigned uBusPrimary, unsigned uBusSecondary)
+static uint8_t ich9pciBiosInitBridgeTopology(PDEVPCIROOT pPciRoot, PDEVPCIBUS pBus, unsigned uBusPrimary, unsigned uBusSecondary)
 {
     PPDMPCIDEV pBridgeDev = &pBus->PciDev;
@@ -1707,5 +1707,5 @@
     }
 
-    uint32_t uMaxSubNum = 0;
+    uint8_t uMaxSubNum = 0;
     for (uint32_t iBridge = 0; iBridge < pBus->cBridges; iBridge++)
     {
@@ -1714,6 +1714,6 @@
                   ("Device is not a PCI bridge but on the list of PCI bridges\n"));
         PDEVPCIBUS pChildBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS);
-        ich9pciBiosInitBridgeTopology(pPciRoot, pChildBus, uBusSecondary, pChildBus->iBus);
-        uMaxSubNum = RT_MAX(uMaxSubNum, pChildBus->iBus);
+        uint8_t uMaxChildSubBus = ich9pciBiosInitBridgeTopology(pPciRoot, pChildBus, uBusSecondary, pChildBus->iBus);
+        uMaxSubNum = RT_MAX(uMaxSubNum, RT_MAX(uMaxChildSubBus, pChildBus->iBus));
     }
     PCIDevSetByte(pBridgeDev, VBOX_PCI_SUBORDINATE_BUS, uMaxSubNum);
@@ -1724,4 +1724,6 @@
           PDMPciDevGetByte(pBridgeDev, VBOX_PCI_SUBORDINATE_BUS)
           ));
+
+    return uMaxSubNum;
 }
 
