arch-arm: updateMiscReg not setting isHyp in aarch64
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 1 Apr 2019 13:38:14 +0000 (14:38 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 26 Apr 2019 16:13:04 +0000 (16:13 +0000)
The isHyp flag should be set for a TLB::NormalTran when in EL2.  This
was happening in aarch32 only, where the CPSR mode is checked, while
aarch64 was only using it for explicit EL2 translations, like for AT
instructions.

Change-Id: I54605811e9dde75b5cf8868190b0f4c2a8d46570
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18394
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/tlb.cc

index e54eb25d624b9f131cc9e03d58cfdfc18cb4e5f0..4b43a50a4436544d8d1373adf3ba2147a199abcf 100644 (file)
@@ -1308,7 +1308,8 @@ TLB::updateMiscReg(ThreadContext *tc, ArmTranslationType tranType)
         isPriv = aarch64EL != EL0;
         if (haveVirtualization) {
             vmid           = bits(tc->readMiscReg(MISCREG_VTTBR_EL2), 55, 48);
-            isHyp  =  tranType & HypMode;
+            isHyp = aarch64EL == EL2;
+            isHyp |= tranType & HypMode;
             isHyp &= (tranType & S1S2NsTran) == 0;
             isHyp &= (tranType & S1CTran)    == 0;
             // Work out if we should skip the first stage of translation and go