arch-arm: CPTR_EL3.TCPAC traps EL2 accesses to CPACR_EL1
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 23 Oct 2018 15:23:27 +0000 (16:23 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 26 Oct 2018 09:45:47 +0000 (09:45 +0000)
According to the arm arm, CPTR_EL3.TCPAC traps EL2 accesses to the
CPTR_EL2 or HCPTR, and EL2 and EL1 accesses to the CPACR_EL1 or CPACR,
are trapped to EL3, unless they are trapped by CPTR_EL2.TCPAC.

Change-Id: I637be35b29db39f044dda0c6cc4fe986c9620371
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/13775
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/arch/arm/utility.cc

index e642250d8f0862f299e40852da3376c1731191b3..0494c20d2d272b66cb4feea48b3bbb684294c74c 100644 (file)
@@ -792,7 +792,7 @@ msrMrs64TrapToMon(const MiscRegIndex miscReg, CPTR cptr /* CPTR_EL3 */,
         break;
       // CPACR, CPTR
       case MISCREG_CPACR_EL1:
-        if (el == EL1) {
+        if (el == EL1 || el == EL2) {
            trapToMon = cptr.tcpac;
         }
         break;