| 1 | PCI devices on s390x |
| 2 | ==================== |
| 3 | |
| 4 | PCI devices on s390x work differently than on other architectures and need to |
| 5 | be configured in a slightly different way. |
| 6 | |
| 7 | Every PCI device is linked with an additional ``zpci`` device. |
| 8 | While the ``zpci`` device will be autogenerated if not specified, it is |
| 9 | recommended to specify it explicitly so that you can pass s390-specific |
| 10 | PCI configuration. |
| 11 | |
| 12 | For example, in order to pass a PCI device ``0000:00:00.0`` through to the |
| 13 | guest, you would specify:: |
| 14 | |
| 15 | qemu-system-s390x ... \ |
| 16 | -device zpci,uid=1,fid=0,target=hostdev0,id=zpci1 \ |
| 17 | -device vfio-pci,host=0000:00:00.0,id=hostdev0 |
| 18 | |
| 19 | Here, the zpci device is joined with the PCI device via the ``target`` property. |
| 20 | |
| 21 | Note that we don't set bus, slot or function here for the guest as is common in |
| 22 | other PCI implementations. Topology information is not available on s390x, and |
| 23 | the guest will not see any of the bus, slot or function information specified |
| 24 | on the command line. |
| 25 | |
| 26 | Instead, ``uid`` and ``fid`` determine how the device is presented to the guest |
| 27 | operating system. |
| 28 | |
| 29 | In case of Linux, ``uid`` will be used in the ``domain`` part of the PCI |
| 30 | identifier, and ``fid`` identifies the physical slot, i.e.:: |
| 31 | |
| 32 | qemu-system-s390x ... \ |
| 33 | -device zpci,uid=7,fid=8,target=hostdev0,id=zpci1 \ |
| 34 | ... |
| 35 | |
| 36 | will be presented in the guest as:: |
| 37 | |
| 38 | # lspci -v |
| 39 | 0007:00:00.0 ... |
| 40 | Physical Slot: 00000008 |
| 41 | ... |