History

x86, kcsan: Add __no_kcsan to noinstr

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.

Peter Zijlstra committed 6 years ago

Commit 5ddbc401 parent e79302a1 file · +4 −4Browse files

Unified · Split

include/linux/compiler_types.h+4−4
@@ -118,10 +118,6 @@ struct ftrace_likely_data { · 117 unmodified lines
118118 #define notrace __attribute__((__no_instrument_function__))
119119 #endif
120120
121−/* Section for code which can't be instrumented at all */
122−#define noinstr \
123− noinline notrace __attribute((__section__(".noinstr.text")))
124−
125121 /*
126122 * it doesn't make sense on ARM (currently the only user of __naked)
127123 * to trace naked functions because then mcount is called without
@@ -200,6 +196,10 @@ struct ftrace_likely_data { · 72 unmodified lines
200196 #define __no_sanitize_or_inline __always_inline
201197 #endif
202198
199+/* Section for code which can't be instrumented at all */
200+#define noinstr \
201+ noinline notrace __attribute((__section__(".noinstr.text"))) __no_kcsan
202+
203203 #endif /* __KERNEL__ */
204204
205205 #endif /* __ASSEMBLY__ */