[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] pci: allow 0 address for PCI IO/MEM regions
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH] pci: allow 0 address for PCI IO/MEM regions |
Date: |
Tue, 23 Dec 2014 13:33:36 -0600 |
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 <address@hidden>
---
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