All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pl190: Fix off-by-one error in priority handling when reading VECTADDR
@ 2017-02-27  8:15 Marc Bommert
  2017-02-27 14:07 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Bommert @ 2017-02-27  8:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The "current" priority bit (1 << i) should also be set in s->prio_mask[i], if the interrupt is enabled. This will in turn cause the read operation of VECTADDR to return the correct vector of the pending interrupt.

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

diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c
index 55ea15d..0369da8 100644
--- a/hw/intc/pl190.c
+++ b/hw/intc/pl190.c
@@ -80,12 +80,12 @@ static void pl190_update_vectors(PL190State *s)
mask = 0;
for (i = 0; i < 16; i++)
{
- s->prio_mask[i] = mask;
if (s->vect_control[i] & 0x20)
{
n = s->vect_control[i] & 0x1f;
mask |= 1 << n;
}
+ s->prio_mask[i] = mask;
}
s->prio_mask[16] = mask;
pl190_update(s);
--
2.5.0

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

end of thread, other threads:[~2017-02-27 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27  8:15 [Qemu-devel] [PATCH] pl190: Fix off-by-one error in priority handling when reading VECTADDR Marc Bommert
2017-02-27 14:07 ` Peter Maydell
2017-02-27 14:35   ` Marc Bommert
2017-02-27 15:27     ` Peter Maydell
2017-02-27 16:42       ` Marc Bommert
2017-02-27 16:53         ` 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.