arch-arm: Remove checkSveTrap method
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 1 May 2020 12:55:51 +0000 (13:55 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Sat, 9 May 2020 21:35:44 +0000 (21:35 +0000)
This is not part of the arm arm pseudocode and prevents a proper
fix of the checkSveEnabled

Change-Id: I075749095316e59e395d5b84a23db4309bdd7a92
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28767
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/insts/static_inst.cc
src/arch/arm/insts/static_inst.hh

index b84aa810b097caabf34b995c33c06476a8b30b70..6da8b770e1aa2f5718791071e8a69b5cc2ee4ff7 100644 (file)
@@ -984,37 +984,28 @@ ArmStaticInst::sveAccessTrap(ExceptionLevel el) const
 }
 
 Fault
-ArmStaticInst::checkSveTrap(ThreadContext *tc, CPSR cpsr) const
+ArmStaticInst::checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
 {
     const ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsr.el;
+    if ((el == EL0 && cpacr.zen != 0x3) ||
+        (el == EL1 && !(cpacr.zen & 0x1)))
+        return sveAccessTrap(EL1);
 
     if (ArmSystem::haveVirtualization(tc) && el <= EL2) {
-        CPTR cptrEnCheck = tc->readMiscReg(MISCREG_CPTR_EL2);
-        if (cptrEnCheck.tz)
+        CPTR cptr_en_check = tc->readMiscReg(MISCREG_CPTR_EL2);
+        if (cptr_en_check.tz)
             return sveAccessTrap(EL2);
     }
 
     if (ArmSystem::haveSecurity(tc)) {
-        CPTR cptrEnCheck = tc->readMiscReg(MISCREG_CPTR_EL3);
-        if (!cptrEnCheck.ez)
+        CPTR cptr_en_check = tc->readMiscReg(MISCREG_CPTR_EL3);
+        if (!cptr_en_check.ez)
             return sveAccessTrap(EL3);
     }
 
     return NoFault;
 }
 
-Fault
-ArmStaticInst::checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
-{
-    const ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsr.el;
-    if ((el == EL0 && cpacr.zen != 0x3) ||
-        (el == EL1 && !(cpacr.zen & 0x1)))
-        return sveAccessTrap(EL1);
-
-    return checkSveTrap(tc, cpsr);
-}
-
-
 static uint8_t
 getRestoredITBits(ThreadContext *tc, CPSR spsr)
 {
index ce6569a7a0b5fa419d13145b1bbcc23d536ff17a..bee39036b4a648e1a130abeee9d07745e8393d5a 100644 (file)
@@ -475,11 +475,6 @@ class ArmStaticInst : public StaticInst
      */
     Fault sveAccessTrap(ExceptionLevel el) const;
 
-    /**
-     * Check an SVE access against CPTR_EL2 and CPTR_EL3.
-     */
-    Fault checkSveTrap(ThreadContext *tc, CPSR cpsr) const;
-
     /**
      * Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
      */