Index: kern_clocksource.c =================================================================== --- kern_clocksource.c (revision 258207) +++ kern_clocksource.c (working copy) @@ -534,16 +534,27 @@ ET_HW_UNLOCK(DPCPU_PTR(timerstate)); #ifdef SMP /* If timer is global or there is no other CPUs yet - we are done. */ - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || !smp_started) { + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { critical_exit(); return; } + /* Set reconfigure flags for other CPUs. */ CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); atomic_store_rel_int(&state->action, (cpu == curcpu) ? 0 : ( start ? 1 : 2)); } + + if (!smp_started) { + /* + * The configuration changes will be applied later when the + * APs configure their clocksource in cpu_initclocks_ap(). + */ + critical_exit(); + return; + } + /* Broadcast reconfigure IPI. */ ipi_all_but_self(IPI_HARDCLOCK); /* Wait for reconfiguration completed. */ @@ -697,6 +708,13 @@ handleevents(state->now, 2); td->td_intr_nesting_level--; spinlock_exit(); + +#ifdef SMP + /* + * Apply any timer configuration that got deferred until AP bootup. + */ + ipi_cpu(curcpu, IPI_HARDCLOCK); +#endif } /*