[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/18] spapr-pci: fix config space access to support
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 11/18] spapr-pci: fix config space access to support bridges |
Date: |
Mon, 2 Sep 2013 10:11:26 +0200 |
From: Alexey Kardashevskiy <address@hidden>
spapr-pci config space accessors use find_dev() to find a PCI device.
However find_dev() only searched on a primary bus and did not do
recursive search through secondary buses so config space access was not
possible for devices other that on a primary bus.
This fixed find_dev() by using the PCI API pci_find_device() function.
This effectively enabled pci bridges on spapr.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr_pci.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 1ca35a0..65be265 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -65,22 +65,14 @@ static PCIDevice *find_dev(sPAPREnvironment *spapr,
uint64_t buid,
{
sPAPRPHBState *sphb = find_phb(spapr, buid);
PCIHostState *phb = PCI_HOST_BRIDGE(sphb);
- BusState *bus = BUS(phb->bus);
- BusChild *kid;
+ int bus_num = (config_addr >> 16) & 0xFF;
int devfn = (config_addr >> 8) & 0xFF;
if (!phb) {
return NULL;
}
- QTAILQ_FOREACH(kid, &bus->children, sibling) {
- PCIDevice *dev = (PCIDevice *)kid->child;
- if (dev->devfn == devfn) {
- return dev;
- }
- }
-
- return NULL;
+ return pci_find_device(phb->bus, bus_num, devfn);
}
static uint32_t rtas_pci_cfgaddr(uint32_t arg)
--
1.8.1.4
- [Qemu-devel] [PULL 16/18] PPC: KVM: Compile fix for qemu_notify_event, (continued)
- [Qemu-devel] [PULL 16/18] PPC: KVM: Compile fix for qemu_notify_event, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 05/18] disas/ppc.c: Fix little endian disassembly, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 03/18] target-ppc: USE LPCR_ILE to control exception endian on POWER7, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 08/18] ppc405_uc: Disable debug output, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 02/18] pseries: Fix stalls on hypervisor virtual console, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 09/18] ppc405_boards: Don't enforce presence of firmware for qtest, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 04/18] target-ppc: POWER7 supports the MSR_LE bit, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 14/18] xics: move registration of global state to realize(), Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 12/18] target-ppc: Use #define instead of opencoding SLB valid bit, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 17/18] spapr: add "stop-self" RTAS call required to support hot CPU unplug, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 11/18] spapr-pci: fix config space access to support bridges,
Alexander Graf <=
- [Qemu-devel] [PULL 18/18] PPC: spapr: iommu: rework traces, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 13/18] spapr-pci: rework MSI/MSIX, Alexander Graf, 2013/09/02
- Re: [Qemu-devel] [PULL 00/18] ppc patch queue 2013-09-02, Aurelien Jarno, 2013/09/03