kernel - Fix mid-kernel-boot lockups due to module order
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 Apr 2014 19:24:57 +0000 (12:24 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 Apr 2014 19:24:57 +0000 (12:24 -0700)
commit902419bf6d9fd0f80afc9d07cd4b3e99d20f23ca
tree01a6ce26a9bda7412d5df3409d090fa2cc6e5a77
parent7da5c4fd138dc6e5035f5d7aff78a14b09b296e8
kernel - Fix mid-kernel-boot lockups due to module order

* Sometimes the kernel would just lock up for no apparent reason.  Changing
  the preloaded module set (even randomly) could effect the behavior.

* The problem turned out to be an issue with kernel modules needing to
  temporarily migrate to another cpu (such as when installing a SWI or
  other interrupt handler).  If the idle thread on cpu 0 had not yet
  bootstrapped, lwkt_switch_return() would not be called properly and
  the LWKT cpu migration code would never schedule on the target cpu.

* Fix the problem by handling the idle thread bootstrap case for cpu 0
  properly in pc64.
sys/platform/pc64/x86_64/machdep.c
sys/platform/pc64/x86_64/swtch.s