From 2f9cc04a5f9e2a13e93c57270226f3a83120e408 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 1 May 2020 15:13:01 +0100 Subject: [PATCH] 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 --- src/arch/arm/insts/static_inst.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2