If a fatal kernel trap occurs from an IPI or FAST interrupt on a cpu not
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 19 Jul 2005 19:25:45 +0000 (19:25 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 19 Jul 2005 19:25:45 +0000 (19:25 +0000)
commit27e88a6e39221716547cb5d08bbf82e07e1d338f
treed45dddc065bb77b618214c6ca8b5d49a5d9bec05
parenta453459d11fb6b45e804a090c90e08e3d28e907a
If a fatal kernel trap occurs from an IPI or FAST interrupt on a cpu not
holding the MP lock, the trap code will panic a second time when get_mplock()
attempts to block due to an assertion in lwkt_switch().  Add a new globaldata
field, gd_trap_nesting_level, that allows us to bypass this panic.

If lwkt_switch() is called with a non-zero gd_intr_nesting_level or non-zero
gd_trap_nesting_level, the two variables must be saved and then zero'd
across the switch, and restored on resume.  Otherwise a normal switch in
another thread will result in another panic.  This case only occurs during
fatal traps, panics, or when operating from DDB.

From-kernel-dumps-provided-by: David Rhodus <sdrhodus@gmail.com>
sys/i386/i386/trap.c
sys/kern/lwkt_thread.c
sys/platform/pc32/i386/trap.c
sys/sys/globaldata.h