s390: add KCSAN instrumentation to barriers and spinlocks
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 19 Apr 2022 15:40:29 +0000 (17:40 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 25 Apr 2022 11:54:16 +0000 (13:54 +0200)
commit9a07731702d9e5787770f44d2be0c15742f27e39
treebc168a530773be7504302f62ed40c6c42b9884e9
parent34fb0e703480a65754e1f8289d754dfc953ba8d4
s390: add KCSAN instrumentation to barriers and spinlocks

test_barrier fails on s390 because of the missing KCSAN instrumentation
for several synchronization primitives.

Add it to barriers by defining __mb(), __rmb(), __wmb(), __dma_rmb()
and __dma_wmb(), and letting the common code in asm-generic/barrier.h
do the rest.

Spinlocks require instrumentation only on the unlock path; notify KCSAN
that the CPU cannot move memory accesses outside of the spin lock. In
reality it also cannot move stores inside of it, but this is not
important and can be omitted.

Reported-by: Tobias Huschle <huschle@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/barrier.h
arch/s390/include/asm/spinlock.h