Fix vkernel issues - enable ithread preemption, races, and more.
signalintr() was improperly entering a critical section, preventing
sched_ithd() from being able to preempt the current thread. Adjust
so the code matches the pc32 code.
lwp0 was being assigned cpu_heavy_switch instead of cpu_lwkt_switch,
which works fine on pc32 but blows up the vkernel if process 0 gets
preempted, because vkernel LWKT processes are not assigned vmspaces.
Properly use cpu_lwkt_switch() to fix the problem.
We were not checking for pending reschedule requests when the
vmspace_ctl() call got interrupted by a signal. NOTE: There is
still a race after the check prior to re-entry into vmspace_ctl()
which needs to be closed.
Tracked-down-by: corecode, dillon