From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, tim@xen.org,
stefano.stabellini@citrix.com
Subject: Re: [PATCH v3 2/2] xen/dt: Allow only IRQ translation that are mapped to main GIC
Date: Wed, 16 Jul 2014 15:28:36 +0100 [thread overview]
Message-ID: <53C68C14.6000702@linaro.org> (raw)
In-Reply-To: <1405516449.15219.7.camel@kazak.uk.xensource.com>
On 16/07/14 14:14, Ian Campbell wrote:
> On Wed, 2014-07-09 at 14:23 +0100, Julien Grall wrote:
>> Xen is only able to handle one GIC controller. Some platform may contain
>> other interrupt controller.
>>
>> Make sure to only translate IRQ mapped into the GIC handled by Xen.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>
>> ---
>> Changes in v3:
>> - Add an ASSERT to check that dt_interrupt_controller is not
>> NULL.
>>
>> Changes in v2:
>> - Fix compilation...
>> ---
>> xen/common/device_tree.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
>> index 310635e..cc45bd1 100644
>> --- a/xen/common/device_tree.c
>> +++ b/xen/common/device_tree.c
>> @@ -1442,9 +1442,12 @@ int dt_irq_translate(const struct dt_raw_irq *raw,
>> struct dt_irq *out_irq)
>> {
>> ASSERT(dt_irq_xlate != NULL);
>> + ASSERT(dt_interrupt_controller != NULL);
>>
>> - /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
>> + if ( raw->controller != dt_interrupt_controller )
>> + return -EINVAL;
>>
>> + /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
>
> "This only works for ...".
>
> Do you mean it to say "primary gic"? In which case I think it was in the
> correct location before (i.e. before the check which enforced that).
Which location are you talking about? The one in map_device?
If so, it doesn't protect anything, but only avoid to assign an IRQ to
DOM0 which is not routed to the primary interrupt controller.
Checking the controller in the location will prevent platform_get_irq to
translate IRQ not handled by the gic controller. Futhermore, it will
avoid the new hypercall to list interrupt for a specific device node
returning an invalid IRQ number.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-07-16 14:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 13:23 [PATCH v3 1/2] xen/arm: Divide GIC initialization in 2 parts Julien Grall
2014-07-09 13:23 ` [PATCH v3 2/2] xen/dt: Allow only IRQ translation that are mapped to main GIC Julien Grall
2014-07-16 13:14 ` Ian Campbell
2014-07-16 14:28 ` Julien Grall [this message]
2014-07-16 14:34 ` Ian Campbell
2014-07-16 14:36 ` Julien Grall
2014-07-16 13:10 ` [PATCH v3 1/2] xen/arm: Divide GIC initialization in 2 parts Ian Campbell
2014-07-16 14:22 ` Julien Grall
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=53C68C14.6000702@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=stefano.stabellini@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 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.