From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
patches@linaro.org, tim@xen.org, stefano.stabellini@citrix.com,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-4.5 7/8] xen/irq: Handle multiple action per IRQ
Date: Mon, 17 Mar 2014 21:05:13 +0000 [thread overview]
Message-ID: <53276389.8080109@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1403171904190.30819@kaball.uk.xensource.com>
Hi Stefano,
On 17/03/14 19:06, Stefano Stabellini wrote:
> On Tue, 11 Mar 2014, Jan Beulich wrote:
>>>>> On 11.03.14 at 16:16, Julien Grall <julien.grall@linaro.org> wrote:
>>> Hello Jan,
>>>
>>> On 02/24/2014 02:48 PM, Julien Grall wrote:
>>>> On 02/24/2014 02:32 PM, Jan Beulich wrote:
>>>>>>>> On 24.02.14 at 15:08, Julien Grall <julien.grall@citrix.com> wrote:
>>>>>> (Adding Jan for x86 part).
>>>>>>
>>>>>> On 02/20/2014 09:29 PM, Julien Grall wrote:
>>>>>>> Hi Ian,
>>>>>>>
>>>>>>> On 02/19/2014 11:55 AM, Ian Campbell wrote:
>>>>>>>> On Fri, 2014-01-24 at 16:43 +0000, Julien Grall wrote:
>>>>>>>>> On ARM, it may happen (eg ARM SMMU) to setup multiple handler for the same
>>>>>>>>> interrupt.
>>>>>>>>
>>>>>>>> Mention here that you are therefore creating a linked list of actions
>>>>>>>> for each interrupt.
>>>>>>>>
>>>>>>>> If you use xen/list.h for this then you get a load of helpers and
>>>>>>>> iterators which would save you open coding them.
>>>>>>>
>>>>>>> After thinking, using xen/list.h won't really remove open code, except
>>>>>>> removing "action_ptr" in release_dt_irq.
>>>>>>>
>>>>>>> Calling release_dt_irq to an IRQ with multiple action shouldn't be
>>>>>>> called often. Therefore, having both prev and next is a waste of space.
>>>>>>
>>>>>> Jan, as it's common code, do you have any thoughts?
>>>>>
>>>>> In fact I'm not convinced this action chaining is correct in the first
>>>>> place, as mentioned by Ian too (considering the potential sharing
>>>>> between hypervisor and guest). Furthermore, if this is really just
>>>>> about IOMMU handlers, why can't the SMMU code register a single
>>>>> action and disambiguate by the dev_id argument passed to the
>>>>> handler?
>>>>
>>>> The patch #3 of this serie protects the IRQ to be shared with the domain.
>>>>
>>>> I should have remove "eg ARM SMMU" in the description. ARM SMMU is not
>>>> the only the case, we don't know in advance if the IRQ will be shared
>>>> (except browsing the DT and checking if this IRQ was used by another
>>>> devices...). We may have the same thing with other devices.
>>
>>>> The logic is painful to handle internally in ARM SMMU driver while we
>>>> can handle it generically. No need to duplicate the code when a new
>>>> driver will have the same problem.
>>>
>>> I haven't heard any answer from you. Shall I take as a "go"?
>>
>> I'm sorry, this got lost between other stuff. Honestly I'm still not
>> convinced generic multi-action IRQ support is indeed useful.
>
> I agree.
> In general if an IRQ is shared among multiple devices, it is likely to
> go to Dom0 and have a single action from Xen point of view.
> An IRQ shared between Xen and a guest is a very bad idea.
I guess you agree with Jan, rigth? If so, I think you misunderstood the
goal of this patch. This patch does *NOT* add support for IRQ sharing
between domains and Xen (patch #3 is preventing that).
Some devices are describing a same interrupt twice in the device tree
and the action is not the same to accomplish.
For instance for the SMMU on midway, the device tree bindings is:
smmu_sata: smmu@9,20180000 {
compatible = "arm,mmu-400";
reg = <0x9 0x20180000 0x10000>;
mmu-masters = <&sata 0 1 2 3 4 5 6 7 8 9>;
#global-interrupts = <1>;
interrupts = <0 114 4 0 114 4>;
calxeda,smmu-secure-config-access;
arm,smmu-isolate-devices;
};
As you can see the same interrupts is used twice: the first one is used
for the global interrupt and the second one as context interrupt. For
the latter, each time a new context bank is created (e.g a device is
passthrough to IOMMU), we need to register another handler.
Now we have 2 solutions to implement it:
1) Implement it directly in the SMMU drivers => We are assuming we
wouldn't this situation on another IOMMU drivers
2) Implement it generically
The former one is complicated to implement, because it's not fixed if
the IRQ will be described twice or not. We can take advantage of the
generic code for this purpose.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-03-17 21:05 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-24 16:43 [PATCH for-4.5 0/8] Interrupt management reworking Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 1/8] xen/arm: irq: move gic {, un}lock in gic_set_irq_properties Julien Grall
2014-02-19 11:23 ` Ian Campbell
2014-02-19 13:38 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 2/8] xen/arm: setup_dt_irq: don't enable the IRQ if the creation has failed Julien Grall
2014-02-19 11:24 ` Ian Campbell
2014-03-12 14:48 ` Ian Campbell
2014-01-24 16:43 ` [PATCH for-4.5 3/8] xen/arm: IRQ: Protect IRQ to be shared between domains and XEN Julien Grall
2014-02-19 11:35 ` Ian Campbell
2014-02-19 13:59 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 4/8] xen/arm: irq: Don't need to have a specific function to route IRQ to Xen Julien Grall
2014-02-19 11:45 ` Ian Campbell
2014-02-19 14:16 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 5/8] xen/arm: IRQ: rename release_irq in release_dt_irq Julien Grall
2014-02-19 11:47 ` Ian Campbell
2014-02-19 14:23 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 6/8] xen/arm: IRQ: Add lock contrainst for gic_irq_{startup, shutdown} Julien Grall
2014-02-19 11:51 ` Ian Campbell
2014-02-19 14:35 ` Julien Grall
2014-02-19 14:38 ` Ian Campbell
2014-02-19 14:51 ` Julien Grall
2014-02-19 15:07 ` Jan Beulich
2014-02-19 17:26 ` Julien Grall
2014-02-20 20:48 ` Julien Grall
2014-02-21 8:55 ` Jan Beulich
2014-02-21 13:19 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 7/8] xen/irq: Handle multiple action per IRQ Julien Grall
2014-02-19 11:55 ` Ian Campbell
2014-02-19 14:41 ` Julien Grall
2014-02-20 21:29 ` Julien Grall
2014-02-24 14:08 ` Julien Grall
2014-02-24 14:12 ` Ian Campbell
2014-02-24 14:32 ` Jan Beulich
2014-02-24 14:48 ` Julien Grall
2014-03-11 15:16 ` Julien Grall
2014-03-11 16:08 ` Jan Beulich
2014-03-17 19:06 ` Stefano Stabellini
2014-03-17 21:05 ` Julien Grall [this message]
2014-03-18 9:33 ` Ian Campbell
2014-03-18 12:26 ` Julien Grall
2014-03-18 14:06 ` Stefano Stabellini
2014-03-18 14:54 ` Julien Grall
2014-03-18 15:01 ` Stefano Stabellini
2014-03-18 15:21 ` Julien Grall
2014-03-18 15:39 ` Stefano Stabellini
2014-03-18 15:55 ` Julien Grall
2014-03-18 15:02 ` Ian Campbell
2014-03-18 15:08 ` Julien Grall
2014-03-18 15:10 ` Ian Campbell
2014-03-18 15:12 ` Julien Grall
2014-03-18 15:26 ` Ian Campbell
2014-03-19 17:18 ` Julien Grall
2014-03-21 14:06 ` Ian Campbell
2014-03-31 15:45 ` Julien Grall
2014-03-31 15:53 ` Ian Campbell
2014-03-31 16:02 ` Julien Grall
2014-04-01 12:29 ` Ian Campbell
2014-04-01 13:13 ` Julien Grall
2014-04-01 13:23 ` Ian Campbell
2014-04-01 13:52 ` Julien Grall
2014-04-01 14:31 ` Ian Campbell
2014-04-02 14:01 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 8/8] xen/serial: remove serial_dt_irq Julien Grall
2014-02-19 11:55 ` Ian Campbell
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=53276389.8080109@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=patches@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).