diff options
author | Will Deacon <[email protected]> | 2020-02-13 12:06:26 +0000 |
---|---|---|
committer | Will Deacon <[email protected]> | 2020-07-16 11:41:21 +0100 |
commit | 3a5a4366cecc25daa300b9a9174f7fdd352b9068 (patch) | |
tree | cab8688b96d324ee0b110d0525679eee6f2a43e5 /tools/perf/scripts/python/Perf-Trace-Util/lib | |
parent | ac2081cdc4d99c57f219c1a6171526e0fa0a6fff (diff) |
arm64: ptrace: Override SPSR.SS when single-stepping is enabled
Luis reports that, when reverse debugging with GDB, single-step does not
function as expected on arm64:
| I've noticed, under very specific conditions, that a PTRACE_SINGLESTEP
| request by GDB won't execute the underlying instruction. As a consequence,
| the PC doesn't move, but we return a SIGTRAP just like we would for a
| regular successful PTRACE_SINGLESTEP request.
The underlying problem is that when the CPU register state is restored
as part of a reverse step, the SPSR.SS bit is cleared and so the hardware
single-step state can transition to the "active-pending" state, causing
an unexpected step exception to be taken immediately if a step operation
is attempted.
In hindsight, we probably shouldn't have exposed SPSR.SS in the pstate
accessible by the GPR regset, but it's a bit late for that now. Instead,
simply prevent userspace from configuring the bit to a value which is
inconsistent with the TIF_SINGLESTEP state for the task being traced.
Cc: <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Keno Fischer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reported-by: Luis Machado <[email protected]>
Tested-by: Luis Machado <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib')
0 files changed, 0 insertions, 0 deletions