From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV2Nk-0003P1-Fs for qemu-devel@nongnu.org; Fri, 10 Jun 2011 10:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QV2Ni-0006dY-MV for qemu-devel@nongnu.org; Fri, 10 Jun 2011 10:08:16 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:45924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV2Ni-0006dM-7M for qemu-devel@nongnu.org; Fri, 10 Jun 2011 10:08:14 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e36.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p5AE2Hli007914 for ; Fri, 10 Jun 2011 08:02:17 -0600 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id p5AE811Z066492 for ; Fri, 10 Jun 2011 08:08:02 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5AE80sx017284 for ; Fri, 10 Jun 2011 08:08:00 -0600 Message-ID: <4DF2253D.2090300@us.ibm.com> Date: Fri, 10 Jun 2011 09:07:57 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1307532813-27175-1-git-send-email-peter.maydell@linaro.org> <4DEF6B2B.7090305@siemens.com> <4DF0FCDA.5070804@siemens.com> <4DF21334.2070204@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Peter Maydell Cc: =?UTF-8?B?SnVoYSBSaWloaW3DpGtp?= , "patches@linaro.org" , Jan Kiszka , "qemu-devel@nongnu.org" , Markus Armbruster , Paul Brook On 06/10/2011 08:10 AM, Peter Maydell wrote: > On 10 June 2011 13:51, Anthony Liguori wrote: >> 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. > > Actually, devices have input and output I/O signals (GPIOs, if you like). Yes, I prefer the term Pin but since the discussion was using IRQs, I didn't want to rock the boat ;-) > A subset of these are IRQs. We already have some APIs in QEMU which > claim to be dealing with 'irq's but actually are just for wiring > up generic signals; I'd rather we didn't proliferate that terminology > confusion if possible. (And a single GPIO wire is just one kind of > thing you might want to link between two devices, obviously. MMIO is > another.) Forget about MMIO. From a device perspective, MMIO is an extremely high level concept. MMIO almost always involves some higher level interface (like PCI, ISA, etc.). That's really the interface that you want to model. Sysbus ends up being treated as a generic bus in-lieu of implementing machine specific buses (probably because they're proprietary and undocumented). That's sort of okay but we should treat that not as the parent bus of everything but as a generic bus type. >> 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] > > This makes the wiring of this signal look like a property of the > isa-serial device, which is a bit odd, since it's just as much > a property of the piix3. Actually it's neither, it's a property > of the machine model, and you might actually want a syntax a bit > more like: Think of it like a graph with directed paths. The property is the end point of the connection. But the key point is: the connections of the graph *IS* the machine model. > > piix3 = piix3(property=value, property=value...); > serial = isa-serial(property=value...); > connect(serial.irq, piix3.irq[3]); You can use a different verb but essentially, it's still: serial.irq OPERATOR piix3.irq[3] Picking a direction and using assignment is convenient syntactically. Regards, Anthony Liguori > > (in some mythical stitching language, which I think makes much > more sense than command line switches anyway.) > > -- PMM