From fe8faa62b74087febe227f69385db3e562682799 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Tue, 29 May 2018 16:30:33 +0100 Subject: arch-arm: Add Illegal Execution flag to PCState This patch moves the detection of the Illegal Execution flag (PSTATE.IL) from the tlb translation stage (fetch) to the decoding stage. This is done by adding the illegalExecution field to the PCState. Change-Id: I9c1c4e9c6bd5ded905c1d56b3034e4e9322582fa Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/10813 Maintainer: Andreas Sandberg --- src/arch/arm/insts/pseudo.cc | 10 ++++++++++ src/arch/arm/insts/pseudo.hh | 15 +++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'src/arch/arm/insts') diff --git a/src/arch/arm/insts/pseudo.cc b/src/arch/arm/insts/pseudo.cc index e2504d61e..2e8c3f10d 100644 --- a/src/arch/arm/insts/pseudo.cc +++ b/src/arch/arm/insts/pseudo.cc @@ -249,3 +249,13 @@ McrMrcImplDefined::generateDisassembly(Addr pc, { return csprintf("%-10s (implementation defined)", mnemonic); } + +IllegalExecInst::IllegalExecInst(ExtMachInst _machInst) + : ArmStaticInst("Illegal Execution", _machInst, No_OpClass) +{} + +Fault +IllegalExecInst::execute(ExecContext *xc, Trace::InstRecord *traceData) const +{ + return std::make_shared(); +} diff --git a/src/arch/arm/insts/pseudo.hh b/src/arch/arm/insts/pseudo.hh index ececbbb86..9065c6281 100644 --- a/src/arch/arm/insts/pseudo.hh +++ b/src/arch/arm/insts/pseudo.hh @@ -161,4 +161,19 @@ class McrMrcImplDefined : public McrMrcMiscInst }; +/** + * This class is modelling instructions which are not going to be + * executed since they are flagged as Illegal Execution Instructions + * (PSTATE.IL = 1 or CPSR.IL = 1). + * The sole purpose of this instruction is to generate an appropriate + * fault when executed. + */ +class IllegalExecInst : public ArmStaticInst +{ + public: + IllegalExecInst(ExtMachInst _machInst); + + Fault execute(ExecContext *xc, Trace::InstRecord *traceData) const; +}; + #endif -- cgit v1.2.3