Page MenuHomeFreeBSD

Fix r356919.
ClosedPublic

Authored by kib on Jan 23 2020, 11:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 8 2024, 4:38 AM
Unknown Object (File)
Jan 17 2024, 2:02 AM
Unknown Object (File)
Dec 22 2023, 11:32 PM
Unknown Object (File)
Nov 26 2023, 6:57 PM
Unknown Object (File)
Oct 3 2023, 8:30 AM
Unknown Object (File)
Sep 19 2023, 3:37 AM
Unknown Object (File)
Jul 5 2023, 2:43 PM
Unknown Object (File)
Jul 5 2023, 2:41 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..