All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sairaj Kodilkar <sarunkod@amd.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Ani Sinha <anisinha@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	<qemu-devel@nongnu.org>
Cc: <vasant.hegde@amd.com>, <suravee.suthikulpanit@amd.com>,
	Sairaj Kodilkar <sarunkod@amd.com>
Subject: [PATCH] acpi-build: Walk PCI root buses when building IVHD entries
Date: Mon, 16 Nov 2026 19:12:09 +0530	[thread overview]
Message-ID: <20261116134209.30331-1-sarunkod@amd.com> (raw)

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



                 reply	other threads:[~2026-11-16 13:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116134209.30331-1-sarunkod@amd.com \
    --to=sarunkod@amd.com \
    --cc=anisinha@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.