All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix GIC_SET_LEVEL
@ 2014-02-22  1:03 Christoffer Dall
  2014-02-23 16:32 ` Christoffer Dall
  0 siblings, 1 reply; 3+ messages in thread
From: Christoffer Dall @ 2014-02-22  1:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: rob.herring, kvmarm, Christoffer Dall

The GIC_SET_LEVEL macro unfortunately overwrote the entire level
bitmask instead of just or'ing on the necessary bits, causing active
level PPIs on a core to clear PPIs on other cores.

I introduced this bug, sorry about that.

Reported-by: Rob Herring <rob.herring@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 hw/intc/gic_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/gic_internal.h b/hw/intc/gic_internal.h
index 92a6f7a..48a58d7 100644
--- a/hw/intc/gic_internal.h
+++ b/hw/intc/gic_internal.h
@@ -40,7 +40,7 @@
 #define GIC_SET_MODEL(irq) s->irq_state[irq].model = true
 #define GIC_CLEAR_MODEL(irq) s->irq_state[irq].model = false
 #define GIC_TEST_MODEL(irq) s->irq_state[irq].model
-#define GIC_SET_LEVEL(irq, cm) s->irq_state[irq].level = (cm)
+#define GIC_SET_LEVEL(irq, cm) s->irq_state[irq].level |= (cm)
 #define GIC_CLEAR_LEVEL(irq, cm) s->irq_state[irq].level &= ~(cm)
 #define GIC_TEST_LEVEL(irq, cm) ((s->irq_state[irq].level & (cm)) != 0)
 #define GIC_SET_EDGE_TRIGGER(irq) s->irq_state[irq].edge_trigger = true
-- 
1.8.5.2

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

* Re: [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix GIC_SET_LEVEL
  2014-02-22  1:03 [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix GIC_SET_LEVEL Christoffer Dall
@ 2014-02-23 16:32 ` Christoffer Dall
  2014-02-24 15:36   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Christoffer Dall @ 2014-02-23 16:32 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Rob Herring, kvmarm, Christoffer Dall

On 21 February 2014 17:03, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> The GIC_SET_LEVEL macro unfortunately overwrote the entire level
> bitmask instead of just or'ing on the necessary bits, causing active
> level PPIs on a core to clear PPIs on other cores.
>
> I introduced this bug, sorry about that.
>
Actually it turns out this was ancient, I was a little too quick to
blame myself there.

-Christoffer

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

* Re: [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix GIC_SET_LEVEL
  2014-02-23 16:32 ` Christoffer Dall
@ 2014-02-24 15:36   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-02-24 15:36 UTC (permalink / raw)
  To: Christoffer Dall; +Cc: Rob Herring, QEMU Developers, kvmarm

On 23 February 2014 16:32, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> On 21 February 2014 17:03, Christoffer Dall <christoffer.dall@linaro.org> wrote:
>> The GIC_SET_LEVEL macro unfortunately overwrote the entire level
>> bitmask instead of just or'ing on the necessary bits, causing active
>> level PPIs on a core to clear PPIs on other cores.
>>
>> I introduced this bug, sorry about that.
>>
> Actually it turns out this was ancient, I was a little too quick to
> blame myself there.

Yes, it's been present since 2007 or so. Probably not noticed
at that time because all the 11MPcore PPIs are edge rather than
level triggered.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

I'll remove the line about it being your fault when I apply
this to target-arm.next :-)

thanks
-- PMM

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

end of thread, other threads:[~2014-02-24 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22  1:03 [Qemu-devel] [PATCH] hw/intc/arm_gic: Fix GIC_SET_LEVEL Christoffer Dall
2014-02-23 16:32 ` Christoffer Dall
2014-02-24 15:36   ` Peter Maydell

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.