freebsd-src/sys/riscv
Mark Johnston 1c29da0279 Reimplement stack capture of running threads on i386 and amd64.
After r355784 the td_oncpu field is no longer synchronized by the thread
lock, so the stack capture interrupt cannot be delievered precisely.
Fix this using a loop which drops the thread lock and restarts if the
wrong thread was sampled from the stack capture interrupt handler.

Change the implementation to use a regular interrupt instead of an NMI.
Now that we drop the thread lock, there is no advantage to the latter.

Simplify the KPIs.  Remove stack_save_td_running() and add a return
value to stack_save_td().  On platforms that do not support stack
capture of running threads, stack_save_td() returns EOPNOTSUPP.  If the
target thread is running in user mode, stack_save_td() returns EBUSY.

Reviewed by:	kib
Reported by:	mjg, pho
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23355
2020-01-31 15:43:33 +00:00
..
conf Include the PCI stack to the riscv GENERIC kernel. 2020-01-24 17:10:21 +00:00
include Remove unused fields from struct pcb. 2020-01-30 19:15:27 +00:00
riscv Reimplement stack capture of running threads on i386 and amd64. 2020-01-31 15:43:33 +00:00
sifive sifive: Fix incorrect tx/rx ctrl defines 2020-01-07 09:02:14 +00:00