From: Chuan Zhu Date: Tue, 2 Jan 2018 16:14:33 +0000 (+0000) Subject: arch-arm: Fix Secure state check in checkFPAdvSIMDTrap64 X-Git-Tag: v19.0.0.0~2299 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf58af7cf2402a280d6789797a9bc956209bdc30;p=gem5.git arch-arm: Fix Secure state check in checkFPAdvSIMDTrap64 The old code does secure state check by using "el <= EL2", which mis-considers secure EL1 and EL0. This patch fixes this by using inSecureState as in ARM ARM. Change-Id: I01d847c6af022c1462b16206cbc576f15f5569fd Reviewed-by: Jack Travaglini Reviewed-on: https://gem5-review.googlesource.com/8081 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- diff --git a/src/arch/arm/insts/static_inst.cc b/src/arch/arm/insts/static_inst.cc index a7ba91e03..40a1fe4b3 100644 --- a/src/arch/arm/insts/static_inst.cc +++ b/src/arch/arm/insts/static_inst.cc @@ -629,9 +629,7 @@ ArmStaticInst::advSIMDFPAccessTrap64(ExceptionLevel el) const Fault ArmStaticInst::checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const { - const ExceptionLevel el = (ExceptionLevel) (uint8_t)cpsr.el; - - if (ArmSystem::haveVirtualization(tc) && el <= EL2) { + if (ArmSystem::haveVirtualization(tc) && !inSecureState(tc)) { HCPTR cptrEnCheck = tc->readMiscReg(MISCREG_CPTR_EL2); if (cptrEnCheck.tfp) return advSIMDFPAccessTrap64(EL2);