arch-arm: Adjust breakpoint EC depending on source state
authorAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 22 May 2018 10:58:28 +0000 (11:58 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 6 Jun 2018 13:52:39 +0000 (13:52 +0000)
The software breakpoint exception class needs to be adjusted depending
on the source EL's execution state. This change fixes an incorrect
exception class when taking a breakpoint from aarch64.

Change-Id: I99d87a04be6bf9ce3a69f6b19969fa006cfd63a4
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/10809
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

src/arch/arm/faults.cc
src/arch/arm/faults.hh
src/arch/arm/types.hh

index bdb6f254505fd1102469b6087b17f743e5f24aca..676559f61afe0ef8058b4a6c153a509af87d0e58 100644 (file)
@@ -1543,6 +1543,12 @@ SoftwareBreakpoint::routeToHyp(ThreadContext *tc) const
         (hcr.tge || mdcr.tde);
 }
 
+ExceptionClass
+SoftwareBreakpoint::ec(ThreadContext *tc) const
+{
+    return from64 ? EC_SOFTWARE_BREAKPOINT_64 : vals.ec;
+}
+
 void
 ArmSev::invoke(ThreadContext *tc, const StaticInstPtr &inst) {
     DPRINTF(Faults, "Invoking ArmSev Fault\n");
index 132c07cae7754aaa979711ef09d7262b14f9c1f3..90b5501984d44223cb53eee5007f2acd6cebd3be 100644 (file)
@@ -573,6 +573,7 @@ class SoftwareBreakpoint : public ArmFaultVals<SoftwareBreakpoint>
     SoftwareBreakpoint(ExtMachInst _mach_inst, uint32_t _iss);
 
     bool routeToHyp(ThreadContext *tc) const override;
+    ExceptionClass ec(ThreadContext *tc) const override;
 };
 
 // A fault that flushes the pipe, excluding the faulting instructions
index d4e6ec0dbe25c57954ac82223dd8bc6c78f8355b..84887a1ca913b7aa065cf7f3b8715864aee3c23d 100644 (file)
@@ -623,6 +623,7 @@ namespace ArmISA
         EC_FP_EXCEPTION_64         = 0x2C,
         EC_SERROR                  = 0x2F,
         EC_SOFTWARE_BREAKPOINT     = 0x38,
+        EC_SOFTWARE_BREAKPOINT_64  = 0x3C,
     };
 
     /**