freebsd-dev/sys/x86
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 Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
bios sys/x86: further adoption of SPDX licensing ID tags. 2017-11-27 15:11:47 +00:00
conf Floppy driver really only works on x86 2019-08-12 22:58:50 +00:00
cpufreq hwpstate_intel(4): Silence/fix Coverity reports 2020-01-29 03:15:34 +00:00
include Reimplement stack capture of running threads on i386 and amd64. 2020-01-31 15:43:33 +00:00
iommu Correct the use of RB_AUGMENT in the RB_TREE macros so that is invoked 2020-01-27 15:09:13 +00:00
isa Fix amd64/i386 LINT build after r344982 2019-03-11 19:46:15 +00:00
pci Add pci_early function to detect Intel stolen memory. 2018-10-31 23:17:00 +00:00
x86 Reimplement stack capture of running threads on i386 and amd64. 2020-01-31 15:43:33 +00:00
xen xen: fix dispatching of NMIs 2019-11-12 10:31:28 +00:00