kcsan, trace: Make KCSAN compatible with tracing
authorMarco Elver <elver@google.com>
Fri, 14 Feb 2020 21:10:35 +0000 (22:10 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 21 Mar 2020 08:44:41 +0000 (09:44 +0100)
commitf5d2313bd3c540be405c4977a63840cd6d0167b5
tree25a8bfd1f857fc11aab179fb67ac36071e9c1503
parent703b321501c95c658275fd76775282fe45989641
kcsan, trace: Make KCSAN compatible with tracing

Previously the system would lock up if ftrace was enabled together with
KCSAN. This is due to recursion on reporting if the tracer code is
instrumented with KCSAN.

To avoid this for all types of tracing, disable KCSAN instrumentation
for all of kernel/trace.

Furthermore, since KCSAN relies on udelay() to introduce delay, we have
to disable ftrace for udelay() (currently done for x86) in case KCSAN is
used together with lockdep and ftrace. The reason is that it may corrupt
lockdep IRQ flags tracing state due to a peculiar case of recursion
(details in Makefile comment).

Reported-by: Qian Cai <cai@lca.pw>
Tested-by: Qian Cai <cai@lca.pw>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/lib/Makefile
kernel/kcsan/Makefile
kernel/trace/Makefile