Fix an IPI messaging lockup which can occur while in DDB.
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Mar 2009 05:07:42 +0000 (22:07 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Mar 2009 05:07:42 +0000 (22:07 -0700)
commit33bb509e5814f0892d0a83ad8dcbfb850e8551eb
tree7099cfbe9eb810f4b91c39354cf3e3f6064cc8db
parent5f861a3b0f4212a66006f71da0fc0995e5d57fcb
Fix an IPI messaging lockup which can occur while in DDB.

When entering DDB on a SMP system we must also enter a critical section
prior to stopping the other cpus.  If we do not interrupts may generate
calls to sched_ithd() instead of just flagging the interrupt in ipending
and returning.  This, in turn, may attempt to send an IPI to another
cpu.  These IPIs will not be processed while the target cpu is stopped.
If the IPI FIFO then fills up the lwkt_send_ipiq*() function will hard-loop
and the system will lock-up.

Resizing the window a vkernel is running in while the vkernel is in DDB
exercises the bug.  The bug is more easily demonstrated simply by sending
a stream of SIGWINCH signals via a while(1)/kill loop to the vkernel.

The bug is potentially an issue on all architectures so fix all
architectures.

Reported-by: Joe Talbott <josepht@cstone.net>
With-help-from: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
sys/platform/pc32/i386/db_interface.c
sys/platform/pc64/amd64/db_interface.c
sys/platform/vkernel/i386/db_interface.c