qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Juha Riihimäki" <juha.riihimaki@nokia.com>,
	"patches@linaro.org" <patches@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Paul Brook" <paul@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH RFC 0/3] basic support for composing sysbus devices
Date: Fri, 10 Jun 2011 16:18:56 +0200	[thread overview]
Message-ID: <4DF227D0.6000505@siemens.com> (raw)
In-Reply-To: <4DF2264C.6080609@us.ibm.com>

On 2011-06-10 16:12, Anthony Liguori wrote:
> On 06/10/2011 08:43 AM, Jan Kiszka wrote:
>> On 2011-06-10 15:10, Peter Maydell wrote:
>>> On 10 June 2011 13:51, Anthony Liguori<aliguori@us.ibm.com>  wrote:
>>>> On 06/10/2011 03:13 AM, Markus Armbruster wrote:
>>>>>
>>>>> Jan Kiszka<jan.kiszka@siemens.com>   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.
>>
>> Generally true. Two exceptions still require to make the path explorable
>> / transfer information in the reverse direction: IRQ de-coalescing and
>> physical device assignment. That's something a new generic API should
>> encapsulate so that we can stop peaking into the machine details.
>>
>>>>
>>>> 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).
>>> 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.)
>>>
>>>> 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:
>>>
>>>   piix3 = piix3(property=value, property=value...);
>>>   serial = isa-serial(property=value...);
>>>   connect(serial.irq, piix3.irq[3]);
>>
>> In fact, in the ISA case, it is a device property: The device, and only
>> the device decides which IRQ to use - from the bus it is attached to. So
>> attaching an ISA device to the bus of an ISA bridge like the PIIX3 and
>> selecting local IRQ 3 are the steps we can already express today.
> 
> If you really want to be pedantic, each ISA device has 5 input Pins that 
> are supposed to correspond to IRQ 3, IRQ 4, IRQ 5, IRQ 6, and IRQ 7.
> 
> This could easily be modelled by doing the following:
> 
>   -device piix3,id=piix3 -device 
> isa-serial,id=serial,irq[3]=piix3.irq[3],irq[4]=piix3.irq[4],...
> 
> But I don't think we benefit from modelling it this correctly.  The 
> point is that the infrastructure could handle it though.

I don't see the point of 'piix3.' in your IRQ assignment, though. It is
redundant to the bus assignment - as the ISA bus also routes interrupts.
There are surely also buses that don't. Still, interrupt routing via the
bus should be possible (as it avoids boilerplate code or configuration
redundancy).

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-06-10 14:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08 11:33 [Qemu-devel] [PATCH RFC 0/3] basic support for composing sysbus devices Peter Maydell
2011-06-08 11:33 ` [Qemu-devel] [PATCH RFC 1/3] sysbus: Add support for resizing and unmapping MMIOs Peter Maydell
2011-06-08 11:33 ` [Qemu-devel] [PATCH RFC 2/3] sysbus: Allow sysbus MMIO passthrough Peter Maydell
2011-06-08 11:33 ` [Qemu-devel] [PATCH RFC 3/3] sysbus: Allow passthrough of single IRQ Peter Maydell
2011-06-08 12:29 ` [Qemu-devel] [PATCH RFC 0/3] basic support for composing sysbus devices Jan Kiszka
2011-06-09 16:40   ` Markus Armbruster
2011-06-09 17:03     ` Jan Kiszka
2011-06-10  8:13       ` Markus Armbruster
2011-06-10 12:51         ` Anthony Liguori
2011-06-10 13:10           ` Peter Maydell
2011-06-10 13:43             ` Jan Kiszka
2011-06-10 13:50               ` Peter Maydell
2011-06-10 14:22                 ` Markus Armbruster
2011-06-10 14:45                   ` Anthony Liguori
2011-06-10 14:34                 ` Anthony Liguori
2011-06-10 14:12               ` Anthony Liguori
2011-06-10 14:18                 ` Jan Kiszka [this message]
2011-06-10 14:31                   ` Anthony Liguori
2011-06-10 14:07             ` Anthony Liguori
2011-06-10 14:59           ` Markus Armbruster
2011-06-10 15:43             ` Anthony Liguori
2011-06-12 17:12               ` Avi Kivity
2011-06-12 19:21                 ` Anthony Liguori
2011-06-13  8:05                   ` Avi Kivity
2011-06-13 17:53                     ` Anthony Liguori
2011-06-13 20:59                   ` Blue Swirl
2011-06-14 13:21                     ` Anthony Liguori
2011-06-15 18:56                       ` Blue Swirl
2011-06-15 20:00                         ` Anthony Liguori
2011-06-15 20:20                           ` Blue Swirl
2011-06-20 15:23                             ` Paul Brook
2011-06-20 21:32                               ` Blue Swirl
2011-06-21  8:16                                 ` Avi Kivity
2011-06-27  2:26                                 ` Paul Brook
2011-06-13  9:57             ` Gleb Natapov
2011-06-10 16:28           ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DF227D0.6000505@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=juha.riihimaki@nokia.com \
    --cc=patches@linaro.org \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).