Index: head/sys/x86/x86/mp_x86.c =================================================================== --- head/sys/x86/x86/mp_x86.c +++ head/sys/x86/x86/mp_x86.c @@ -1084,6 +1084,11 @@ kcsan_cpu_init(cpuid); + /* + * Assert that smp_after_idle_runnable condition is reasonable. + */ + MPASS(PCPU_GET(curpcb) == NULL); + sched_throw(NULL); panic("scheduler returned us to %s", __func__); @@ -1098,7 +1103,7 @@ for (cpu = 1; cpu < mp_ncpus; cpu++) { pc = pcpu_find(cpu); - while (atomic_load_ptr(&pc->pc_curthread) == (uintptr_t)NULL) + while (atomic_load_ptr(&pc->pc_curpcb) == (uintptr_t)NULL) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE);