xref: /qemu/docs/pcie.txt (revision f5cb6128)
1453ac883SMarcel ApfelbaumPCI EXPRESS GUIDELINES
2453ac883SMarcel Apfelbaum======================
3453ac883SMarcel Apfelbaum
4453ac883SMarcel Apfelbaum1. Introduction
5453ac883SMarcel Apfelbaum================
6c8945922SKashyap ChamarthyThe doc proposes best practices on how to use PCI Express (PCIe) / PCI
7c8945922SKashyap Chamarthydevices in PCI Express based machines and explains the reasoning behind
8c8945922SKashyap Chamarthythem.
9c8945922SKashyap Chamarthy
10c8945922SKashyap ChamarthyNote that the PCIe features are available only when using the 'q35'
11c8945922SKashyap Chamarthymachine type on x86 architecture and the 'virt' machine type on AArch64.
12c8945922SKashyap ChamarthyOther machine types do not use PCIe at this time.
13453ac883SMarcel Apfelbaum
14453ac883SMarcel ApfelbaumThe following presentations accompany this document:
15453ac883SMarcel Apfelbaum (1) Q35 overview.
1670b7fba9SStefan Hajnoczi     https://wiki.qemu.org/images/4/4e/Q35.pdf
17453ac883SMarcel Apfelbaum (2) A comparison between PCI and PCI Express technologies.
1870b7fba9SStefan Hajnoczi     https://wiki.qemu.org/images/f/f6/PCIvsPCIe.pdf
19453ac883SMarcel Apfelbaum
20453ac883SMarcel ApfelbaumNote: The usage examples are not intended to replace the full
21453ac883SMarcel Apfelbaumdocumentation, please use QEMU help to retrieve all options.
22453ac883SMarcel Apfelbaum
23453ac883SMarcel Apfelbaum2. Device placement strategy
24453ac883SMarcel Apfelbaum============================
25453ac883SMarcel ApfelbaumQEMU does not have a clear socket-device matching mechanism
26453ac883SMarcel Apfelbaumand allows any PCI/PCI Express device to be plugged into any
27453ac883SMarcel ApfelbaumPCI/PCI Express slot.
28453ac883SMarcel ApfelbaumPlugging a PCI device into a PCI Express slot might not always work and
29453ac883SMarcel Apfelbaumis weird anyway since it cannot be done for "bare metal".
30453ac883SMarcel ApfelbaumPlugging a PCI Express device into a PCI slot will hide the Extended
31453ac883SMarcel ApfelbaumConfiguration Space thus is also not recommended.
32453ac883SMarcel Apfelbaum
33453ac883SMarcel ApfelbaumThe recommendation is to separate the PCI Express and PCI hierarchies.
34453ac883SMarcel ApfelbaumPCI Express devices should be plugged only into PCI Express Root Ports and
35453ac883SMarcel ApfelbaumPCI Express Downstream ports.
36453ac883SMarcel Apfelbaum
37453ac883SMarcel Apfelbaum2.1 Root Bus (pcie.0)
38453ac883SMarcel Apfelbaum=====================
39453ac883SMarcel ApfelbaumPlace only the following kinds of devices directly on the Root Complex:
40453ac883SMarcel Apfelbaum    (1) PCI Devices (e.g. network card, graphics card, IDE controller),
41453ac883SMarcel Apfelbaum        not controllers. Place only legacy PCI devices on
42453ac883SMarcel Apfelbaum        the Root Complex. These will be considered Integrated Endpoints.
43453ac883SMarcel Apfelbaum        Note: Integrated Endpoints are not hot-pluggable.
44453ac883SMarcel Apfelbaum
45453ac883SMarcel Apfelbaum        Although the PCI Express spec does not forbid PCI Express devices as
46453ac883SMarcel Apfelbaum        Integrated Endpoints, existing hardware mostly integrates legacy PCI
47453ac883SMarcel Apfelbaum        devices with the Root Complex. Guest OSes are suspected to behave
48453ac883SMarcel Apfelbaum        strangely when PCI Express devices are integrated
49453ac883SMarcel Apfelbaum        with the Root Complex.
50453ac883SMarcel Apfelbaum
51f5cb6128SMarcel Apfelbaum    (2) PCI Express Root Ports (pcie-root-port), for starting exclusively
52f5cb6128SMarcel Apfelbaum        PCI Express hierarchies.
53453ac883SMarcel Apfelbaum
54c1800a16SAleksandr Bezzubikov    (3) PCI Express to PCI Bridge (pcie-pci-bridge), for starting legacy PCI
55453ac883SMarcel Apfelbaum        hierarchies.
56453ac883SMarcel Apfelbaum
57453ac883SMarcel Apfelbaum    (4) Extra Root Complexes (pxb-pcie), if multiple PCI Express Root Buses
58453ac883SMarcel Apfelbaum        are needed.
59453ac883SMarcel Apfelbaum
60453ac883SMarcel Apfelbaum   pcie.0 bus
61453ac883SMarcel Apfelbaum   ----------------------------------------------------------------------------
62453ac883SMarcel Apfelbaum        |                |                    |                  |
63c1800a16SAleksandr Bezzubikov   -----------   ------------------   -------------------   --------------
64c1800a16SAleksandr Bezzubikov   | PCI Dev |   | PCIe Root Port |   | PCIe-PCI Bridge |   |  pxb-pcie  |
65c1800a16SAleksandr Bezzubikov   -----------   ------------------   -------------------   --------------
66453ac883SMarcel Apfelbaum
67453ac883SMarcel Apfelbaum2.1.1 To plug a device into pcie.0 as a Root Complex Integrated Endpoint use:
68453ac883SMarcel Apfelbaum          -device <dev>[,bus=pcie.0]
69453ac883SMarcel Apfelbaum2.1.2 To expose a new PCI Express Root Bus use:
70453ac883SMarcel Apfelbaum          -device pxb-pcie,id=pcie.1,bus_nr=x[,numa_node=y][,addr=z]
71c1800a16SAleksandr Bezzubikov      PCI Express Root Ports and PCI Express to PCI bridges can be
72c1800a16SAleksandr Bezzubikov      connected to the pcie.1 bus:
73f5cb6128SMarcel Apfelbaum          -device pcie-root-port,id=root_port1[,bus=pcie.1][,chassis=x][,slot=y][,addr=z] \
74c1800a16SAleksandr Bezzubikov          -device pcie-pci-bridge,id=pcie_pci_bridge1,bus=pcie.1
75453ac883SMarcel Apfelbaum
76453ac883SMarcel Apfelbaum
77453ac883SMarcel Apfelbaum2.2 PCI Express only hierarchy
78453ac883SMarcel Apfelbaum==============================
79453ac883SMarcel ApfelbaumAlways use PCI Express Root Ports to start PCI Express hierarchies.
80453ac883SMarcel Apfelbaum
81453ac883SMarcel ApfelbaumA PCI Express Root bus supports up to 32 devices. Since each
82453ac883SMarcel ApfelbaumPCI Express Root Port is a function and a multi-function
83453ac883SMarcel Apfelbaumdevice may support up to 8 functions, the maximum possible
84453ac883SMarcel Apfelbaumnumber of PCI Express Root Ports per PCI Express Root Bus is 256.
85453ac883SMarcel Apfelbaum
86453ac883SMarcel ApfelbaumPrefer grouping PCI Express Root Ports into multi-function devices
87453ac883SMarcel Apfelbaumto keep a simple flat hierarchy that is enough for most scenarios.
88453ac883SMarcel ApfelbaumOnly use PCI Express Switches (x3130-upstream, xio3130-downstream)
89453ac883SMarcel Apfelbaumif there is no more room for PCI Express Root Ports.
90453ac883SMarcel ApfelbaumPlease see section 4. for further justifications.
91453ac883SMarcel Apfelbaum
92453ac883SMarcel ApfelbaumPlug only PCI Express devices into PCI Express Ports.
93453ac883SMarcel Apfelbaum
94453ac883SMarcel Apfelbaum
95453ac883SMarcel Apfelbaum   pcie.0 bus
96453ac883SMarcel Apfelbaum   ----------------------------------------------------------------------------------
97453ac883SMarcel Apfelbaum        |                 |                                    |
98453ac883SMarcel Apfelbaum   -------------    -------------                        -------------
99453ac883SMarcel Apfelbaum   | Root Port |    | Root Port |                        | Root Port |
100453ac883SMarcel Apfelbaum   ------------     -------------                        -------------
101453ac883SMarcel Apfelbaum         |                            -------------------------|------------------------
102453ac883SMarcel Apfelbaum    ------------                      |                 -----------------              |
103453ac883SMarcel Apfelbaum    | PCIe Dev |                      |    PCI Express  | Upstream Port |              |
104453ac883SMarcel Apfelbaum    ------------                      |      Switch     -----------------              |
105453ac883SMarcel Apfelbaum                                      |                  |            |                |
106453ac883SMarcel Apfelbaum                                      |    -------------------    -------------------  |
107453ac883SMarcel Apfelbaum                                      |    | Downstream Port |    | Downstream Port |  |
108453ac883SMarcel Apfelbaum                                      |    -------------------    -------------------  |
109453ac883SMarcel Apfelbaum                                      -------------|-----------------------|------------
110453ac883SMarcel Apfelbaum                                             ------------
111453ac883SMarcel Apfelbaum                                             | PCIe Dev |
112453ac883SMarcel Apfelbaum                                             ------------
113453ac883SMarcel Apfelbaum
114453ac883SMarcel Apfelbaum2.2.1 Plugging a PCI Express device into a PCI Express Root Port:
115f5cb6128SMarcel Apfelbaum          -device pcie-root-port,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z]  \
116453ac883SMarcel Apfelbaum          -device <dev>,bus=root_port1
117453ac883SMarcel Apfelbaum2.2.2 Using multi-function PCI Express Root Ports:
118f5cb6128SMarcel Apfelbaum      -device pcie-root-port,id=root_port1,multifunction=on,chassis=x,addr=z.0[,slot=y][,bus=pcie.0] \
119f5cb6128SMarcel Apfelbaum      -device pcie-root-port,id=root_port2,chassis=x1,addr=z.1[,slot=y1][,bus=pcie.0] \
120f5cb6128SMarcel Apfelbaum      -device pcie-root-port,id=root_port3,chassis=x2,addr=z.2[,slot=y2][,bus=pcie.0] \
1212e41dfe1SCao jin2.2.3 Plugging a PCI Express device into a Switch:
122f5cb6128SMarcel Apfelbaum      -device pcie-root-port,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z]  \
123453ac883SMarcel Apfelbaum      -device x3130-upstream,id=upstream_port1,bus=root_port1[,addr=x]          \
124453ac883SMarcel Apfelbaum      -device xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=x1,slot=y1[,addr=z1]] \
125453ac883SMarcel Apfelbaum      -device <dev>,bus=downstream_port1
126453ac883SMarcel Apfelbaum
127453ac883SMarcel ApfelbaumNotes:
1282e41dfe1SCao jin  - (slot, chassis) pair is mandatory and must be unique for each
1292e41dfe1SCao jin    PCI Express Root Port. slot defaults to 0 when not specified.
130453ac883SMarcel Apfelbaum  - 'addr' parameter can be 0 for all the examples above.
131453ac883SMarcel Apfelbaum
132453ac883SMarcel Apfelbaum
133453ac883SMarcel Apfelbaum2.3 PCI only hierarchy
134453ac883SMarcel Apfelbaum======================
135453ac883SMarcel ApfelbaumLegacy PCI devices can be plugged into pcie.0 as Integrated Endpoints,
136453ac883SMarcel Apfelbaumbut, as mentioned in section 5, doing so means the legacy PCI
137453ac883SMarcel Apfelbaumdevice in question will be incapable of hot-unplugging.
138c1800a16SAleksandr BezzubikovBesides that use PCI Express to PCI Bridges (pcie-pci-bridge) in
139c1800a16SAleksandr Bezzubikovcombination with PCI-PCI Bridges (pci-bridge) to start PCI hierarchies.
140453ac883SMarcel Apfelbaum
141c1800a16SAleksandr BezzubikovPrefer flat hierarchies. For most scenarios a single PCI Express to PCI Bridge
142453ac883SMarcel Apfelbaum(having 32 slots) and several PCI-PCI Bridges attached to it
143453ac883SMarcel Apfelbaum(each supporting also 32 slots) will support hundreds of legacy devices.
144c1800a16SAleksandr BezzubikovThe recommendation is to populate one PCI-PCI Bridge under the
145c1800a16SAleksandr BezzubikovPCI Express to PCI Bridge until is full and then plug a new PCI-PCI Bridge...
146453ac883SMarcel Apfelbaum
147453ac883SMarcel Apfelbaum   pcie.0 bus
148453ac883SMarcel Apfelbaum   ----------------------------------------------
149453ac883SMarcel Apfelbaum        |                            |
150c1800a16SAleksandr Bezzubikov   -----------               -------------------
151c1800a16SAleksandr Bezzubikov   | PCI Dev |               | PCIe-PCI Bridge |
152c1800a16SAleksandr Bezzubikov   -----------               -------------------
153453ac883SMarcel Apfelbaum                               |            |
154453ac883SMarcel Apfelbaum                  ------------------    ------------------
155c1800a16SAleksandr Bezzubikov                  | PCI-PCI Bridge |    | PCI-PCI Bridge |
156453ac883SMarcel Apfelbaum                  ------------------    ------------------
157453ac883SMarcel Apfelbaum                                         |           |
158453ac883SMarcel Apfelbaum                                  -----------     -----------
159453ac883SMarcel Apfelbaum                                  | PCI Dev |     | PCI Dev |
160453ac883SMarcel Apfelbaum                                  -----------     -----------
161453ac883SMarcel Apfelbaum
162453ac883SMarcel Apfelbaum2.3.1 To plug a PCI device into pcie.0 as an Integrated Endpoint use:
163453ac883SMarcel Apfelbaum      -device <dev>[,bus=pcie.0]
164453ac883SMarcel Apfelbaum2.3.2 Plugging a PCI device into a PCI-PCI Bridge:
165c1800a16SAleksandr Bezzubikov      -device pcie-pci-bridge,id=pcie_pci_bridge1[,bus=pcie.0] \
166c1800a16SAleksandr Bezzubikov      -device pci-bridge,id=pci_bridge1,bus=pcie_pci_bridge1[,chassis_nr=x][,addr=y] \
167453ac883SMarcel Apfelbaum      -device <dev>,bus=pci_bridge1[,addr=x]
168453ac883SMarcel Apfelbaum      Note that 'addr' cannot be 0 unless shpc=off parameter is passed to
169c1800a16SAleksandr Bezzubikov      the PCI Bridge/PCI Express to PCI Bridge.
170453ac883SMarcel Apfelbaum
171453ac883SMarcel Apfelbaum3. IO space issues
172453ac883SMarcel Apfelbaum===================
173453ac883SMarcel ApfelbaumThe PCI Express Root Ports and PCI Express Downstream ports are seen by
174453ac883SMarcel ApfelbaumFirmware/Guest OS as PCI-PCI Bridges. As required by the PCI spec, each
175453ac883SMarcel Apfelbaumsuch Port should be reserved a 4K IO range for, even though only one
176453ac883SMarcel Apfelbaum(multifunction) device can be plugged into each Port. This results in
177453ac883SMarcel Apfelbaumpoor IO space utilization.
178453ac883SMarcel Apfelbaum
179453ac883SMarcel ApfelbaumThe firmware used by QEMU (SeaBIOS/OVMF) may try further optimizations
180453ac883SMarcel Apfelbaumby not allocating IO space for each PCI Express Root / PCI Express
181453ac883SMarcel ApfelbaumDownstream port if:
182453ac883SMarcel Apfelbaum    (1) the port is empty, or
183453ac883SMarcel Apfelbaum    (2) the device behind the port has no IO BARs.
184453ac883SMarcel Apfelbaum
185453ac883SMarcel ApfelbaumThe IO space is very limited, to 65536 byte-wide IO ports, and may even be
186453ac883SMarcel Apfelbaumfragmented by fixed IO ports owned by platform devices resulting in at most
187453ac883SMarcel Apfelbaum10 PCI Express Root Ports or PCI Express Downstream Ports per system
188453ac883SMarcel Apfelbaumif devices with IO BARs are used in the PCI Express hierarchy. Using the
189453ac883SMarcel Apfelbaumproposed device placing strategy solves this issue by using only
190453ac883SMarcel ApfelbaumPCI Express devices within PCI Express hierarchy.
191453ac883SMarcel Apfelbaum
192453ac883SMarcel ApfelbaumThe PCI Express spec requires that PCI Express devices work properly
193453ac883SMarcel Apfelbaumwithout using IO ports. The PCI hierarchy has no such limitations.
194453ac883SMarcel Apfelbaum
195453ac883SMarcel Apfelbaum
196453ac883SMarcel Apfelbaum4. Bus numbers issues
197453ac883SMarcel Apfelbaum======================
198453ac883SMarcel ApfelbaumEach PCI domain can have up to only 256 buses and the QEMU PCI Express
199453ac883SMarcel Apfelbaummachines do not support multiple PCI domains even if extra Root
200453ac883SMarcel ApfelbaumComplexes (pxb-pcie) are used.
201453ac883SMarcel Apfelbaum
202453ac883SMarcel ApfelbaumEach element of the PCI Express hierarchy (Root Complexes,
203453ac883SMarcel ApfelbaumPCI Express Root Ports, PCI Express Downstream/Upstream ports)
204453ac883SMarcel Apfelbaumuses one bus number. Since only one (multifunction) device
205453ac883SMarcel Apfelbaumcan be attached to a PCI Express Root Port or PCI Express Downstream
206453ac883SMarcel ApfelbaumPort it is advised to plan in advance for the expected number of
207453ac883SMarcel Apfelbaumdevices to prevent bus number starvation.
208453ac883SMarcel Apfelbaum
209453ac883SMarcel ApfelbaumAvoiding PCI Express Switches (and thereby striving for a 'flatter' PCI
210453ac883SMarcel ApfelbaumExpress hierarchy) enables the hierarchy to not spend bus numbers on
211453ac883SMarcel ApfelbaumUpstream Ports.
212453ac883SMarcel Apfelbaum
213453ac883SMarcel ApfelbaumThe bus_nr properties of the pxb-pcie devices partition the 0..255 bus
214453ac883SMarcel Apfelbaumnumber space. All bus numbers assigned to the buses recursively behind a
215453ac883SMarcel Apfelbaumgiven pxb-pcie device's root bus must fit between the bus_nr property of
216453ac883SMarcel Apfelbaumthat pxb-pcie device, and the lowest of the higher bus_nr properties
217453ac883SMarcel Apfelbaumthat the command line sets for other pxb-pcie devices.
218453ac883SMarcel Apfelbaum
219453ac883SMarcel Apfelbaum
220453ac883SMarcel Apfelbaum5. Hot-plug
221453ac883SMarcel Apfelbaum============
222453ac883SMarcel ApfelbaumThe PCI Express root buses (pcie.0 and the buses exposed by pxb-pcie devices)
223453ac883SMarcel Apfelbaumdo not support hot-plug, so any devices plugged into Root Complexes
224453ac883SMarcel Apfelbaumcannot be hot-plugged/hot-unplugged:
225453ac883SMarcel Apfelbaum    (1) PCI Express Integrated Endpoints
226453ac883SMarcel Apfelbaum    (2) PCI Express Root Ports
227c1800a16SAleksandr Bezzubikov    (3) PCI Express to PCI Bridges
228453ac883SMarcel Apfelbaum    (4) pxb-pcie
229453ac883SMarcel Apfelbaum
230453ac883SMarcel ApfelbaumBe aware that PCI Express Downstream Ports can't be hot-plugged into
231453ac883SMarcel Apfelbauman existing PCI Express Upstream Port.
232453ac883SMarcel Apfelbaum
233c1800a16SAleksandr BezzubikovPCI devices can be hot-plugged into PCI Express to PCI and PCI-PCI Bridges.
234c1800a16SAleksandr BezzubikovThe PCI hot-plug into PCI-PCI bridge is ACPI based, whereas hot-plug into
235c1800a16SAleksandr BezzubikovPCI Express to PCI bridges is SHPC-based. They both can work side by side with
236c1800a16SAleksandr Bezzubikovthe PCI Express native hot-plug.
237453ac883SMarcel Apfelbaum
238453ac883SMarcel ApfelbaumPCI Express devices can be natively hot-plugged/hot-unplugged into/from
239453ac883SMarcel ApfelbaumPCI Express Root Ports (and PCI Express Downstream Ports).
240453ac883SMarcel Apfelbaum
241453ac883SMarcel Apfelbaum5.1 Planning for hot-plug:
242453ac883SMarcel Apfelbaum    (1) PCI hierarchy
243453ac883SMarcel Apfelbaum        Leave enough PCI-PCI Bridge slots empty or add one
244c1800a16SAleksandr Bezzubikov        or more empty PCI-PCI Bridges to the PCI Express to PCI Bridge.
245453ac883SMarcel Apfelbaum
246453ac883SMarcel Apfelbaum        For each such PCI-PCI Bridge the Guest Firmware is expected to reserve
247453ac883SMarcel Apfelbaum        4K IO space and 2M MMIO range to be used for all devices behind it.
248c1800a16SAleksandr Bezzubikov        Appropriate PCI capability is designed, see pcie_pci_bridge.txt.
249453ac883SMarcel Apfelbaum
250453ac883SMarcel Apfelbaum        Because of the hard IO limit of around 10 PCI Bridges (~ 40K space)
251453ac883SMarcel Apfelbaum        per system don't use more than 9 PCI-PCI Bridges, leaving 4K for the
252453ac883SMarcel Apfelbaum        Integrated Endpoints. (The PCI Express Hierarchy needs no IO space).
253453ac883SMarcel Apfelbaum
254453ac883SMarcel Apfelbaum    (2) PCI Express hierarchy:
255453ac883SMarcel Apfelbaum        Leave enough PCI Express Root Ports empty. Use multifunction
256453ac883SMarcel Apfelbaum        PCI Express Root Ports (up to 8 ports per pcie.0 slot)
257453ac883SMarcel Apfelbaum        on the Root Complex(es), for keeping the
258453ac883SMarcel Apfelbaum        hierarchy as flat as possible, thereby saving PCI bus numbers.
259453ac883SMarcel Apfelbaum        Don't use PCI Express Switches if you don't have
260453ac883SMarcel Apfelbaum        to, each one of those uses an extra PCI bus (for its Upstream Port)
261453ac883SMarcel Apfelbaum        that could be put to better use with another Root Port or Downstream
262453ac883SMarcel Apfelbaum        Port, which may come handy for hot-plugging another device.
263453ac883SMarcel Apfelbaum
264453ac883SMarcel Apfelbaum
265453ac883SMarcel Apfelbaum5.3 Hot-plug example:
266453ac883SMarcel ApfelbaumUsing HMP: (add -monitor stdio to QEMU command line)
267453ac883SMarcel Apfelbaum  device_add <dev>,id=<id>,bus=<PCI Express Root Port Id/PCI Express Downstream Port Id/PCI-PCI Bridge Id/>
268453ac883SMarcel Apfelbaum
269453ac883SMarcel Apfelbaum
270453ac883SMarcel Apfelbaum6. Device assignment
271453ac883SMarcel Apfelbaum====================
272453ac883SMarcel ApfelbaumHost devices are mostly PCI Express and should be plugged only into
273453ac883SMarcel ApfelbaumPCI Express Root Ports or PCI Express Downstream Ports.
274453ac883SMarcel ApfelbaumPCI-PCI Bridge slots can be used for legacy PCI host devices.
275453ac883SMarcel Apfelbaum
276453ac883SMarcel Apfelbaum6.1 How to detect if a device is PCI Express:
277453ac883SMarcel Apfelbaum  > lspci -s 03:00.0 -v (as root)
278453ac883SMarcel Apfelbaum
279453ac883SMarcel Apfelbaum    03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)
280453ac883SMarcel Apfelbaum    Subsystem: Intel Corporation Dual Band Wireless-AC 7260
281453ac883SMarcel Apfelbaum    Flags: bus master, fast devsel, latency 0, IRQ 50
282453ac883SMarcel Apfelbaum    Memory at f0400000 (64-bit, non-prefetchable) [size=8K]
283453ac883SMarcel Apfelbaum    Capabilities: [c8] Power Management version 3
284453ac883SMarcel Apfelbaum    Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
285453ac883SMarcel Apfelbaum    Capabilities: [40] Express Endpoint, MSI 00
286453ac883SMarcel Apfelbaum    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
287453ac883SMarcel Apfelbaum    Capabilities: [100] Advanced Error Reporting
288453ac883SMarcel Apfelbaum    Capabilities: [140] Device Serial Number 7c-7a-91-ff-ff-90-db-20
289453ac883SMarcel Apfelbaum    Capabilities: [14c] Latency Tolerance Reporting
290453ac883SMarcel Apfelbaum    Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014
291453ac883SMarcel Apfelbaum
292453ac883SMarcel ApfelbaumIf you can see the "Express Endpoint" capability in the
293453ac883SMarcel Apfelbaumoutput, then the device is indeed PCI Express.
294453ac883SMarcel Apfelbaum
295453ac883SMarcel Apfelbaum
296453ac883SMarcel Apfelbaum7. Virtio devices
297453ac883SMarcel Apfelbaum=================
298453ac883SMarcel ApfelbaumVirtio devices plugged into the PCI hierarchy or as Integrated Endpoints
299453ac883SMarcel Apfelbaumwill remain PCI and have transitional behaviour as default.
300453ac883SMarcel ApfelbaumTransitional virtio devices work in both IO and MMIO modes depending on
301453ac883SMarcel Apfelbaumthe guest support. The Guest firmware will assign both IO and MMIO resources
302453ac883SMarcel Apfelbaumto transitional virtio devices.
303453ac883SMarcel Apfelbaum
304453ac883SMarcel ApfelbaumVirtio devices plugged into PCI Express ports are PCI Express devices and
305453ac883SMarcel Apfelbaumhave "1.0" behavior by default without IO support.
306453ac883SMarcel ApfelbaumIn both cases disable-legacy and disable-modern properties can be used
307453ac883SMarcel Apfelbaumto override the behaviour.
308453ac883SMarcel Apfelbaum
309453ac883SMarcel ApfelbaumNote that setting disable-legacy=off will enable legacy mode (enabling
310453ac883SMarcel Apfelbaumlegacy behavior) for PCI Express virtio devices causing them to
311453ac883SMarcel Apfelbaumrequire IO space, which, given the limited available IO space, may quickly
312453ac883SMarcel Apfelbaumlead to resource exhaustion, and is therefore strongly discouraged.
313453ac883SMarcel Apfelbaum
314453ac883SMarcel Apfelbaum
315453ac883SMarcel Apfelbaum8. Conclusion
316453ac883SMarcel Apfelbaum==============
317453ac883SMarcel ApfelbaumThe proposal offers a usage model that is easy to understand and follow
318453ac883SMarcel Apfelbaumand at the same time overcomes the PCI Express architecture limitations.
319