arch-arm: Fix SoftwareStep::debugExceptionReturnSS
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 10 Aug 2020 22:02:10 +0000 (23:02 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 14 Aug 2020 13:07:41 +0000 (13:07 +0000)
commit31d118ffccd9935ec75075c83e84faa7246e22fe
treec980ceb8bcb5a8a4b63342af96e293846848a1b3
parent9f01f4fd6d93a27843364080a535aa01f7690ebb
arch-arm: Fix SoftwareStep::debugExceptionReturnSS

debugExceptionReturnSS is called on an ERET instruction to
check for software step. The method was not using the
SPSR.width and it was relying on the more generic ELIs32 to
check the execution mode of the destination EL.

This is not only an efficiency problem: the helper might not work
when returning to EL0. In general it is not possible to
understand if EL0 is using AArch32 or AArch64 if the current
EL is not EL0 and EL1 is using AArch64.

This is instead visible by inspecting the spsr.width during the
execution of an ERET instruction

Change-Id: Ibc5a43633d0020139f2c0e372959a3ab4880da6e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32634
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/insts/static_inst.cc
src/arch/arm/self_debug.cc
src/arch/arm/self_debug.hh