[PATCH 13/18] selftests/liveupdate: pci: Add a test with an endpoint on the root bus

From: David Matlack

Date: Tue Dec 01 2026 - 19:40:57 EST


Add a PCI Live Update test that preserves an endpoint on the root bus,
i.e. with no bridges above it, next to a control endpoint on the root
bus.

QEMU reserves the routing IDs of IGB's VFs (offset 0x80, stride 2) on
the same bus as the IGB itself, so the two endpoints are placed at
devices 2 and 4 to keep their VFs' routing IDs from overlapping.

Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>
---
.../selftests/liveupdate/pci/root_bus.vmtest.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 tools/testing/selftests/liveupdate/pci/root_bus.vmtest.sh

diff --git a/tools/testing/selftests/liveupdate/pci/root_bus.vmtest.sh b/tools/testing/selftests/liveupdate/pci/root_bus.vmtest.sh
new file mode 100644
index 000000000000..e0d24a00aae7
--- /dev/null
+++ b/tools/testing/selftests/liveupdate/pci/root_bus.vmtest.sh
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Preserve an endpoint on the root bus, i.e. with no bridges above it.
+
+source "$test_dir/pci/pci_vmtest_lib.sh"
+
+# QEMU reserves the routing IDs of IGB's VFs (offset 0x80, stride 2) on the same
+# bus, i.e. devices 18-19 for the IGB at device 2 and 20-21 for device 4.
+pci_igb igb1 pcie.0 0x2
+pci_igb igb2 pcie.0 0x4
+
+pci_preserve 0000:00:02.0
+pci_control 0000:00:04.0
--
2.56.1.911.g883d8bcb20-goog