xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/arm: domain_builder: irq sanity check logic fix
@ 2017-11-28 14:42 Stewart Hildebrand
  2017-11-28 19:03 ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Stewart Hildebrand @ 2017-11-28 14:42 UTC (permalink / raw)
  To: xen-devel@lists.xen.org; +Cc: Julien Grall, Stefano Stabellini

It's not possible for an irq to be both below 16 and greater/equal than 32.
Also fix the reference to linux documentation while we're at it.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
---
 xen/arch/arm/domain_build.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c74f4dd..f50f8b9 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -501,9 +501,10 @@ static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq,
 {
     __be32 *cells = interrupt;
 
-    BUG_ON(irq < 16 && irq >= 32);
+    BUG_ON(irq < 16);
+    BUG_ON(irq >= 32);
 
-    /* See linux Documentation/devictree/bindings/arm/gic.txt */
+    /* See linux Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt */
     dt_set_cell(&cells, 1, 1); /* is a PPI */
     dt_set_cell(&cells, 1, irq - 16); /* PPIs start at 16 */
     dt_set_cell(&cells, 1, (cpumask << 8) | level);
-- 
2.7.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/arm: domain_builder: irq sanity check logic fix
  2017-11-28 14:42 [PATCH] xen/arm: domain_builder: irq sanity check logic fix Stewart Hildebrand
@ 2017-11-28 19:03 ` Julien Grall
  2017-11-29 11:58   ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Grall @ 2017-11-28 19:03 UTC (permalink / raw)
  To: Stewart Hildebrand, xen-devel@lists.xen.org
  Cc: Julien Grall, Stefano Stabellini

Hi Stewart,

On 11/28/2017 02:42 PM, Stewart Hildebrand wrote:
> It's not possible for an irq to be both below 16 and greater/equal than 32.
> Also fix the reference to linux documentation while we're at it.
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>

Whoops. Well spotted!

Reviewed-by: Julien Grall <julien.grall@linaro.org>

Also, I think it would be good to get the patch merge in Xen 4.10. It is 
boot code and low risk. So:

Release-acked-by: Julien Grall <julien.grall@linaro.org>

Cheers,

> ---
>   xen/arch/arm/domain_build.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index c74f4dd..f50f8b9 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -501,9 +501,10 @@ static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq,
>   {
>       __be32 *cells = interrupt;
>   
> -    BUG_ON(irq < 16 && irq >= 32);
> +    BUG_ON(irq < 16);
> +    BUG_ON(irq >= 32);
>   
> -    /* See linux Documentation/devictree/bindings/arm/gic.txt */
> +    /* See linux Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt */
>       dt_set_cell(&cells, 1, 1); /* is a PPI */
>       dt_set_cell(&cells, 1, irq - 16); /* PPIs start at 16 */
>       dt_set_cell(&cells, 1, (cpumask << 8) | level);
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/arm: domain_builder: irq sanity check logic fix
  2017-11-28 19:03 ` Julien Grall
@ 2017-11-29 11:58   ` Julien Grall
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Grall @ 2017-11-29 11:58 UTC (permalink / raw)
  To: Stewart Hildebrand, xen-devel@lists.xen.org
  Cc: Julien Grall, Stefano Stabellini

On 11/28/2017 07:03 PM, Julien Grall wrote:
> Hi Stewart,

Hi,

> On 11/28/2017 02:42 PM, Stewart Hildebrand wrote:
>> It's not possible for an irq to be both below 16 and greater/equal 
>> than 32.
>> Also fix the reference to linux documentation while we're at it.
>>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
> 
> Whoops. Well spotted!
> 
> Reviewed-by: Julien Grall <julien.grall@linaro.org>
> 
> Also, I think it would be good to get the patch merge in Xen 4.10. It is 
> boot code and low risk. So:

Sadly this patch break boot on all ARM platform. Looking at the code, 
there is one caller which use ~0 for the IRQ.

This is to create a placeholder property for the event channel IRQ. The 
property is then replaced inplace. I think it would be possible to defer 
the creation of the property until we find the event channel IRQ. This 
would avoid the placeholder.

I will try to send a patch soon, though it will target Xen 4.11. So even 
if the patch was valid, I asked to revert it. Sorry for that.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-29 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28 14:42 [PATCH] xen/arm: domain_builder: irq sanity check logic fix Stewart Hildebrand
2017-11-28 19:03 ` Julien Grall
2017-11-29 11:58   ` Julien Grall

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).