HomeFreeBSD

powerpc: put the isync inside the TD_LOCK() checking loop

Description

powerpc: put the isync inside the TD_LOCK() checking loop

Fix a narrow window where the lock is unlocked but the checking CPU
hasn't flushed things appropriately.

Inside this window the CPU inside cpu_switch() will loop forever thinking
the destination thread is still blocked/locked even though it is not.

This manifests as the system hanging after starting all APs.

I've seen this reliably trigger in qemu-system-ppc64 running power9 pseries
guests; the more CPUs the more likely it triggers at boot.

PR: kern/292167
Differential Revision: https://reviews.freebsd.org/D54478
Reviewed by: jhibbits
MFC after: 1 week
Relnotes: yes

(cherry picked from commit 8df2e542146801fd01675e56724eaa567d04c209)

Details

Provenance
adrianAuthored on Jan 3 2026, 10:52 PM
Reviewer
jhibbits
Differential Revision
D54478: powerpc: put the isync inside the TD_LOCK() checking loop
Parents
rGd499239dc57b: libc: Don't use uninitialised string for getnetbyaddr[_r](0) DNS lookup
Branches
Unknown
Tags
Unknown