HomeFreeBSD

arm64: Mask non-debug exceptions when single stepping

Description

arm64: Mask non-debug exceptions when single stepping

When an exception is pending when single stepping we may execute the
handler for that exception rather than the single step handler. This
could cause the scheduler to fire to run a new thread. This will mean
we single step to a new thread causing unexpected results.

Handle this by masking non-debug exceptions. This will cause issues
when stepping over instructions that access the DAIF values so future
work is needed to handle these cases, but for most code this now works
as expected.

Reviewed by: jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44350

(cherry picked from commit ed3c6cd76de8560c46607abe506a03568e9acab2)

Details

Provenance
andrewAuthored on Mar 14 2024, 2:02 PM
Reviewer
jhb
Differential Revision
D44350: arm64: Mask non-debug exceptions when single stepping
Parents
rG1ac1e83f189f: arm64: Return all registers to gdb when able
Branches
Unknown
Tags
Unknown