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
Differential D23330
Fix r356919. kib on Jan 23 2020, 11:18 AM. Authored by Tags None Referenced Files
Subscribers
Details
Instead of waiting for pc_curthread which is overwritten by init_secondary_tail(), wait for pc_curpcb. Reported by: rlibby
Diff Detail
Event TimelineComment Actions Isn't curpcb set while still on the old stack? We load the new rsp after setting curpcb. In fact, the same is true for curthread, I didn't notice it before. Comment Actions 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. Comment Actions Looks good. Thanks. I applied this patch and rebooted about ten times and saw no issues (previous frequency for me was maybe 1/3). |