All of lore.kernel.org
 help / color / mirror / Atom feed
From: Isaku Yamahata <yamahata@valinux.co.jp>
To: qemu-devel@nongnu.org
Cc: yamahata@valinux.co.jp, mst@redhat.com
Subject: [Qemu-devel] [PATCH] pci/pcie: make pci_find_device() ARI aware.
Date: Thu, 20 Jan 2011 15:57:39 +0900	[thread overview]
Message-ID: <eda23196a47e978a0f5b2b13415121fff05e9eef.1295506324.git.yamahata@valinux.co.jp> (raw)

make pci_find_device() ARI aware.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pci.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 8d0e3df..851f350 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1596,11 +1596,18 @@ PCIBus *pci_find_bus(PCIBus *bus, int bus_num)
 
 PCIDevice *pci_find_device(PCIBus *bus, int bus_num, int slot, int function)
 {
+    PCIDevice *d;
     bus = pci_find_bus(bus, bus_num);
 
     if (!bus)
         return NULL;
 
+    d = bus->parent_dev;
+    if (d && pci_is_express(d) &&
+        pcie_cap_get_type(d) == PCI_EXP_TYPE_DOWNSTREAM &&
+        !pcie_cap_is_ari_enabled(d) && slot > 0) {
+        return NULL;
+    }
     return bus->devices[PCI_DEVFN(slot, function)];
 }
 
-- 
1.7.1.1

             reply	other threads:[~2011-01-20  6:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20  6:57 Isaku Yamahata [this message]
2011-01-20 14:15 ` [Qemu-devel] Re: [PATCH] pci/pcie: make pci_find_device() ARI aware Michael S. Tsirkin
2011-01-21 10:44   ` Isaku Yamahata
2011-01-21 14:29     ` Michael S. Tsirkin
2011-01-21 16:39       ` Isaku Yamahata
2011-01-23 15:57         ` Michael S. Tsirkin
2011-01-24 11:39           ` Isaku Yamahata
2011-01-24 12:09             ` 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=eda23196a47e978a0f5b2b13415121fff05e9eef.1295506324.git.yamahata@valinux.co.jp \
    --to=yamahata@valinux.co.jp \
    --cc=mst@redhat.com \
    --cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.