From c99ed77d1a8f6126f22402da206a604a97dc7db8 Mon Sep 17 00:00:00 2001 From: Max Makarov Date: Sat, 11 Apr 2026 08:11:51 +0000 Subject: [PATCH] tests: pci: verify per-segment ACPI _UID in DSDT Extend test_pci_multiple_segments_numa_node to assert that every PNP0A08 host bridge in the guest DSDT exposes a unique _UID matching its PCI segment id. Linux surfaces the evaluated _UID value through /sys/bus/acpi/devices/PNP0A08:*/uid, so the check is a single additional ssh command on top of the existing test plumbing. This test is used (rather than test_pci_multiple_segments) so that the assertion runs on both x86_64 and aarch64: the numa_node variant boots through edk2 firmware on aarch64, making ACPI (and PNP0A08 host bridges) available, whereas the non-firmware variant uses FDT on aarch64 and exposes no PNP0A08 nodes. Without a per-segment _UID, two PNP0A08 nodes share _UID=0 which violates ACPI 6.5 section 6.1.12 and triggers BSOD 0xA5 on Windows guests. This assertion would catch any future regression of that kind. Signed-off-by: Max Makarov --- cloud-hypervisor/tests/integration.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index 8b16c909e..22d32852e 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -489,6 +489,20 @@ mod common_parallel { .unwrap_or_default(), TEST_DISK_NODE ); + + // Each PNP0A08 host bridge in the DSDT must expose a unique + // _UID matching its PCI segment id. Linux surfaces the + // evaluated _UID via /sys/bus/acpi/devices/PNP0A08:*/uid. + // This test uses firmware boot on aarch64, so ACPI is + // available on both supported architectures. + let mut uids: Vec = guest + .ssh_command("cat /sys/bus/acpi/devices/PNP0A08:*/uid") + .unwrap() + .lines() + .filter_map(|l| l.trim().parse::().ok()) + .collect(); + uids.sort(); + assert_eq!(uids, vec![0u16, 1u16]); }); kill_child(&mut child);