[PATCH 16/18] selftests/liveupdate: pci: Test bus numbers with pci=hpbussize
From: David Matlack
Date: Tue Dec 01 2026 - 19:41:07 EST
Add a PCI Live Update test that boots the next kernel with
pci=hpbussize=16, which makes it reserve extra bus numbers below
hotplug bridges, such as QEMU's PCIe ports.
Reassigning bus numbers with the same settings as the first kernel
produces the same numbers again, so only the trace check would catch a
next kernel that fails to keep them. With hpbussize=16 the reassigned
numbers differ, so the checks in the next kernel catch it too. The test
uses the switch topology.
On x86, also pass pci=assign-busses so that the next kernel reassigns
bus numbers. The generic host bridge driver used on arm64 and riscv64
always does.
Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>
---
.../liveupdate/pci/hpbussize.vmtest.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 tools/testing/selftests/liveupdate/pci/hpbussize.vmtest.sh
diff --git a/tools/testing/selftests/liveupdate/pci/hpbussize.vmtest.sh b/tools/testing/selftests/liveupdate/pci/hpbussize.vmtest.sh
new file mode 100644
index 000000000000..423fdbde99c1
--- /dev/null
+++ b/tools/testing/selftests/liveupdate/pci/hpbussize.vmtest.sh
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Ask the next kernel to reserve extra bus numbers below hotplug bridges, which
+# would change the bus numbers of bridges above a preserved endpoint if they
+# were reassigned.
+
+source "$test_dir/pci/pci_vmtest_lib.sh"
+
+pci_topology_switch
+
+# The generic host bridge driver used on arm64 and riscv64 reassigns all bus
+# numbers, but x86 must be asked to.
+if [[ "$arch" == "x86" ]]; then
+ TEST_CMDLINE_STAGE2="pci=assign-busses,hpbussize=16"
+else
+ TEST_CMDLINE_STAGE2="pci=hpbussize=16"
+fi
--
2.56.1.911.g883d8bcb20-goog