]> Git Repo - qemu.git/commitdiff
hw/intc/arm_gic: Fix group priority computation for group 1 IRQs
authorLuc MICHEL <[email protected]>
Thu, 25 Jan 2018 11:45:30 +0000 (11:45 +0000)
committerPeter Maydell <[email protected]>
Thu, 25 Jan 2018 11:45:30 +0000 (11:45 +0000)
When determining the group priority of a group 1 IRQ, if C_CTRL.CBPR is
0, the non-secure BPR value is used. However, this value must be
incremented by one so that it matches the secure world number of
implemented priority bits (NS world has one less priority bit compared
to the Secure world).

Signed-off-by: Luc MICHEL <[email protected]>
Message-id: 20180119145756[email protected]
Reviewed-by: Peter Maydell <[email protected]>
[PMM: add assert, as the gicv3 code has]
Signed-off-by: Peter Maydell <[email protected]>
hw/intc/arm_gic.c

index 713de3084fedd2a699ed150dce129d8761b47477..b7989d267f4c65996632994bed28f051346a300b 100644 (file)
@@ -256,7 +256,8 @@ static int gic_get_group_priority(GICState *s, int cpu, int irq)
     if (gic_has_groups(s) &&
         !(s->cpu_ctlr[cpu] & GICC_CTLR_CBPR) &&
         GIC_TEST_GROUP(irq, (1 << cpu))) {
-        bpr = s->abpr[cpu];
+        bpr = s->abpr[cpu] - 1;
+        assert(bpr >= 0);
     } else {
         bpr = s->bpr[cpu];
     }
This page took 0.02823 seconds and 4 git commands to generate.