qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pci: fix pci_find_space()
@ 2010-04-09 10:20 Isaku Yamahata
  2010-04-11  9:19 ` [Qemu-devel] " Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Isaku Yamahata @ 2010-04-09 10:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael S. Tsirkin

pci capability must be in PCI space.
It can't lay in PCIe extended config space.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pci.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 2f6907b..f50568c 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1701,10 +1701,9 @@ PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name)
 
 static int pci_find_space(PCIDevice *pdev, uint8_t size)
 {
-    int config_size = pci_config_size(pdev);
     int offset = PCI_CONFIG_HEADER_SIZE;
     int i;
-    for (i = PCI_CONFIG_HEADER_SIZE; i < config_size; ++i)
+    for (i = PCI_CONFIG_HEADER_SIZE; i < PCI_CONFIG_SPACE_SIZE - size; ++i)
         if (pdev->used[i])
             offset = i + 1;
         else if (i - offset + 1 == size)
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-12  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09 10:20 [Qemu-devel] [PATCH] pci: fix pci_find_space() Isaku Yamahata
2010-04-11  9:19 ` [Qemu-devel] " Michael S. Tsirkin
2010-04-12  1:59   ` Isaku Yamahata

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).