[PATCH 15/18] selftests/liveupdate: pci: Test bus numbers with pci=assign-busses

From: David Matlack

Date: Tue Dec 01 2026 - 19:41:01 EST


Add a PCI Live Update test that boots the next kernel with
pci=assign-busses, which makes x86 assign all bus numbers itself rather
than keep the ones it finds. The next kernel must still keep the bus
numbers of the bridges above a preserved endpoint, which the test
checks with the switch topology.

pci=assign-busses only exists on x86. On arm64 and riscv64, the generic
host bridge driver used by QEMU's virt machine reassigns all bus numbers
anyway, so every test there already covers this, and the test is
skipped.

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

diff --git a/tools/testing/selftests/liveupdate/pci/assign_busses.vmtest.sh b/tools/testing/selftests/liveupdate/pci/assign_busses.vmtest.sh
new file mode 100644
index 000000000000..f02b1914baf2
--- /dev/null
+++ b/tools/testing/selftests/liveupdate/pci/assign_busses.vmtest.sh
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Ask the next kernel to assign all bus numbers itself, which it must not do for
+# bridges above a preserved endpoint.
+#
+# On arm64 and riscv64, the generic host bridge driver used by QEMU's virt
+# machine reassigns all bus numbers anyway, so every test there covers this.
+
+source "$test_dir/pci/pci_vmtest_lib.sh"
+
+if [[ "$arch" != "x86" ]]; then
+ skip "pci=assign-busses is only supported on x86"
+fi
+
+pci_topology_switch
+TEST_CMDLINE_STAGE2="pci=assign-busses"
--
2.56.1.911.g883d8bcb20-goog