From 5124060f7e42056c2185ce0724ad9d3d3295019a Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 19 Mar 2021 16:33:42 +0800 Subject: [PATCH 2618/2944] x86, kcsan: Add __no_kcsan to noinstr to #30648216 commit 5ddbc4082e1072eeeae52ff561a88620a05be08f upstream. The 'noinstr' function attribute means no-instrumentation, this should very much include *SAN. Because lots of that is broken at present, only include KCSAN for now, as that is limited to clang11, which has sane function attribute behaviour. Signed-off-by: Peter Zijlstra (Intel) (cherry picked from commit 5ddbc4082e1072eeeae52ff561a88620a05be08f) Signed-off-by: Ethan Zhao Signed-off-by: Zelin Deng Reviewed-by: Artie Ding --- include/linux/compiler_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 61e3212..73389cc 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -110,6 +110,10 @@ struct ftrace_likely_data { #define __deprecated #define __deprecated_for_modules +/* Section for code which can't be instrumented at all */ +#define noinstr \ + noinline notrace __attribute((__section__(".noinstr.text"))) + #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ -- 1.8.3.1