]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit81247616092cb58cc1a61ced88951d30b562bd59
treebc168a530773be7504302f62ed40c6c42b9884e9
parent10b3694cb0f27b36b845338d660f3c285f145ad7
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