mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
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
This commit is contained in:
1 parent
17355cf50f
commit
8df2e54214
2 files changed
+2
-2
No files matched your search
@@ -141,8 +141,8 @@ cpu_switchin:
|
||||
blocked_loop:
|
||||
lwz %r7,TD_LOCK(%r2)
|
||||
cmpw %r6,%r7
|
||||
beq- blocked_loop
|
||||
isync
|
||||
beq- blocked_loop
|
||||
#endif
|
||||
|
||||
lwz %r17,TD_PCB(%r2) /* Get new current PCB */
|
||||
|
||||
@@ -194,8 +194,8 @@ cpu_switchin:
|
||||
blocked_loop:
|
||||
ld %r7,TD_LOCK(%r13)
|
||||
cmpd %r6,%r7
|
||||
beq- blocked_loop
|
||||
isync
|
||||
beq- blocked_loop
|
||||
#endif
|
||||
|
||||
ld %r17,TD_PCB(%r13) /* Get new PCB */
|
||||
|
||||
Reference in new issue
Block a user