From: Eric Auger <eric.auger@linaro.org>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: eric.auger@st.com, Patch Tracking <patches@linaro.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Alex Williamson <alex.williamson@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [Qemu-devel] [PATCH v2] sysbus: add irq_routing_notifier
Date: Mon, 27 Apr 2015 10:26:18 +0200 [thread overview]
Message-ID: <553DF2AA.2070102@linaro.org> (raw)
In-Reply-To: <CAEgOgz5rBLZD1U0iodZvytb_RYjH7a04attgZxZ-WbuFOkPxpA@mail.gmail.com>
Hi Peter,
On 04/27/2015 06:09 AM, Peter Crosthwaite wrote:
> On Fri, Apr 24, 2015 at 5:39 AM, Eric Auger <eric.auger@linaro.org> wrote:
>> Add a new irq_routing_notifier notifier in the SysBusDeviceClass. This
>> notifier, if populated, is called after sysbus_connect_irq.
>>
>> This mechanism is used to setup VFIO signaling once VFIO platform
>> devices get attached to their platform bus, on a machine init done
>> notifier.
>>
>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>>
>> ---
>>
>> v1 -> v2:
>> - duly put the notifier in the class and not in the device
>> ---
>> hw/core/sysbus.c | 6 ++++++
>> include/hw/sysbus.h | 1 +
>> 2 files changed, 7 insertions(+)
>>
>> diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
>> index b53c351..8553a6f 100644
>> --- a/hw/core/sysbus.c
>> +++ b/hw/core/sysbus.c
>> @@ -109,7 +109,13 @@ qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n)
>>
>> void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq)
>> {
>> + SysBusDeviceClass *sbd = SYS_BUS_DEVICE_GET_CLASS(dev);
>> +
>> qdev_connect_gpio_out_named(DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ, n, irq);
>
> One of my long term goals is to try and get rid of sysbus IRQ
> abstraction completely in favor of just qdev gpios. This means
> features that apply to GPIOs automatically apply to IRQs and vice
> versa. Can your notifier hook be pushed up to the qdev GPIO level to
> make it more globally usable and avoid a new feature to sysbus IRQs?
Yes sure, I am going to put the notifier in DeviceClass then.
>
>> +
>> + if (sbd->irq_routing_notifier) {
>> + sbd->irq_routing_notifier(dev, irq);
>> + }
>> }
>>
>> /* Check whether an MMIO region exists */
>> diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
>> index d1f3f00..dbf3f0f 100644
>> --- a/include/hw/sysbus.h
>> +++ b/include/hw/sysbus.h
>> @@ -41,6 +41,7 @@ typedef struct SysBusDeviceClass {
>> /*< public >*/
>>
>> int (*init)(SysBusDevice *dev);
>> + void (*irq_routing_notifier)(SysBusDevice *dev, qemu_irq irq);
>
> Is it better to make the name more matched to sysbus_connect_irq?
> Perhaps connect_irq_notifier. But with the qdev approach this would be
> connect_gpio_out_notifier or something along those lines.
OK for that naming
Thanks
Eric
>
> Regards,
> Peter
>
>> } SysBusDeviceClass;
>>
>> struct SysBusDevice {
>> --
>> 1.8.3.2
>>
>>
WARNING: multiple messages have this Message-ID (diff)
From: Eric Auger <eric.auger@linaro.org>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
eric.auger@st.com, Patch Tracking <patches@linaro.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>,
Alex Williamson <alex.williamson@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v2] sysbus: add irq_routing_notifier
Date: Mon, 27 Apr 2015 10:26:18 +0200 [thread overview]
Message-ID: <553DF2AA.2070102@linaro.org> (raw)
In-Reply-To: <CAEgOgz5rBLZD1U0iodZvytb_RYjH7a04attgZxZ-WbuFOkPxpA@mail.gmail.com>
Hi Peter,
On 04/27/2015 06:09 AM, Peter Crosthwaite wrote:
> On Fri, Apr 24, 2015 at 5:39 AM, Eric Auger <eric.auger@linaro.org> wrote:
>> Add a new irq_routing_notifier notifier in the SysBusDeviceClass. This
>> notifier, if populated, is called after sysbus_connect_irq.
>>
>> This mechanism is used to setup VFIO signaling once VFIO platform
>> devices get attached to their platform bus, on a machine init done
>> notifier.
>>
>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>>
>> ---
>>
>> v1 -> v2:
>> - duly put the notifier in the class and not in the device
>> ---
>> hw/core/sysbus.c | 6 ++++++
>> include/hw/sysbus.h | 1 +
>> 2 files changed, 7 insertions(+)
>>
>> diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
>> index b53c351..8553a6f 100644
>> --- a/hw/core/sysbus.c
>> +++ b/hw/core/sysbus.c
>> @@ -109,7 +109,13 @@ qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n)
>>
>> void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq)
>> {
>> + SysBusDeviceClass *sbd = SYS_BUS_DEVICE_GET_CLASS(dev);
>> +
>> qdev_connect_gpio_out_named(DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ, n, irq);
>
> One of my long term goals is to try and get rid of sysbus IRQ
> abstraction completely in favor of just qdev gpios. This means
> features that apply to GPIOs automatically apply to IRQs and vice
> versa. Can your notifier hook be pushed up to the qdev GPIO level to
> make it more globally usable and avoid a new feature to sysbus IRQs?
Yes sure, I am going to put the notifier in DeviceClass then.
>
>> +
>> + if (sbd->irq_routing_notifier) {
>> + sbd->irq_routing_notifier(dev, irq);
>> + }
>> }
>>
>> /* Check whether an MMIO region exists */
>> diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
>> index d1f3f00..dbf3f0f 100644
>> --- a/include/hw/sysbus.h
>> +++ b/include/hw/sysbus.h
>> @@ -41,6 +41,7 @@ typedef struct SysBusDeviceClass {
>> /*< public >*/
>>
>> int (*init)(SysBusDevice *dev);
>> + void (*irq_routing_notifier)(SysBusDevice *dev, qemu_irq irq);
>
> Is it better to make the name more matched to sysbus_connect_irq?
> Perhaps connect_irq_notifier. But with the qdev approach this would be
> connect_gpio_out_notifier or something along those lines.
OK for that naming
Thanks
Eric
>
> Regards,
> Peter
>
>> } SysBusDeviceClass;
>>
>> struct SysBusDevice {
>> --
>> 1.8.3.2
>>
>>
next prev parent reply other threads:[~2015-04-27 8:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 12:39 [PATCH v2] sysbus: add irq_routing_notifier Eric Auger
2015-04-24 12:39 ` [Qemu-devel] " Eric Auger
2015-04-27 4:09 ` Peter Crosthwaite
2015-04-27 4:09 ` Peter Crosthwaite
2015-04-27 8:26 ` Eric Auger [this message]
2015-04-27 8:26 ` Eric Auger
2015-04-27 10:39 ` Paolo Bonzini
2015-04-27 12:20 ` Eric Auger
2015-04-27 12:20 ` [Qemu-devel] " Eric Auger
2015-04-27 13:37 ` Paolo Bonzini
2015-04-27 14:39 ` Peter Crosthwaite
2015-04-27 14:39 ` Peter Crosthwaite
2015-04-27 14:56 ` Eric Auger
2015-04-27 15:01 ` Paolo Bonzini
2015-04-27 17:43 ` Peter Crosthwaite
2015-04-27 17:43 ` [Qemu-devel] " Peter Crosthwaite
2015-04-28 6:46 ` Eric Auger
2015-04-28 6:57 ` Peter Crosthwaite
2015-04-28 7:01 ` Eric Auger
2015-04-28 9:04 ` Paolo Bonzini
2015-04-28 9:04 ` [Qemu-devel] " Paolo Bonzini
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=553DF2AA.2070102@linaro.org \
--to=eric.auger@linaro.org \
--cc=alex.williamson@redhat.com \
--cc=eric.auger@st.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.