From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3VDb-0003Za-Rq for qemu-devel@nongnu.org; Tue, 23 Dec 2014 14:34:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3VDO-0007x6-2M for qemu-devel@nongnu.org; Tue, 23 Dec 2014 14:34:07 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:45283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3VDN-0007wu-UD for qemu-devel@nongnu.org; Tue, 23 Dec 2014 14:33:54 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Dec 2014 14:33:53 -0500 From: Michael Roth Date: Tue, 23 Dec 2014 13:33:36 -0600 Message-Id: <1419363216-26601-2-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1419363216-26601-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1419363216-26601-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] pci: allow 0 address for PCI IO/MEM regions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mst@redhat.com, aik@ozlabs.ru, agraf@suse.de, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Some kernels program a 0 address for io regions. PCI 3.0 spec section 6.2.5.1 doesn't seem to disallow this. Signed-off-by: Michael Roth --- hw/pci/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 371699c..8dda27d 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1034,7 +1034,7 @@ static pcibus_t pci_bar_address(PCIDevice *d, /* Check if 32 bit BAR wraps around explicitly. * TODO: make priorities correct and remove this work around. */ - if (last_addr <= new_addr || new_addr == 0 || last_addr >= UINT32_MAX) { + if (last_addr <= new_addr || last_addr >= UINT32_MAX) { return PCI_BAR_UNMAPPED; } return new_addr; @@ -1058,8 +1058,7 @@ static pcibus_t pci_bar_address(PCIDevice *d, /* XXX: as we cannot support really dynamic mappings, we handle specific values as invalid mappings. */ - if (last_addr <= new_addr || new_addr == 0 || - last_addr == PCI_BAR_UNMAPPED) { + if (last_addr <= new_addr || last_addr == PCI_BAR_UNMAPPED) { return PCI_BAR_UNMAPPED; } -- 1.9.1