Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY

Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, __no_kcsan will always ensure that the thread
sanitizer functions are not generated, so remove the check for tsan
functions in is_profiling_func() and the always true depends and
unnecessary select lines in KCSAN_WEAK_MEMORY.

Acked-by: Marco Elver <elver@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infraded.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20250821-bump-min-llvm-ver-15-v2-11-635f3294e5f0@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

-16
-6
lib/Kconfig.kcsan
··· 185 185 bool "Enable weak memory modeling to detect missing memory barriers" 186 186 default y 187 187 depends on KCSAN_STRICT 188 - # We can either let objtool nop __tsan_func_{entry,exit}() and builtin 189 - # atomics instrumentation in .noinstr.text, or use a compiler that can 190 - # implement __no_kcsan to really remove all instrumentation. 191 - depends on !ARCH_WANTS_NO_INSTR || HAVE_NOINSTR_HACK || \ 192 - CC_IS_GCC || CLANG_VERSION >= 140000 193 - select OBJTOOL if HAVE_NOINSTR_HACK 194 188 help 195 189 Enable support for modeling a subset of weak memory, which allows 196 190 detecting a subset of data races due to missing memory barriers.
-10
tools/objtool/check.c
··· 2453 2453 if (!strncmp(name, "__sanitizer_cov_", 16)) 2454 2454 return true; 2455 2455 2456 - /* 2457 - * Some compilers currently do not remove __tsan_func_entry/exit nor 2458 - * __tsan_atomic_signal_fence (used for barrier instrumentation) with 2459 - * the __no_sanitize_thread attribute, remove them. Once the kernel's 2460 - * minimum Clang version is 14.0, this can be removed. 2461 - */ 2462 - if (!strncmp(name, "__tsan_func_", 12) || 2463 - !strcmp(name, "__tsan_atomic_signal_fence")) 2464 - return true; 2465 - 2466 2456 return false; 2467 2457 } 2468 2458