Index: sys/kern/kern_shutdown.c =================================================================== --- sys/kern/kern_shutdown.c (revision 206800) +++ sys/kern/kern_shutdown.c (working copy) @@ -62,7 +62,7 @@ #include #include #include -#include /* smp_active */ +#include #include #include @@ -485,15 +485,17 @@ shutdown_reset(void *junk, int howto) { + printf("Rebooting...\n"); + DELAY(1000000); /* wait 1 sec for printf's to complete and be read */ + /* - * Disable interrupts on CPU0 in order to avoid fast handlers - * to preempt the stopping process and to deadlock against other - * CPUs. + * Acquiring smp_ipi_mtx here has a double effect: + * it disables interrupts avoiding CPU0 preemption + * by fast handlers (thus deadlocking against other CPUs) and, + * secondly, avoids deadlocks against smp_tlb_shootdown() and + * smp_rendezvous(). */ - spinlock_enter(); - - printf("Rebooting...\n"); - DELAY(1000000); /* wait 1 sec for printf's to complete and be read */ + mtx_lock_spin(&smp_ipi_mtx); /* cpu_boot(howto); */ /* doesn't do anything at the moment */ cpu_reset(); /* NOTREACHED */ /* assuming reset worked */