Skip to content

Commit

Permalink
hw/pci-host: Allow extended config space access for Designware PCIe host
Browse files Browse the repository at this point in the history
In pcie_bus_realize(), a root bus is realized as a PCIe bus and a non-root
bus is realized as a PCIe bus if its parent bus is a PCIe bus. However,
the child bus "dw-pcie" is realized before the parent bus "pcie" which is
the root PCIe bus. Thus, the extended configuration space is not accessible
on "dw-pcie". The issue can be resolved by adding the
PCI_BUS_EXTENDED_CONFIG_SPACE flag to "pcie" before "dw-pcie" is realized.

Signed-off-by: Jason Chien <jason.chien@sifive.com>
Message-Id: <20230809102257.25121-1-jason.chien@sifive.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Signed-off-by: Jason Chien &lt;<a href="mailto:jason.chien@sifive.com" target="_blank">jason.chien@sifive.com</a>&gt;<br>
  • Loading branch information
Jason Chien authored and mstsirkin committed Aug 11, 2023
1 parent 15b11a1 commit 3d449bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/pci-host/designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ static void designware_pcie_host_realize(DeviceState *dev, Error **errp)
&s->pci.io,
0, 4,
TYPE_PCIE_BUS);
pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;

memory_region_init(&s->pci.address_space_root,
OBJECT(s),
Expand Down

0 comments on commit 3d449bc

Please sign in to comment.