From: Michael Roth <mdroth@linux.vnet.ibm.com>
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
Subject: [Qemu-devel] [PATCH] pci: allow 0 address for PCI IO/MEM regions
Date: Tue, 23 Dec 2014 13:33:36 -0600 [thread overview]
Message-ID: <1419363216-26601-2-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1419363216-26601-1-git-send-email-mdroth@linux.vnet.ibm.com>
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 <mdroth@linux.vnet.ibm.com>
---
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
next prev parent reply other threads:[~2014-12-23 19:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-23 19:33 [Qemu-devel] [PATCH 0/1] pci: allow 0 address for PCI IO/MEM regions Michael Roth
2014-12-23 19:33 ` Michael Roth [this message]
2015-01-12 13:24 ` Michael Roth
2015-01-13 5:46 ` David Gibson
2015-01-13 9:05 ` Claudio Fontana
2015-01-13 10:12 ` Michael S. Tsirkin
2015-01-13 15:34 ` Michael Roth
2015-01-13 15:54 ` Michael S. Tsirkin
2015-01-13 16:17 ` Michael S. Tsirkin
2015-01-13 17:01 ` Alexander Graf
2015-01-13 18:42 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1419363216-26601-2-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).