vmm: pci_segment: use segment id as ACPI _UID

The ACPI specification requires _UID to be unique across devices
sharing the same _HID (ACPI 6.5 section 6.1.12). Currently every
PciSegment emits _UID=0 for its PNP0A08 host bridge, which violates
the spec when num_pci_segments > 1.

Windows guests detect this during ACPI namespace enumeration and
abort boot with BSOD 0xA5 ACPI_BIOS_ERROR, pointing at the _UID
object of the second PNP0A08 node. Linux guests are lenient and
silently accept the collision, so the issue has gone unnoticed.

Use self.id as _UID, matching what _SEG does on the line above.
For single-segment VMs (id == 0) this is a no-op at runtime.

Signed-off-by: Max Makarov <maxpain@linux.com>
This commit is contained in:
Max Makarov
2026-04-10 17:17:01 +00:00
committed by Rob Bradford
parent a3899a9783
commit 87ba83bb01

View File

@@ -360,7 +360,7 @@ impl Aml for PciSegment {
pci_dsdt_inner_data.push(&adr);
let seg = aml::Name::new("_SEG".into(), &self.id);
pci_dsdt_inner_data.push(&seg);
let uid = aml::Name::new("_UID".into(), &aml::ZERO);
let uid = aml::Name::new("_UID".into(), &self.id);
pci_dsdt_inner_data.push(&uid);
let cca = aml::Name::new("_CCA".into(), &aml::ONE);
pci_dsdt_inner_data.push(&cca);