freebsd-dev/sys/amd64
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
..
acpica Merge ACPICA 20190329. 2019-03-29 20:21:28 +00:00
amd64 Reimplement stack capture of running threads on i386 and amd64. 2020-01-31 15:43:33 +00:00
cloudabi32 Use uintptr_t instead of register_t * for the stack base. 2019-12-03 23:17:54 +00:00
cloudabi64 Use uintptr_t instead of register_t * for the stack base. 2019-12-03 23:17:54 +00:00
conf Remove the trm(4) driver 2019-11-28 02:32:17 +00:00
ia32 Use uintptr_t instead of register_t * for the stack base. 2019-12-03 23:17:54 +00:00
include bhyve: terminate waiting loops if thread suspension is requested. 2020-01-02 22:37:04 +00:00
linux sysent targets: further cleanup and deduplication 2020-01-18 20:37:45 +00:00
linux32 Regen. 2020-01-21 17:28:36 +00:00
pci pci_cfgreg.c: Use io port config access for early boot time. 2019-04-09 18:07:17 +00:00
sgx Fix a few places that free a page from an object without busy held. This is 2019-12-02 22:42:05 +00:00
vmm bhyve: terminate waiting loops if thread suspension is requested. 2020-01-02 22:37:04 +00:00
Makefile