qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix NVIC assertion failure
@ 2014-02-18 17:55 Peter Maydell
  2014-02-18 19:22 ` Christoffer Dall
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2014-02-18 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Christoffer Dall, patches

Commit 40d225009ef accidentally changed the behaviour of
gic_acknowledge_irq() for the NVIC. The NVIC doesn't have SGIs,
so this meant we hit an assertion:
  gic_acknowledge_irq: Assertion `s->sgi_pending[irq][cpu] != 0' failed.

Return NVIC acknowledge-irq to its previous behaviour, like 11MPCore.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Oops. I think I mentioned that NVIC should behave like 11MPcore
in one of the rounds of code review, but then didn't spot that
this if() had been missed. We get the checks right elsewhere.

 hw/intc/arm_gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index 93eaa6b..955b8d4 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -189,7 +189,7 @@ uint32_t gic_acknowledge_irq(GICState *s, int cpu)
     }
     s->last_active[irq][cpu] = s->running_irq[cpu];
 
-    if (s->revision == REV_11MPCORE) {
+    if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {
         /* Clear pending flags for both level and edge triggered interrupts.
          * Level triggered IRQs will be reasserted once they become inactive.
          */
-- 
1.8.5

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

* Re: [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix NVIC assertion failure
  2014-02-18 17:55 [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix NVIC assertion failure Peter Maydell
@ 2014-02-18 19:22 ` Christoffer Dall
  0 siblings, 0 replies; 2+ messages in thread
From: Christoffer Dall @ 2014-02-18 19:22 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Patch Tracking

On 18 February 2014 09:55, Peter Maydell <peter.maydell@linaro.org> wrote:
> Commit 40d225009ef accidentally changed the behaviour of
> gic_acknowledge_irq() for the NVIC. The NVIC doesn't have SGIs,
> so this meant we hit an assertion:
>   gic_acknowledge_irq: Assertion `s->sgi_pending[irq][cpu] != 0' failed.
>
> Return NVIC acknowledge-irq to its previous behaviour, like 11MPCore.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Oops. I think I mentioned that NVIC should behave like 11MPcore
> in one of the rounds of code review, but then didn't spot that
> this if() had been missed. We get the checks right elsewhere.
>

That was my bad entirely.  Sorry for missing that one.

>  hw/intc/arm_gic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
> index 93eaa6b..955b8d4 100644
> --- a/hw/intc/arm_gic.c
> +++ b/hw/intc/arm_gic.c
> @@ -189,7 +189,7 @@ uint32_t gic_acknowledge_irq(GICState *s, int cpu)
>      }
>      s->last_active[irq][cpu] = s->running_irq[cpu];
>
> -    if (s->revision == REV_11MPCORE) {
> +    if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {
>          /* Clear pending flags for both level and edge triggered interrupts.
>           * Level triggered IRQs will be reasserted once they become inactive.
>           */
> --
> 1.8.5
>

Thanks for the fix.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

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

end of thread, other threads:[~2014-02-18 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-18 17:55 [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix NVIC assertion failure Peter Maydell
2014-02-18 19:22 ` Christoffer Dall

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