arm64: entry: Exceptions from single-step should leave debug masked
If we interrupted an instruction being single-stepped we may end up
taking a single-step exception from the interrupt handler. This
confuses single-step users who are typically just waiting for 'the next'
single step exception before re-enabling {break,watch}points.
Returning from the interrupt causes us to hit the {break,watch}point
again.
For the least-surprising results, lets confine single-step to its
intended context.
From the ARM-ARM DDI 0487B.a, D.12.5 'Behaviour in the active-not-pending
state's 'If the PE takes an exception' section, we enter the inactive
state because the exceptiin sets PSTATE.D.
D2.12.6 'Entering the active-pending state', from the inactive state, we
re-enter active-pending if we clear PSTATE.D. This causes a debug
single step exception and we we step the exception handler.
Change the EL1 entry.S handlers to inherit their debug state if the
SPSR.SS bit is clear, instead of unconditionally unmasking it.
This bit will be set if we took this exception instead of stepping an
instruction.
Signed-off-by:
James Morse <james.morse@arm.com>
Loading
Please register or sign in to comment