From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYdo-0005hE-Kk for qemu-devel@nongnu.org; Wed, 17 Oct 2012 14:47:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOYdn-0004Tj-N9 for qemu-devel@nongnu.org; Wed, 17 Oct 2012 14:46:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYdn-0004TE-Em for qemu-devel@nongnu.org; Wed, 17 Oct 2012 14:46:51 -0400 Date: Wed, 17 Oct 2012 21:48:52 +0200 From: "Michael S. Tsirkin" Message-ID: <20121017194852.GA8629@redhat.com> References: <20121017182413.28445.77012.stgit@bling.home> <507EFB85.5030206@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <507EFB85.5030206@siemens.com> Subject: Re: [Qemu-devel] [PATCH] pci: Return PCI_INTX_DISABLED when no bus INTx routing support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Alex Williamson , "qemu-devel@nongnu.org" On Wed, Oct 17, 2012 at 08:40:05PM +0200, Jan Kiszka wrote: > On 2012-10-17 20:25, Alex Williamson wrote: > > Rather than assert, simply return PCI_INTX_DISABLED when we don't > > have a pci_route_irq_fn. PIIX already returns DISABLED for an > > invalid pin, so users already deal with this state. Users of this > > interface should only be acting on an ENABLED or INVERTED return > > value (though we really have no support for INVERTED). > > > > Signed-off-by: Alex Williamson > > --- > > > > A compromise to the gridlock; defuse the assert, but don't add > > a new state to the API. Thanks, > > But how do you tell "unsupported" apart from "disabled" in VFIO? If the > chipset truly disabled the line, you must not provide it to the guest in > some other way. > > Jan vfio does not care. It merely disables irqfd and delivers irqs to qemu. > > > > Alex > > > > hw/pci.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/hw/pci.c b/hw/pci.c > > index 83d262a..9525220 100644 > > --- a/hw/pci.c > > +++ b/hw/pci.c > > @@ -1094,7 +1094,11 @@ 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); > > + > > + if (!bus->route_intx_to_irq) { > > + return (PCIINTxRoute) { PCI_INTX_DISABLED, -1 }; > > + } > > + > > return bus->route_intx_to_irq(bus->irq_opaque, pin); > > } > > > > > > -- > Siemens AG, Corporate Technology, CT RTC ITP SDP-DE > Corporate Competence Center Embedded Linux