diff options
author | Marco Elver <elver@google.com> | 2021-11-30 12:44:13 +0100 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2021-12-10 01:42:26 +0100 |
commit | 0b8b0830ac1419d7250fde31ea78793a03f3db44 (patch) | |
tree | ffadef022d1c935a3b7fdb911d52f9d2ded4406a /scripts/Makefile.lib | |
parent | kcsan: Add core support for a subset of weak memory modeling (diff) | |
download | linux-0b8b0830ac1419d7250fde31ea78793a03f3db44.tar.xz linux-0b8b0830ac1419d7250fde31ea78793a03f3db44.zip |
kcsan: Add core memory barrier instrumentation functions
Add the core memory barrier instrumentation functions. These invalidate
the current in-flight reordered access based on the rules for the
respective barrier types and in-flight access type.
To obtain barrier instrumentation that can be disabled via __no_kcsan
with appropriate compiler-support (and not just with objtool help),
barrier instrumentation repurposes __atomic_signal_fence(), instead of
inserting explicit calls. Crucially, __atomic_signal_fence() normally
does not map to any real instructions, but is still intercepted by
fsanitize=thread. As a result, like any other instrumentation done by
the compiler, barrier instrumentation can be disabled with __no_kcsan.
Unfortunately Clang and GCC currently differ in their __no_kcsan aka
__no_sanitize_thread behaviour with respect to builtin atomics (and
__tsan_func_{entry,exit}) instrumentation. This is already reflected in
Kconfig.kcsan's dependencies for KCSAN_WEAK_MEMORY. A later change will
introduce support for newer versions of Clang that can implement
__no_kcsan to also remove the additional instrumentation introduced by
KCSAN_WEAK_MEMORY.
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'scripts/Makefile.lib')
0 files changed, 0 insertions, 0 deletions