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

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/compiler_types.h+4−4
@@ -118,10 +118,6 @@ struct ftrace_likely_data { · 117 unmodified lines
118#define notrace __attribute__((__no_instrument_function__))118#define notrace __attribute__((__no_instrument_function__))
119#endif119#endif
120 120
121/* Section for code which can't be instrumented at all */
122#define noinstr \
123 noinline notrace __attribute((__section__(".noinstr.text")))
124
125/*121/*
126 * it doesn't make sense on ARM (currently the only user of __naked)122 * it doesn't make sense on ARM (currently the only user of __naked)
127 * to trace naked functions because then mcount is called without123 * to trace naked functions because then mcount is called without
@@ -200,6 +196,10 @@ struct ftrace_likely_data { · 72 unmodified lines
200#define __no_sanitize_or_inline __always_inline196#define __no_sanitize_or_inline __always_inline
201#endif197#endif
202 198
199/* Section for code which can't be instrumented at all */
200#define noinstr \
201 noinline notrace __attribute((__section__(".noinstr.text"))) __no_kcsan
202
203#endif /* __KERNEL__ */203#endif /* __KERNEL__ */
204 204
205#endif /* __ASSEMBLY__ */205#endif /* __ASSEMBLY__ */