summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2021-11-30 12:44:13 +0100
committerPaul E. McKenney <paulmck@kernel.org>2021-12-09 16:42:26 -0800
commit0b8b0830ac1419d7250fde31ea78793a03f3db44 (patch)
treeffadef022d1c935a3b7fdb911d52f9d2ded4406a /scripts
parent69562e4983d93e2791c0bf128b07462afbd7f4dc (diff)
downloadlinux-stable-0b8b0830ac1419d7250fde31ea78793a03f3db44.tar.gz
linux-stable-0b8b0830ac1419d7250fde31ea78793a03f3db44.tar.bz2
linux-stable-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')
0 files changed, 0 insertions, 0 deletions