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