HomeFreeBSD

riscv: save the thread pointer in both modes

Description

riscv: save the thread pointer in both modes

The contents of frame->tf_tp are uninitialized if accessed by DTrace (in
probe context), resulting in a panic when trying to access the memory
pointed to by tp. This saves the thread pointer to the trap frame when
handling both userland and kernel exceptions.

Reviewed by: markj, mhorne
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39582

Details

Provenance
markjAuthored on Apr 17 2023, 1:44 PM
Reviewer
markj
Differential Revision
D39582: riscv/exception.S: save the thread pointer in both modes
Parents
rGf656a96020e8: tests: make ktest build on ppc.
Branches
Unknown
Tags
Unknown