kernel_optimize_test/kernel/kcsan
Marco Elver 0f8ad5f2e9 kcsan: Add support for atomic builtins
Some architectures (currently e.g. s390 partially) implement atomics
using the compiler's atomic builtins (__atomic_*, __sync_*). To support
enabling KCSAN on such architectures in future, or support experimental
use of these builtins, implement support for them.

We should also avoid breaking KCSAN kernels due to use (accidental or
otherwise) of atomic builtins in drivers, as has happened in the past:
https://lkml.kernel.org/r/5231d2c0-41d9-6721-e15f-a7eedf3ce69e@infradead.org

The instrumentation is subtly different from regular reads/writes: TSAN
instrumentation replaces the use of atomic builtins with a call into the
runtime, and the runtime's job is to also execute the desired atomic
operation. We rely on the __atomic_* compiler builtins, available with
all KCSAN-supported compilers, to implement each TSAN atomic
instrumentation function.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-08-24 15:09:05 -07:00
..
atomic.h kcsan: Remove existing special atomic rules 2020-06-29 12:04:48 -07:00
core.c kcsan: Add support for atomic builtins 2020-08-24 15:09:05 -07:00
debugfs.c kcsan: Use GFP_ATOMIC under spin lock 2020-04-27 11:10:10 -07:00
encoding.h kcsan: Prefer __always_inline for fast-path 2020-03-21 09:40:19 +01:00
kcsan-test.c kcsan: Add jiffies test to test suite 2020-06-29 12:04:48 -07:00
kcsan.h kcsan: Improve IRQ state trace reporting 2020-07-31 12:12:03 +02:00
Makefile kcsan: Disable branch tracing in core runtime 2020-06-29 12:04:48 -07:00
report.c kcsan: Improve IRQ state trace reporting 2020-07-31 12:12:03 +02:00
selftest.c kcsan: Rename test.c to selftest.c 2020-06-29 12:04:48 -07:00