WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] ioemu: fix pt_chk_bar_overload

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] ioemu: fix pt_chk_bar_overload
From: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Date: Wed, 16 Jul 2008 17:04:31 +0100
Delivery-date: Wed, 16 Jul 2008 09:05:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <487E1B9F.8060305@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <487E1B9F.8060305@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509)
Oops wrong patch, sorry about that ....

ioemu: fix the devices loop.

Signed-off-by: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>

--
Jean Guyader
diff -r 63317b6c3eab tools/ioemu/hw/pci.c
--- a/tools/ioemu/hw/pci.c      Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/ioemu/hw/pci.c      Wed Jul 16 16:59:57 2008 +0100
@@ -644,15 +644,15 @@ PCIBus *pci_bridge_init(PCIBus *bus, int
 
 int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr, uint32_t size)
 {
-    PCIDevice *devices = (PCIDevice *)bus->devices;
+    PCIDevice *devices;
     PCIIORegion *r;
     int ret = 0;
     int i, j;
 
     /* check Overlapped to Base Address */
-    for (i=0; i<256; i++, devices++)
+    for (i=bus->devfn_min; i<256; i += 8)
     {
-        if ((devices == NULL) || (devices->devfn == devfn))
+        if ( !(devices = bus->devices[devfn]) )
             continue;
 
         for (j=0; j<PCI_NUM_REGIONS; j++)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel