freebsd-dev/sys/mips
John Baldwin f2dceb474b Make stack_save*() more robust on MIPS.
- Validate any stack addresses read from against td_kstack before
  reading.  If an unwind operation would attempt to read outside the
  bounds of td_kstack, abort the unwind instead.

- For stack_save_td(), don't use the PC and SP from the current
  thread, instead read the PC and SP from pcb_context[].

- For stack_save(), use the current PC and SP of the current thread,
  not the values from pcb_regs (the horribly named td_frame of the
  outermost trapframe).  The result was that stack_trace() never
  logged _any_ kernel frames but only the frame from the saved
  userspace registers on entry from the kernel.

- Inline the one use of stack_register_fetch().

- Add a VALID_PC() helper macro and simplify types to remove
  excessive casts in stack_capture().

- Fix stack_capture() to work on compilers written in this century.
  Don't treat function epilogues as function prologues by skipping
  additions to SP when searching for a function start.

- Add some comments to stack_capture() and fix some style bugs.

Reviewed by:	arichardson
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D27358
2020-12-01 17:17:22 +00:00
..
atheros Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
beri Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
broadcom Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
cavium Fix octeon_pmc post-r334827 2020-11-18 17:37:01 +00:00
conf Include virtio support in std.MALTA 2020-07-31 11:28:09 +00:00
include Remove 'struct trapframe' pointer from mips64's 'struct syscall_args'. 2020-11-06 19:19:51 +00:00
ingenic Make MAXPHYS tunable. Bump MAXPHYS to 1M. 2020-11-28 12:12:51 +00:00
malta Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
mediatek Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
mips Make stack_save*() more robust on MIPS. 2020-12-01 17:17:22 +00:00
nlm Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00