Page MenuHomeFreeBSD

Fix r356919.
ClosedPublic

Authored by kib on Jan 23 2020, 11:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 6:43 AM
Unknown Object (File)
Oct 4 2024, 7:27 PM
Unknown Object (File)
Oct 1 2024, 3:26 PM
Unknown Object (File)
Sep 27 2024, 2:10 PM
Unknown Object (File)
Sep 24 2024, 2:15 AM
Unknown Object (File)
Sep 17 2024, 8:54 PM
Unknown Object (File)
Sep 8 2024, 6:07 PM
Unknown Object (File)
Sep 7 2024, 4:06 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

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.

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.

In D23330#511544, @kib wrote:

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.

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.

I see, thanks.

This revision is now accepted and ready to land.Jan 23 2020, 2:07 PM

Looks good. Thanks. I applied this patch and rebooted about ten times and saw no issues (previous frequency for me was maybe 1/3).

This revision was automatically updated to reflect the committed changes.
kib added a commit: rS357054: Fix r356919..