freebsd-src/sys/dev/syscons
Bruce Evans b9cedb46e2 Fix low-level locking during panics.
The SCHEDULER_STOPPED() hack breaks locking generally, and
mtx_trylock_*() especially.  When mtx_trylock_*() returns nonzero,
naive code version here trusts it to have worked.  But when
SCHEDULER_STOPPED() is true, mtx_trylock_*() returns 1 without doing
anything.  Then mtx_unlock_*() crashes especially badly attempting to
unlock iff the error is detected, since mutex unlocking functions don't
check SCHEDULER_STOPPED().

syscons already didn't trust mtx_trylock_spin(), but it was missing the
logic to turn on sp->kdb_locked when turning off sp->mtx_locked during
panics.  It also used panicstr instead of SCHEDULER_LOCKED because I
thought that panicstr was more fragile.  They only differ for a window
of lines in panic(), and in broken cases where stop_cpus_hard() in panic()
didn't work.
2018-06-02 08:38:59 +00:00
..
apm sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
blank sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
daemon sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
dragon sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
fade sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
fire Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
fonts Add files to help manage the (vga) syscons mouse cursor. 2017-07-08 15:01:55 +00:00
green sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
logo sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
plasma Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
rain sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
snake sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
star sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
warp sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
scgfbrndr.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
schistory.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
scmouse.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
scterm-teken.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
scterm.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
scvesactl.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
scvgarndr.c kernel: Fix several typos and minor errors 2017-12-27 03:23:21 +00:00
scvidctl.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
scvtb.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
syscons.c Fix low-level locking during panics. 2018-06-02 08:38:59 +00:00
syscons.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
sysmouse.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00