qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: mst@redhat.com, qemu-devel@nongnu.org
Cc: jan.kiszka@siemens.com, alex.williamson@redhat.com
Subject: [Qemu-devel] [PATCH 1/6] pci: Add INTx no-route option
Date: Tue, 02 Oct 2012 13:21:41 -0600	[thread overview]
Message-ID: <20121002192139.31100.95177.stgit@bling.home> (raw)
In-Reply-To: <20121002191609.31100.77382.stgit@bling.home>

pci_device_route_intx_to_irq() has no probe capability.  vfio-pci
can make use of KVM acceleration if this information is available,
but can still operate without it.  Make it non-fatal to call this
on a platform or chipset where it hasn't been implemented yet.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

 hw/pci.c |    8 ++++++--
 hw/pci.h |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index f855cf3..9cb0ad4 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1094,8 +1094,12 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin)
          pin = bus->map_irq(dev, pin);
          dev = bus->parent_dev;
     } while (dev);
-    assert(bus->route_intx_to_irq);
-    return bus->route_intx_to_irq(bus->irq_opaque, pin);
+
+    if (bus->route_intx_to_irq) {
+        return bus->route_intx_to_irq(bus->irq_opaque, pin);
+    }
+
+    return (PCIINTxRoute) { PCI_INTX_NOROUTE, -1 };
 }
 
 void pci_bus_fire_intx_routing_notifier(PCIBus *bus)
diff --git a/hw/pci.h b/hw/pci.h
index 4b6ab3d..ed1a372 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -146,6 +146,7 @@ typedef struct PCIINTxRoute {
         PCI_INTX_ENABLED,
         PCI_INTX_INVERTED,
         PCI_INTX_DISABLED,
+        PCI_INTX_NOROUTE,
     } mode;
     int irq;
 } PCIINTxRoute;

  reply	other threads:[~2012-10-02 19:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 19:21 [Qemu-devel] [PATCH 0/6] Misc PCI cleanups Alex Williamson
2012-10-02 19:21 ` Alex Williamson [this message]
2012-10-02 19:21 ` [Qemu-devel] [PATCH 2/6] pci-assign: Add support for no-route Alex Williamson
2012-10-02 19:55   ` Anthony Liguori
2012-10-02 20:12     ` Alex Williamson
2012-10-03  9:52       ` Paolo Bonzini
2012-10-03 12:32         ` Anthony Liguori
2012-10-02 19:21 ` [Qemu-devel] [PATCH 3/6] pci: Helper function for testing if an INTx route changed Alex Williamson
2012-10-02 19:22 ` [Qemu-devel] [PATCH 4/6] pci-assign: Use pci_intx_route_changed() Alex Williamson
2012-10-02 19:22 ` [Qemu-devel] [PATCH 5/6] msi: Add msi_get_message() Alex Williamson
2012-10-02 19:22 ` [Qemu-devel] [PATCH 6/6] pci-assign: Use msi_get_message() Alex Williamson
2012-10-08 15:58 ` [Qemu-devel] [PATCH 0/6] Misc PCI cleanups Alex Williamson
2012-10-08 16:01   ` Jan Kiszka
2012-10-08 20:15   ` Michael S. Tsirkin
2012-10-08 19:27     ` Alex Williamson
2012-10-08 21:40       ` Michael S. Tsirkin
2012-10-08 21:11         ` Alex Williamson
2012-10-08 21:50           ` Michael S. Tsirkin
2012-10-08 22:09             ` Alex Williamson
2012-10-08 22:44               ` Michael S. Tsirkin
2012-10-08 23:54                 ` Alex Williamson
2012-10-11 14:11                   ` Michael S. Tsirkin
2012-10-09  7:09           ` Jan Kiszka
2012-10-10 19:31             ` Alex Williamson
2012-10-11 10:37               ` Michael S. Tsirkin
2012-10-11 13:38                 ` Alex Williamson
2012-10-11 13:49                   ` Michael S. Tsirkin
2012-10-11 14:10                     ` Alex Williamson

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=20121002192139.31100.95177.stgit@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --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 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).