pci_expander_bridge.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. PCI EXPANDER BRIDGE (PXB)
  2. =========================
  3. Description
  4. ===========
  5. PXB is a "light-weight" host bridge in the same PCI domain
  6. as the main host bridge whose purpose is to enable
  7. the main host bridge to support multiple PCI root buses.
  8. It is implemented only for i440fx and can be placed only
  9. on bus 0 (pci.0).
  10. As opposed to PCI-2-PCI bridge's secondary bus, PXB's bus
  11. is a primary bus and can be associated with a NUMA node
  12. (different from the main host bridge) allowing the guest OS
  13. to recognize the proximity of a pass-through device to
  14. other resources as RAM and CPUs.
  15. Usage
  16. =====
  17. A detailed command line would be:
  18. [qemu-bin + storage options]
  19. -m 2G
  20. -object memory-backend-ram,size=1024M,policy=bind,host-nodes=0,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
  21. -object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
  22. -device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd -device e1000,bus=bridge1,addr=0x4,netdev=nd
  23. -device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8 -device e1000,bus=bridge2,addr=0x3
  24. -device pxb,id=bridge3,bus=pci.0,bus_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,bus=bridge3,addr=1
  25. Here you have:
  26. - 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
  27. - a pxb host bridge attached to NUMA 1 with an e1000 behind it
  28. - a pxb host bridge attached to NUMA 0 with an e1000 behind it
  29. - a pxb host bridge not attached to any NUMA with a hard drive behind it.
  30. Limitations
  31. ===========
  32. Please observe that we specified the bus "pci.0" for the second and third pxb.
  33. This is because when no bus is given, another pxb can be selected by QEMU as default bus,
  34. however, PXBs can be placed only under the root bus.
  35. Implementation
  36. ==============
  37. The PXB is composed by:
  38. - HostBridge (TYPE_PXB_HOST)
  39. The host bridge allows to register and query the PXB's PCI root bus in QEMU.
  40. - PXBDev(TYPE_PXB_DEVICE)
  41. It is a regular PCI Device that resides on the piix host-bridge bus and its bus uses the same PCI domain.
  42. However, the bus behind is exposed through ACPI as a primary PCI bus and starts a new PCI hierarchy.
  43. The interrupts from devices behind the PXB are routed through this device the same as if it were a
  44. PCI-2-PCI bridge. The _PRT follows the i440fx model.
  45. - PCIBridgeDev(TYPE_PCI_BRIDGE_DEV)
  46. Created automatically as part of init sequence.
  47. When adding a device to PXB it is attached to the bridge for two reasons:
  48. - Using the bridge will enable hotplug support
  49. - All the devices behind the bridge will use bridge's IO/MEM windows compacting
  50. the PCI address space.