arch-arm: SVE instruction in EL1s cannot be trapped to EL2
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 1 May 2020 14:13:01 +0000 (15:13 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Sat, 9 May 2020 21:35:44 +0000 (21:35 +0000)
haveVirtualization() is not a valid check on its own:
We need to check if EL2 trapping is currently supported and this
can only happen if we are in NS state or if SecEL2 is implemented

Change-Id: Ie2312caba1ac0f186a2a3305c55a23c7705ba3fd
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/+/28769
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/insts/static_inst.cc

index 9ece0e6d29f919dcdd76909d02df95d926cb3f57..70e5fb95270ec2747acdf0d84cf617de7f6d7d90 100644 (file)
@@ -999,7 +999,7 @@ ArmStaticInst::checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
     }
 
     // Check if access disabled in CPTR_EL2
-    if (ArmSystem::haveVirtualization(tc) && el <= EL2) {
+    if (el <= EL2 && EL2Enabled(tc)) {
         CPTR cptr_en_check = tc->readMiscReg(MISCREG_CPTR_EL2);
         if (cptr_en_check.tz)
             return sveAccessTrap(EL2);