arch-arm, dev-arm: MISCREG_ICC_CTLR_EL1 using AA64 banking
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 26 Aug 2019 08:55:19 +0000 (09:55 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 6 Sep 2019 20:00:34 +0000 (20:00 +0000)
Change-Id: Ib1691f1cba08251a36ceb959849b61c33cc3e93b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20626
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/miscregs.cc
src/dev/arm/gic_v3_cpu_interface.cc

index 76a991746fa7513c546907115952391276caf0af..5f45916b6b0084b620af4e83e2d0e3eabf21fc60 100644 (file)
@@ -4616,7 +4616,7 @@ ISA::initializeMiscRegMetadata()
         .secure().exceptUserMode()
         .mapsTo(MISCREG_ICC_BPR1_S);
     InitReg(MISCREG_ICC_CTLR_EL1)
-        .banked()
+        .banked64()
         .mapsTo(MISCREG_ICC_CTLR);
     InitReg(MISCREG_ICC_CTLR_EL1_NS)
         .bankedChild()
index d3d73a32f66ec68054773e103c8a2276b6b74af4..786f1abd75b33e802b54a5bcc9b022206a2e301f 100644 (file)
@@ -553,6 +553,7 @@ Gicv3CPUInterface::readMiscReg(int misc_reg)
               return readMiscReg(MISCREG_ICV_CTLR_EL1);
           }
 
+          value = readBankedMiscReg(MISCREG_ICC_CTLR_EL1);
           // Enforce value for RO bits
           // ExtRange [19], INTIDs in the range 1024..8191 not supported
           // RSS [18], SGIs with affinity level 0 values of 0-255 are supported
@@ -1132,7 +1133,7 @@ Gicv3CPUInterface::setMiscReg(int misc_reg, RegVal val)
            */
           ICC_CTLR_EL1 requested_icc_ctlr_el1 = val;
           ICC_CTLR_EL1 icc_ctlr_el1 =
-              isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1);
+              readBankedMiscReg(MISCREG_ICC_CTLR_EL1);
 
           ICC_CTLR_EL3 icc_ctlr_el3 =
               isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL3);
@@ -1190,8 +1191,8 @@ Gicv3CPUInterface::setMiscReg(int misc_reg, RegVal val)
 
           isa->setMiscRegNoEffect(MISCREG_ICC_CTLR_EL3, icc_ctlr_el3);
 
-          val = icc_ctlr_el1;
-          break;
+          setBankedMiscReg(MISCREG_ICC_CTLR_EL1, icc_ctlr_el1);
+          return;
       }
 
       // Virtual Control Register
@@ -1963,8 +1964,11 @@ Gicv3CPUInterface::isEOISplitMode() const
             isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL3);
         return icc_ctlr_el3.EOImode_EL3;
     } else {
-        ICC_CTLR_EL1 icc_ctlr_el1 =
-            isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1);
+        ICC_CTLR_EL1 icc_ctlr_el1 = 0;
+        if (inSecureState())
+            icc_ctlr_el1 = isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_S);
+        else
+            icc_ctlr_el1 = isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_NS);
         return icc_ctlr_el1.EOImode;
     }
 }