x86, kcsan: Add __no_kcsan to noinstr

commit 5ddbc4082e1072eeeae52ff561a88620a05be08f upstream.
Backport summary: for 5.4 kernel fsgsbase support.

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) <peterz@infradead.org>
(cherry picked from commit 5ddbc4082e1072eeeae52ff561a88620a05be08f)
Signed-off-by: Ethan Zhao <Haifeng.Zhao@intel.com>
This commit is contained in:
Peter Zijlstra 2020-06-02 18:47:11 +02:00 committed by kaixuxiakx
parent 84427f67ab
commit 2be3d3ef5b
1 changed files with 4 additions and 0 deletions

View File

@ -180,6 +180,10 @@ struct ftrace_likely_data {
*/
#define noinline_for_stack noinline
/* Section for code which can't be instrumented at all */
#define noinstr \
noinline notrace __attribute((__section__(".noinstr.text")))
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */