qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 00/25] pci: various pci clean up and pci express


From: Isaku Yamahata
Subject: Re: [Qemu-devel] [PATCH 00/25] pci: various pci clean up and pci express support. V2
Date: Sat, 3 Oct 2009 04:30:57 +0900
User-agent: Mutt/1.5.6i

Thank you for testing.
Does the following patch helps?

diff --git a/hw/pci.c b/hw/pci.c
index 24aaba0..d562410 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -812,10 +812,15 @@ static uint32_t pci_data_read_common(PCIDevice *pci_dev,
 
 static inline PCIDevice *pci_addr_to_dev(PCIBus *bus, uint32_t addr)
 {
-    int bus_num = (addr >> 16) & 0xff;
-    unsigned int devfn = (addr >> 8) & 0xff;
+    uint8_t bus_num = (addr >> 16) & 0xff;
+    uint8_t devfn = (addr >> 8) & 0xff;
+    PCIBus *s = pci_find_bus(bus, bus_num);
 
-    return pci_find_device(bus, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
+    if (!s) {
+        return NULL;
+    }
+
+    return pci_find_device(s, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
 }
 
 static inline uint32_t pci_addr_to_config(uint32_t addr)
-- 
1.6.0.2




On Fri, Oct 02, 2009 at 03:42:09PM +0200, Gerd Hoffmann wrote:
> >sparc64 segfaults with this series applied (it is the only system
> >emulation using pci bridges right now).
> 
> ppc is broken too.  I get this on the serial line:
> 
> >> Cannot manage 'ethernet controller' PCI device type 'network':
> >>  10ec 8139 (2 0 0)
> 
> and the system hangs somewhere in the prom code.
> 
> For the record: x86_64 works fine.
> 
> cheers,
>   Gerd
> 
> 

-- 
yamahata




reply via email to

[Prev in Thread] Current Thread [Next in Thread]