Skip to content

RFC Thunderbolt PCIe hotplug layer

Dmitry R qemu-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest5 patches 0 repliesNew
  2. v1 RFC1 patch 1 replySuperseded

Changes in v2 from the cover letter

* Split the single large patch into five patches.
* Clarified that the modelling piece is the Thunderbolt root port/bus.
* Added a MAINTAINERS entry with Dmitry R as reviewer.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5hw/pci-bridge: add Thunderbolt root porthw/pci-bridge/meson.build hw/pci-bridge/thunderbolt_root_port.c+566 -00 replies
2/5hw/pci-bridge: add Thunderbolt PCIe-to-PCI bridgehw/pci-bridge/meson.build hw/pci-bridge/thunderbolt_pcie_pci_bridge.c+157 -00 replies
3/5hw/display: add Thunderbolt VGA endpointhw/display/meson.build hw/display/thunderbolt-vga.c+276 -00 replies
4/5tests/qtest: cover Thunderbolt VGA hotplugtests/qtest/display-vga-test.c+68 -00 replies
5/5docs: document Thunderbolt PCIe hotplug layerMAINTAINERS README.md docs/specs/index.rst +1 more+198 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/5] Thunderbolt PCIe hotplug layer

This RFC adds a Thunderbolt-flavoured PCIe hotplug layer for QEMU.

The main goal is hotplug and hot-unplug of real and virtual devices in guests where direct hotplug for those devices is not supported or not usable. macOS is the main validation target for this path: the guest can observe endpoints through a guest-visible Thunderbolt layer even when direct PCIe hotplug for the same endpoint is not usable.

In v2, the series is split so the modelling part is explicit:

* patch 1 adds the Thunderbolt root port and thunderbolt-bus. This is the core Thunderbolt PCIe model: endpoint devices remain normal QEMU PCI devices, while the root port controls guest-visible link presence and PCIe hotplug signalling.
* patch 2 adds the Thunderbolt PCIe-to-PCI bridge for tunnelled PCI endpoints.
* patch 3 adds a separate thunderbolt-vga endpoint for display hotplug tests. The regular QEMU VGA device remains untouched and non-hotpluggable.
* patch 4 adds qtest coverage.
* patch 5 adds documentation and MAINTAINERS coverage.

I added myself as reviewer for the Thunderbolt PCIe files. The files still match the existing PCI area through their paths, so PCI maintainership is inherited by normal get_maintainer.pl matching.

Runtime validation performed so far:

* macOS guest booted from QCOW2 overlays over immutable base disk images.
* Thunderbolt VGA hotplug/removal while the standard boot VGA remains.
* NVMe hotplug/removal with guest driver instance checks.
* USB controller hotplug, USB storage mount/write/eject, controller removal, replug, and data persistence verification.

Build/test validation:

* ninja -C build qemu-system-x86_64 tests/qtest/display-vga-test
* meson test -C build qtest-x86_64/display-vga-test --print-errorlogs
* scripts/checkpatch.pl --no-tree --no-signoff on the full diff:
0 errors, with one expected warning for MIT inheritance in thunderbolt-vga.c.

Changes since v1:

* Split the single large patch into five patches.
* Clarified that the modelling piece is the Thunderbolt root port/bus.
* Added a MAINTAINERS entry with Dmitry R as reviewer.

Dmitry R (5):
hw/pci-bridge: add Thunderbolt root port hw/pci-bridge: add Thunderbolt PCIe-to-PCI bridge hw/display: add Thunderbolt VGA endpoint tests/qtest: cover Thunderbolt VGA hotplug
docs: document Thunderbolt PCIe hotplug layer

 MAINTAINERS                                 |   7 +
 README.md                                   |  91 ++++
 docs/specs/index.rst                        |   1 +
 docs/specs/thunderbolt-pcie-hotplug.rst     |  99 ++++
 hw/display/meson.build                      |   1 +
 hw/display/thunderbolt-vga.c                | 275 ++++++++++
 hw/pci-bridge/meson.build                   |   2 +
 hw/pci-bridge/thunderbolt_pcie_pci_bridge.c | 156 ++++++
 hw/pci-bridge/thunderbolt_root_port.c       | 565 ++++++++++++++++++++
 tests/qtest/display-vga-test.c              |  68 +++
 10 files changed, 1265 insertions(+)
 create mode 100644 README.md
 create mode 100644 docs/specs/thunderbolt-pcie-hotplug.rst
 create mode 100644 hw/display/thunderbolt-vga.c
 create mode 100644 hw/pci-bridge/thunderbolt_pcie_pci_bridge.c
 create mode 100644 hw/pci-bridge/thunderbolt_root_port.c
Signature · 1 line
2.47.3