From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWXvO-0006XG-Ej for qemu-devel@nongnu.org; Mon, 21 May 2012 15:05:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWXvM-0000Z3-OW for qemu-devel@nongnu.org; Mon, 21 May 2012 15:05:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWXvM-0000Yr-Bg for qemu-devel@nongnu.org; Mon, 21 May 2012 15:05:44 -0400 Date: Mon, 21 May 2012 22:05:47 +0300 From: "Michael S. Tsirkin" Message-ID: <20120521190546.GA14642@redhat.com> References: <4FBA3F8B.9060103@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FBA3F8B.9060103@siemens.com> Subject: Re: [Qemu-devel] [PATCH 1/2] pci: Add pci_device_get_host_irq List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Alex Williamson , Marcelo Tosatti , qemu-devel , Avi Kivity On Mon, May 21, 2012 at 10:13:47AM -0300, Jan Kiszka wrote: > @@ -386,6 +387,14 @@ static void piix3_set_irq(void *opaque, int pirq, int level) > piix3_set_irq_level(piix3, pirq, level); > } > > +static int piix3_map_host_irq(void *opaque, int pci_intx) > +{ > + PIIX3State *piix3 = opaque; > + int host_irq = piix3->dev.config[PIIX_PIRQC + pci_intx]; > + > + return host_irq < PIIX_NUM_PIC_IRQS ? host_irq : -1; > +} > + > /* irq routing is changed. so rebuild bitmap */ > static void piix3_update_irq_levels(PIIX3State *piix3) > { So, instead of special API just for assignment, I would like to see map_irq in piix being reworked to take dev config into account. I think piix is almost unique in this but need to check, if not fix other host buses that are programmable. PCI bridges are all fixed routing. Then we can drop set_irq callback. Finally all devices can cache the irq#, and piix would scan devices behind it and update the irq. Assignment then just needs a notifier, since it owns the device just a pointer in device is enough. Could you look at doing this please? If no I can give it a stub. -- MST