Re: [PATCH v2 06/11] powerpc: powernv: Fix KCSAN datarace warnings on idle_state contention

From
Nicholas Piggin <npiggin@gmail.com>
Date
2023-05-15 05:51:55
Reply to
Rohan McLure, 2023-05-10
On Wed May 10, 2023 at 1:31 PM AEST, Rohan McLure wrote:
The idle_state entry in the PACA on PowerNV features a bit which is
atomically tested and set through ldarx/stdcx. to be used as a spinlock.
This lock then guards access to other bit fields of idle_state. KCSAN
cannot differentiate between any of these bitfield accesses as they all
are implemented by 8-byte store/load instructions, thus cores contending
on the bit-lock appear to data race with modifications to idle_state.

Separate the bit-lock entry from the data guarded by the lock to avoid
the possibility of data races being detected by KCSAN.

Suggested-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Rohan McLure <redacted>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Thread (24 messages) 24 messages, 4 authors, last reply 2023-07-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help