kcsan: Rework atomic.h into permissive.h
authorMarco Elver <elver@google.com>
Mon, 7 Jun 2021 12:56:51 +0000 (14:56 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 20 Jul 2021 20:49:43 +0000 (13:49 -0700)
commit49f72d5358dd3c0d28bcd2232c513000b15480f0
treeb837c0732cc8aa274ad60738a818491c71faad9f
parent08cac6049412061e571fadadc3e23464dc46d0f2
kcsan: Rework atomic.h into permissive.h

Rework atomic.h into permissive.h to better reflect its purpose, and
introduce kcsan_ignore_address() and kcsan_ignore_data_race().

Introduce CONFIG_KCSAN_PERMISSIVE and update the stub functions in
preparation for subsequent changes.

As before, developers who choose to use KCSAN in "strict" mode will see
all data races and are not affected. Furthermore, by relying on the
value-change filter logic for kcsan_ignore_data_race(), even if the
permissive rules are enabled, the opt-outs in report.c:skip_report()
override them (such as for RCU-related functions by default).

The option CONFIG_KCSAN_PERMISSIVE is disabled by default, so that the
documented default behaviour of KCSAN does not change. Instead, like
CONFIG_KCSAN_IGNORE_ATOMICS, the option needs to be explicitly opted in.

Signed-off-by: Marco Elver <elver@google.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Documentation/dev-tools/kcsan.rst
kernel/kcsan/atomic.h [deleted file]
kernel/kcsan/core.c
kernel/kcsan/permissive.h [new file with mode: 0644]
lib/Kconfig.kcsan