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 <maxpain@linux.com>
This commit is contained in:
Max Makarov
2026-04-11 08:11:51 +00:00
committed by Rob Bradford
parent 87ba83bb01
commit c99ed77d1a

View File

@@ -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<u16> = guest
.ssh_command("cat /sys/bus/acpi/devices/PNP0A08:*/uid")
.unwrap()
.lines()
.filter_map(|l| l.trim().parse::<u16>().ok())
.collect();
uids.sort();
assert_eq!(uids, vec![0u16, 1u16]);
});
kill_child(&mut child);