All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry R <rdmitry0911@gmail.com>
To: qemu-devel@nongnu.org
Cc: Dmitry R <rdmitry0911@gmail.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Fabiano Rosas <farosas@suse.de>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [RFC PATCH v1 0/1] Thunderbolt PCIe hotplug layer
Date: Fri, 10 Jul 2026 16:34:37 +0300	[thread overview]
Message-ID: <20260710133440.2845828-1-rdmitry0911@gmail.com> (raw)

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.

The series intentionally keeps regular QEMU PCI endpoint devices intact.
Devices behind the new layer remain normal QEMU PCI devices; the
Thunderbolt root port controls guest-visible link presence, publishes ACPI
properties, and emits PCIe hotplug notifications.

The patch adds:

* thunderbolt-root-port, creating a thunderbolt-bus secondary bus.
* thunderbolt-pcie-pci-bridge for tunnelled PCI endpoints.
* thunderbolt-vga, a separate stdvga-compatible hotpluggable endpoint.
* README/specs documentation with VGA, USB storage, and NVMe examples.
* qtest coverage for the Thunderbolt VGA hotplug path.

The regular QEMU VGA device is not changed and remains non-hotpluggable.
The Thunderbolt display path uses the separate thunderbolt-vga device type.

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 expected warnings for MIT inheritance in thunderbolt-vga.c
  and possible MAINTAINERS coverage.

Open questions:

* Whether this should be split into smaller review patches after the overall
  Thunderbolt modelling direction is accepted.
* Which MAINTAINERS entry should own the Thunderbolt PCIe layer.
* Whether the guest-visible properties are sufficient for non-macOS guests
  that may also benefit from Thunderbolt-style tunnelling.

Dmitry R (1):
  hw/pci-bridge: add Thunderbolt PCIe hotplug layer

 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 +++
 9 files changed, 1258 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

-- 
2.47.3


             reply	other threads:[~2026-07-10 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 13:34 Dmitry R [this message]
2026-07-10 13:34 ` [RFC PATCH v1 1/1] hw/pci-bridge: add Thunderbolt PCIe hotplug layer Dmitry R
2026-07-11  9:17 ` [RFC PATCH v1 0/1] " Michael S. Tsirkin
2026-07-11  9:47 ` [RFC PATCH v2 0/5] " Dmitry R
2026-07-11  9:47   ` [RFC PATCH v2 1/5] hw/pci-bridge: add Thunderbolt root port Dmitry R
2026-07-11  9:47   ` [RFC PATCH v2 2/5] hw/pci-bridge: add Thunderbolt PCIe-to-PCI bridge Dmitry R
2026-07-11  9:47   ` [RFC PATCH v2 3/5] hw/display: add Thunderbolt VGA endpoint Dmitry R
2026-07-11  9:48   ` [RFC PATCH v2 4/5] tests/qtest: cover Thunderbolt VGA hotplug Dmitry R
2026-07-11  9:48   ` [RFC PATCH v2 5/5] docs: document Thunderbolt PCIe hotplug layer Dmitry R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260710133440.2845828-1-rdmitry0911@gmail.com \
    --to=rdmitry0911@gmail.com \
    --cc=farosas@suse.de \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.