From fc278fffb78512ff3d62a906804d6b285edd00c7 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 7 Jun 2018 17:17:16 +0100 Subject: arch-arm: BadMode checking if corresponding EL is implemented The old utility function called badMode was only checking if the mode passed as an argument was a recognized mode. It was not checking if the corresponding mode/EL was implemented. That function has been renamed to unknownMode and a new badMode has been introduced. This is used by the cpsrWriteByInstruction function. In this way any try to change the execution mode won't succeed if the mode hasn't been implemented. Change-Id: Ibfe385c5465b904acc0d2eb9647710891d72c9df Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/11196 Maintainer: Andreas Sandberg --- src/arch/arm/isa/insts/str.isa | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/arch/arm/isa/insts/str.isa') diff --git a/src/arch/arm/isa/insts/str.isa b/src/arch/arm/isa/insts/str.isa index 1c697d3ff..c165eaf1a 100644 --- a/src/arch/arm/isa/insts/str.isa +++ b/src/arch/arm/isa/insts/str.isa @@ -112,6 +112,12 @@ let {{ if self.add: wbDiff = 8 accCode = ''' + + auto tc = xc->tcBase(); + if (badMode32(tc, static_cast(regMode))) { + return undefinedFault32(tc, opModeToEL(currOpMode(tc))); + } + CPSR cpsr = Cpsr; Mem_ud = (uint64_t)cSwap(LR_uw, cpsr.e) | ((uint64_t)cSwap(Spsr_uw, cpsr.e) << 32); -- cgit v1.2.3