Skip to contentSkip to conversation

arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented

PATCH In review Peter Maydell 2 participants 3 messages Jun 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented

If EL3 is not implemented (ie only one security state) then the one and only ICC_BPR1 register behaves like the Non-secure ICC_BPR1 in an EL3-present configuration. In particular, its reset value is GIC_MIN_BPR_NS, not GIC_MIN_BPR.

Correct the erroneous reset value; this fixes a problem where we might hit the assert added in commit a89ff39ee901.

---
 hw/intc/arm_gicv3_cpuif.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
hw/intc/arm_gicv3_cpuif.c +1 -5
index 09d8ba0..5cbafaf 100644
@@ -2039,11 +2039,7 @@ static void icc_reset(CPUARMState *env, const ARMCPRegInfo *ri)
     cs->icc_pmr_el1 = 0;
     cs->icc_bpr[GICV3_G0] = GIC_MIN_BPR;
     cs->icc_bpr[GICV3_G1] = GIC_MIN_BPR;
-    if (arm_feature(env, ARM_FEATURE_EL3)) {
-        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
-    } else {
-        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR;
-    }
+    cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
     memset(cs->icc_apr, 0, sizeof(cs->icc_apr));
     memset(cs->icc_igrpen, 0, sizeof(cs->icc_igrpen));
     cs->icc_ctlr_el3 = ICC_CTLR_EL3_NDS | ICC_CTLR_EL3_A3V |
Signature · 1 line
2.7.4
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · Peter Maydell

If EL3 is not implemented (ie only one security state) then the one and only ICC_BPR1 register behaves like the Non-secure ICC_BPR1 in an EL3-present configuration. In particular, its reset value is GIC_MIN_BPR_NS, not GIC_MIN_BPR.

Correct the erroneous reset value; this fixes a problem where we might hit the assert added in commit a89ff39ee901.

Quoted 11 lines
---
 hw/intc/arm_gicv3_cpuif.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
hw/intc/arm_gicv3_cpuif.c +0 -0
index 09d8ba0..5cbafaf 100644
@@ -2039,11 +2039,7 @@ static void icc_reset(CPUARMState *env, const ARMCPRegInfo *ri)
     cs->icc_pmr_el1 = 0;
     cs->icc_bpr[GICV3_G0] = GIC_MIN_BPR;

hw/intc/arm_gicv3_cpuif.c static void icc_reset(CPUARMState *env, const ARMCPRegInfo *ri) · line 2045

Quoted 10 lines
hw/intc/arm_gicv3_cpuif.c +1 -5
     cs->icc_bpr[GICV3_G1] = GIC_MIN_BPR;
-    if (arm_feature(env, ARM_FEATURE_EL3)) {
-        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
-    } else {
-        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR;
-    }
+    cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
     memset(cs->icc_apr, 0, sizeof(cs->icc_apr));
     memset(cs->icc_igrpen, 0, sizeof(cs->icc_igrpen));
     cs->icc_ctlr_el3 = ICC_CTLR_EL3_NDS | ICC_CTLR_EL3_A3V |

--
Alex Bennée

#2 lore raw
Quoted 8 lines · Alex Bennée
Quoted 5 lines · Peter Maydell

If EL3 is not implemented (ie only one security state) then the one and only ICC_BPR1 register behaves like the Non-secure ICC_BPR1 in an EL3-present configuration. In particular, its reset value is GIC_MIN_BPR_NS, not GIC_MIN_BPR.

Quoted 8 lines
Quoted 5 lines

Correct the erroneous reset value; this fixes a problem where we might hit the assert added in commit a89ff39ee901.

Thanks; applied to master as a fix for an assertion failure (still not sure why I don't see it).

-- PMM