The PXB implementation doesn't allow firmware (SeaBIOS or OVMF) to boot
off devices behind the PXB. This happens because the
sysbus_get_fw_dev_path() function in "hw/core/sysbus.c" doesn't have
enough information to format a unique identifier for the PXB in question,
and consequently the OpenFirmware device path passed down to the guest
firmware in the "bootorder" fw_cfg file is unusable for identifying the
boot device.
For example, the command line fragment
-device pxb,id=bridge1,bus_nr=4 \
\
-netdev user,id=netdev0 \
-device e1000,netdev=netdev0,bus=bridge1,addr=2,bootindex=0
results in the following "bootorder" entry:
/pci/address@hidden/address@hidden/address@hidden
The initial "pci" node is formatted by sysbus_get_fw_dev_path(), and the
resultant OpenFirmware device path is independent of bus_nr=4 -- and
therefore it is useless for identifying the device.
In this patch we insert a dummy bus between the main sysbus and the
TYPE_PXB_HOST device. Formatting child addresses is a bus class level
responsibility, which is exactly what we'll use here.
After the patch, the same command line fragment results in the following
OpenFirmware device path in the "bootorder" fw_cfg file:
/extra-pci-roots/address@hidden/address@hidden/address@hidden/address@hidden
The original, initial "/pci" fragment has been replaced with
"/extra-pci-roots/address@hidden", which (a) looks better, (b) provides all
the
necessary information. sysbus_get_fw_dev_path() formats the first node
("extra-pci-roots") as always, and the new function
extra_pci_roots_bus_get_fw_dev_path() formats the second one
("address@hidden").
Here's the comparison ("diff -u -b -U28") between the "info qtree"
outputs, before and after (the hpet device is the first common line):