Skip to content

Commit d26648d

Browse files
maxpainrbradford
authored andcommitted
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>
1 parent ea07f38 commit d26648d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cloud-hypervisor/tests/integration.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,20 @@ mod common_parallel {
489489
.unwrap_or_default(),
490490
TEST_DISK_NODE
491491
);
492+
493+
// Each PNP0A08 host bridge in the DSDT must expose a unique
494+
// _UID matching its PCI segment id. Linux surfaces the
495+
// evaluated _UID via /sys/bus/acpi/devices/PNP0A08:*/uid.
496+
// This test uses firmware boot on aarch64, so ACPI is
497+
// available on both supported architectures.
498+
let mut uids: Vec<u16> = guest
499+
.ssh_command("cat /sys/bus/acpi/devices/PNP0A08:*/uid")
500+
.unwrap()
501+
.lines()
502+
.filter_map(|l| l.trim().parse::<u16>().ok())
503+
.collect();
504+
uids.sort();
505+
assert_eq!(uids, vec![0u16, 1u16]);
492506
});
493507

494508
kill_child(&mut child);

0 commit comments

Comments
 (0)