Instead of waiting for pc_curthread which is overwritten by init_secondary_tail(), wait for pc_curpcb.
Assert that pc_curpcb is not set too early.
Reported by: rlibby
kib on Jan 23 2020, 11:18 AM.Authored by
You mean that %rsp points to the old stack. cpu_switch does not access it at all after the old thread is unblocked. It must be because old thread might already start executing on another CPU. Interrupts are disabled, and non-maskable interrupts like NMI or MCE use non-zero ist.