HomeFreeBSD

arm64: fix hardware single-stepping from EL1

Description

arm64: fix hardware single-stepping from EL1

The main issue is that debug exceptions must to be disabled for the
entire duration that SS bit in MDSCR_EL1 is set. Otherwise, a
single-step exception will be generated immediately. This can occur
before returning from the debugger (when MDSCR is written to) or before
re-entering it after the single-step (when debug exceptions are unmasked
in the exception handler).

Solve this by delaying the unmask to C code for EL1, and avoid unmasking
at all while handling debug exceptions, thus avoiding any recursive
debug traps.

Reviewed by: markj, jhb
MFC after: 5 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28944

Details

Provenance
mhorneAuthored on Mar 1 2021, 1:59 PM
Reviewer
markj
Differential Revision
D28944: arm64: fix hardware single-stepping from EL1
Parents
rG79fbd483787a: Fix ncurses bootstrap on macOS
Branches
Unknown
Tags
Unknown