From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW3tr-0005Oj-Ve for qemu-devel@nongnu.org; Mon, 13 Jun 2011 05:57:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW3tq-0004fl-LB for qemu-devel@nongnu.org; Mon, 13 Jun 2011 05:57:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW3tq-0004fd-C7 for qemu-devel@nongnu.org; Mon, 13 Jun 2011 05:57:38 -0400 Date: Mon, 13 Jun 2011 12:57:20 +0300 From: Gleb Natapov Message-ID: <20110613095720.GL491@redhat.com> References: <1307532813-27175-1-git-send-email-peter.maydell@linaro.org> <4DEF6B2B.7090305@siemens.com> <4DF0FCDA.5070804@siemens.com> <4DF21334.2070204@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH RFC 0/3] basic support for composing sysbus devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , Anthony Liguori , Juha =?utf-8?Q?Riihim=C3=A4ki?= , "patches@linaro.org" , Jan Kiszka , "qemu-devel@nongnu.org" , Paul Brook On Fri, Jun 10, 2011 at 04:59:08PM +0200, Markus Armbruster wrote: > Anthony Liguori writes: > > > On 06/10/2011 03:13 AM, Markus Armbruster wrote: > >> Jan Kiszka writes: > >>> Resource management, e.g. IRQs. That will be useful for other types of > >>> buses as well. > >> > >> A device should be able to say "I need to be connected to an IRQ line". > >> Feels generic to me. > > > > More specifically, a device has input IRQs. A device has no idea what > > number the IRQ is tied to. > > > > Devices may also have output IRQs. At the qdev layer, we should be > > able to connect an arbitrary output IRQ to an arbitrary input IRQ. > > > > So the crux of the problem is that: > > > > -device isa-serial,id=serial,irq=3 > > > > Is very wrong. It ought to look something more like > > > > -device piix3,id=piix3 -device isa-serial,id=serial,irq=piix3.irq[3] > > As Jan pointed out, ISA is a counter-example: your "very wrong" claim is > actually wrong there :) > > An ISA device is always connected to all the ISA bus's interrupt lines. > Device configuration determines how the device uses these lines. > > The old (non-MSI) PCI interrupts are similar, I think. > Each PCI card has 4 irq pins INTA/INTB/INTC/INTD (usually only INTA is used). Chipset has PCI irq router with one or more inputs (PIIX3 has 4 PIRQ[A:D]#). Wiring on the motherboard determines which irq pin is connect to which PCI irq router input. Different slots usually connect the same interrupt line to a different router input in order to spread INTA of different cards between different inputs. PCI irq router is configured to route each input pin to a different (or same) GSI. OS can reconfigure irq router at will using AML methods if they are provided. -- Gleb.