From 72ecef7a759f10b4816ecf13a1289fc6d9443c92 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 9 Feb 2018 10:01:39 +0000 Subject: arch-arm: Fix FSC generation in AbortFault The fault status code generated by a Prefetch/Data Fault was containing a wrong value when the fault was triggered in aarch32 but handled in aarch64. This because the encoding differs between the two ISAs and the encoder was just checking the starting ISA rather than the the ending one. In this case the getFsr must be called after we know which is the ending ISA, which happens only after ArmFault::invoke gets called. The fsc update hence happens before writing into the Syndrome register. Change-Id: I725f12b6dcc0178f608233bd3d15e466d1cd1ffc Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/8362 Maintainer: Andreas Sandberg --- src/arch/arm/faults.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/arch/arm/faults.hh') diff --git a/src/arch/arm/faults.hh b/src/arch/arm/faults.hh index f663b5cfc..132c07cae 100644 --- a/src/arch/arm/faults.hh +++ b/src/arch/arm/faults.hh @@ -228,7 +228,7 @@ class ArmFault : public FaultBase virtual ExceptionClass ec(ThreadContext *tc) const = 0; virtual uint32_t iss() const = 0; virtual bool isStage2() const { return false; } - virtual FSR getFsr(ThreadContext *tc) { return 0; } + virtual FSR getFsr(ThreadContext *tc) const { return 0; } virtual void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg); }; @@ -431,11 +431,13 @@ class AbortFault : public ArmFaultVals void invoke(ThreadContext *tc, const StaticInstPtr &inst = StaticInst::nullStaticInstPtr) override; - FSR getFsr(ThreadContext *tc) override; + FSR getFsr(ThreadContext *tc) const override; + uint8_t getFaultStatusCode(ThreadContext *tc) const; bool abortDisable(ThreadContext *tc) override; uint32_t iss() const override; bool isStage2() const override { return stage2; } void annotate(ArmFault::AnnotationIDs id, uint64_t val) override; + void setSyndrome(ThreadContext *tc, MiscRegIndex syndrome_reg) override; bool isMMUFault() const; }; -- cgit v1.2.3