From: Giacomo Travaglini Date: Fri, 1 May 2020 14:13:01 +0000 (+0100) Subject: arch-arm: SVE instruction in EL1s cannot be trapped to EL2 X-Git-Tag: v20.1.0.0~650 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f9cc04a5f9e2a13e93c57270226f3a83120e408;p=gem5.git arch-arm: SVE instruction in EL1s cannot be trapped to EL2 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 Reviewed-by: Ciro Santilli Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28769 Tested-by: kokoro --- diff --git a/src/arch/arm/insts/static_inst.cc b/src/arch/arm/insts/static_inst.cc index 9ece0e6d2..70e5fb952 100644 --- a/src/arch/arm/insts/static_inst.cc +++ b/src/arch/arm/insts/static_inst.cc @@ -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);