From patchwork Tue Oct 2 19:21:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 188635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6E09F2C0085 for ; Wed, 3 Oct 2012 05:22:05 +1000 (EST) Received: from localhost ([::1]:55005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82d-0004RH-G1 for incoming@patchwork.ozlabs.org; Tue, 02 Oct 2012 15:22:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82O-0004BG-Js for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:21:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ82I-00023Y-U8 for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:21:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82I-00022b-LD for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:21:42 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q92JLgjG001720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Oct 2012 15:21:42 -0400 Received: from bling.home (ovpn-113-153.phx2.redhat.com [10.3.113.153]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q92JLf7T020871; Tue, 2 Oct 2012 15:21:41 -0400 From: Alex Williamson To: mst@redhat.com, qemu-devel@nongnu.org Date: Tue, 02 Oct 2012 13:21:41 -0600 Message-ID: <20121002192139.31100.95177.stgit@bling.home> In-Reply-To: <20121002191609.31100.77382.stgit@bling.home> References: <20121002191609.31100.77382.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: jan.kiszka@siemens.com, alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH 1/6] pci: Add INTx no-route option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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;