[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 02/13] spapr_pci: Fix broken naming of PCI bus
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v5 02/13] spapr_pci: Fix broken naming of PCI bus |
Date: |
Fri, 12 Apr 2019 17:36:36 +0200 |
From: Greg Kurz <address@hidden>
Recent commit 5cf0d326a0fe fixed a regression which was preventing the
guest to access the extended config space of a PCIe device. This was
done by introducing a new PCI bus subtype for PAPR. The original fix
was causing PCI busses to be named "spapr-pci-host-bridge-root-bus.N"
instead of "pci.N", which was making upper layers unhappy of course.
This got worked around by hardcoding the PCI bus name to "pci.0", but
this only works for the default PHB. And we're now hitting:
# qemu-system-ppc64 \
-device spapr-pci-host-bridge,index=1 \
-device e1000e,bus=pci.0 \
-device e1000e,bus=pci.1
qemu-system-ppc64: -device e1000e,bus=pci.1: Bus 'pci.1' not found
David already posted some patches [1] to control PCI extended config
space accesses with a new flag in the base PCI bus class instead of
subtyping. These patches are a bit more intrusive though, and
are targetted for 4.1.
When no name is passed to pci_register_bus(), the core device code
generates a lowercase name based on the QOM typename. The typename
for the base PCI bus class is "PCI", hence the "pci.0", "pci.1"
bus names. Rename the type of the PAPR PCI bus to "pci", so that
the QOM code can generate proper names. This is a hack but it is
enough to fix the regression. And all this will be reworked properly
in 4.1.
[1] https://patchwork.ozlabs.org/project/qemu-devel/list/?series=100486
Fixes: 5cf0d326a0fe
Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index f0b6b23afc..f62e6833b8 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1652,7 +1652,7 @@ static void spapr_phb_root_bus_class_init(ObjectClass
*klass, void *data)
pbc->allows_extended_config_space = spapr_phb_allows_extended_config_space;
}
-#define TYPE_SPAPR_PHB_ROOT_BUS "spapr-pci-host-bridge-root-bus"
+#define TYPE_SPAPR_PHB_ROOT_BUS "pci"
static const TypeInfo spapr_phb_root_bus_info = {
.name = TYPE_SPAPR_PHB_ROOT_BUS,
@@ -1761,7 +1761,7 @@ static void spapr_phb_realize(DeviceState *dev, Error
**errp)
memory_region_add_subregion(get_system_memory(), sphb->io_win_addr,
&sphb->iowindow);
- bus = pci_register_root_bus(dev, "pci.0",
+ bus = pci_register_root_bus(dev, NULL,
pci_spapr_set_irq, pci_spapr_map_irq, sphb,
&sphb->memspace, &sphb->iospace,
PCI_DEVFN(0, 0), PCI_NUM_PINS,
--
2.21.0.313.ge35b8cb8e2
- [Qemu-devel] [PATCH v5 00/13] vhost-user for input & GPU, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 01/13] Update version for v4.0.0-rc3 release, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 04/13] Add vhost-user-backend, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 03/13] curses: fix wchar_t printf warning, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 02/13] spapr_pci: Fix broken naming of PCI bus,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v5 05/13] Add vhost-user-input-pci, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 06/13] libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 07/13] contrib: add vhost-user-input, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 08/13] vhost-user: add vhost_user_gpu_set_socket(), Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 09/13] virtio: add virtio-gpu bswap helpers header, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 10/13] contrib: add vhost-user-gpu, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 11/13] virtio-gpu: split virtio-gpu, introduce virtio-gpu-base, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 12/13] virtio-gpu: split virtio-gpu-pci & virtio-vga, Marc-André Lureau, 2019/04/12
- [Qemu-devel] [PATCH v5 13/13] hw/display: add vhost-user-vga & gpu-pci, Marc-André Lureau, 2019/04/12
- Re: [Qemu-devel] [PATCH v5 00/13] vhost-user for input & GPU, Marc-André Lureau, 2019/04/12