From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Guyader Subject: Re: [PATCH] ioemu: fix pt_chk_bar_overload Date: Wed, 16 Jul 2008 17:04:31 +0100 Message-ID: <487E1C0F.3080001@eu.citrix.com> References: <487E1B9F.8060305@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040909050502070008030405" Return-path: In-Reply-To: <487E1B9F.8060305@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040909050502070008030405 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Oops wrong patch, sorry about that .... ioemu: fix the devices loop. Signed-off-by: Jean Guyader -- Jean Guyader --------------040909050502070008030405 Content-Type: text/plain; name="ioemu_fix_pt_chk_bar_overload.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ioemu_fix_pt_chk_bar_overload.patch" 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