* [PATCH] acpi-build: Walk PCI root buses when building IVHD entries
@ 2026-11-16 13:42 Sairaj Kodilkar
0 siblings, 0 replies; only message in thread
From: Sairaj Kodilkar @ 2026-11-16 13:42 UTC (permalink / raw)
To: Michael S. Tsirkin, Ani Sinha, Igor Mammedov, Paolo Bonzini,
Richard Henderson, qemu-devel
Cc: vasant.hegde, suravee.suthikulpanit, Sairaj Kodilkar
add_ivhd_entries_from_bus() treats every bus with parent_dev set as a
bridge secondary bus and reads PCI_SUBORDINATE_BUS to decide between a
device walk and a leaf range. A pxb-pcie bus is a root bus, but
pxb_register_bus() sets parent_dev and links the bus into pcie.0's
child list. The pxb device is a type-0 host bridge, so offset 0x1a is
a BAR byte rather than the subordinate bus number. The walk currently
selects the devices on that bus only because the BAR byte is 0 and
bus_nr is not. If those values match, the builder emits a range and
skips the devices and bridges under the pxb bus.
Treat pci_bus_is_root() the same as a bus with no parent device.
pcie.0 and pxb-pcie then get a device walk. Bridge secondary buses
still use PCI_SUBORDINATE_BUS for their range entries.
Fixes: f3370c89e1726 ("acpi-build: Create PCI topology using amd iommu root bus")
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
---
hw/i386/acpi-build.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 985515434974..84a8b14d83a6 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1776,7 +1776,7 @@ static void add_ivhd_entries_from_bus(PCIBus *bus, GArray *table_data)
PCIBus *child_bus;
PCIDevice *parent_dev;
- if (!bus->parent_dev) {
+ if (!bus->parent_dev || pci_bus_is_root(bus)) {
goto select_devices;
}
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-16 13:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 13:42 [PATCH] acpi-build: Walk PCI root buses when building IVHD entries Sairaj Kodilkar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.