public inbox for kvmarm@lists.cs.columbia.edu
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Patch Tracking <patches@linaro.org>,
	eric.auger@st.com,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] sysbus: add irq_routing_notifier
Date: Mon, 27 Apr 2015 16:56:05 +0200	[thread overview]
Message-ID: <553E4E05.1010405@linaro.org> (raw)
In-Reply-To: <CAEgOgz6eFLhkwm7qto=j=p3L5+cz5s_McUyZUcqeN265CgXSdg@mail.gmail.com>

On 04/27/2015 04:39 PM, Peter Crosthwaite wrote:
> On Mon, Apr 27, 2015 at 6:37 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 27/04/2015 14:20, Eric Auger wrote:
>>> On 04/27/2015 12:39 PM, Paolo Bonzini wrote:
>>>>
>>>>
>>>> On 27/04/2015 10:26, Eric Auger wrote:
>>>>>>> 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.
>>>>
>>>> I've thought too about this, and I'm not sure about it.
>>>>
>>>> It would mean you have to pass the gpio name (e.g.
>>>> SYSBUS_DEVICE_GPIO_IRQ) to the hook, and in the case of sysbus IRQs this
>>>> would leak the SYSBUS_DEVICE_GPIO_IRQ abstraction to the implementors of
>>>> the hook.
> 
> That's OK IMO. SYSBUS_DEVICE_GPIO_IRQ was never intended to be
> private. The semantics of it are something like "If you don't have
> anything better to name your IRQ pin use this".
> 
> This adds the requirement on machine level code that you can't
> consistently use sysbus_connect_irq for intc connection. But machines
> should be able to connect any wires between any cores without having
> to special case interrupts or chip-selects, resets or whatever. So the
> name of the GPIO has to be exposed to the callback hook registration
> if we want to break down this GPIO special casing. Names of interrupt
> pins are system-level knowledge so I think this is all OK.
> 
>>> Hi Paolo,
>>>
>>> Currently my notifier has the following proto:
>>>     void (*connect_gpio_out_notifier)(DeviceState *dev, qemu_irq irq);
>>>
>>> It is sufficient for my need.
>>>
>>> is it really mandated to pass other qdev_connect_gpio_out_named args,
>>> ie. name & n?
>>
>> It's an ugly situation.  If you look at qdev_connect_gpio_out_named, it
>> is really a thin wrapper around object_property_set_link.  Just like
>> Peter wasn't too happy with changing sysbus_connect_irq, the same
>> objection would apply here.  Callers of object_property_set_link should
>> call the notifiers, not just those that use qdev_connect_gpio_out_named.
>>
>> This is why I originally asked you to look into using the check callback
>> instead.
>>
> 
> Is this still feasible? Pushing it up to the higher again to the QOM
> level? I think this would be an ideal backend to the problem even if
> we still go with a code-friendly sysbus frontend.

Peter, Paolo,

After your feedbacks, I feel I need to spend some more time on the
original check() track. I would prefer not to introduce any patch that
will make issue in the future.

Thanks

Eric

> 
> Regards,
> Peter
> 
>> This is why I think it's better to keep the sysbus patch.
>>
>> Paolo
>>

  reply	other threads:[~2015-04-27 14:50 UTC|newest]

Thread overview: 14+ 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-27  4:09 ` [Qemu-devel] " Peter Crosthwaite
2015-04-27  8:26   ` Eric Auger
2015-04-27 10:39     ` Paolo Bonzini
2015-04-27 12:20       ` Eric Auger
2015-04-27 13:37         ` [Qemu-devel] " Paolo Bonzini
2015-04-27 14:39           ` Peter Crosthwaite
2015-04-27 14:56             ` Eric Auger [this message]
2015-04-27 15:01               ` Paolo Bonzini
2015-04-27 17:43                 ` Peter Crosthwaite
2015-04-28  6:46                   ` [Qemu-devel] " Eric Auger
2015-04-28  6:57                     ` Peter Crosthwaite
2015-04-28  7:01                       ` Eric Auger
2015-04-28  9:04                   ` 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=553E4E05.1010405@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox