Home Home > GIT Browse > SLE11-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2018-12-21 13:46:45 +0100
committerMiroslav Benes <mbenes@suse.cz>2018-12-21 13:46:45 +0100
commit896eca4e161e95babe0424967accc6c2c79826a0 (patch)
tree1e004d7ee8a2b92a2f39014af5222ce96a22ade0
parent0db51623c02976b4260a7bb75b679f643330d7f7 (diff)
tracing: Fix check for cpu online when event is disabled
(bsc#1120109).
-rw-r--r--patches.fixes/tracing-fix-check-for-cpu-online-when-event-is-disabled.patch70
-rw-r--r--series.conf1
2 files changed, 71 insertions, 0 deletions
diff --git a/patches.fixes/tracing-fix-check-for-cpu-online-when-event-is-disabled.patch b/patches.fixes/tracing-fix-check-for-cpu-online-when-event-is-disabled.patch
new file mode 100644
index 0000000000..042995d0ff
--- /dev/null
+++ b/patches.fixes/tracing-fix-check-for-cpu-online-when-event-is-disabled.patch
@@ -0,0 +1,70 @@
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+Date: Wed, 9 Mar 2016 11:58:41 -0500
+Subject: tracing: Fix check for cpu online when event is disabled
+Git-commit: dc17147de328a74bbdee67c1bf37d2f1992de756
+Patch-mainline: v4.5
+References: bsc#1120109
+
+Commit f37755490fe9b ("tracepoints: Do not trace when cpu is offline") added
+a check to make sure that tracepoints only get called when the cpu is
+online, as it uses rcu_read_lock_sched() for protection.
+
+Commit 3a630178fd5f3 ("tracing: generate RCU warnings even when tracepoints
+are disabled") added lockdep checks (including rcu checks) for events that
+are not enabled to catch possible RCU issues that would only be triggered if
+a trace event was enabled. Commit f37755490fe9b only stopped the warnings
+when the trace event was enabled but did not prevent warnings if the trace
+event was called when disabled.
+
+To fix this, the cpu online check is moved to where the condition is added
+to the trace event. This will place the cpu online check in all places that
+it may be used now and in the future.
+
+Cc: stable@vger.kernel.org # v3.18+
+Fixes: f37755490fe9b ("tracepoints: Do not trace when cpu is offline")
+Fixes: 3a630178fd5f3 ("tracing: generate RCU warnings even when tracepoints are disabled")
+Reported-by: Sudeep Holla <sudeep.holla@arm.com>
+Tested-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Acked-by: Miroslav Benes <mbenes@suse.cz>
+---
+ include/linux/tracepoint.h | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/include/linux/tracepoint.h
++++ b/include/linux/tracepoint.h
+@@ -125,9 +125,6 @@ void tracepoint_update_probe_range(struc
+ void *it_func; \
+ void *__data; \
+ \
+- if (!cpu_online(raw_smp_processor_id())) \
+- return; \
+- \
+ if (!(cond)) \
+ return; \
+ rcu_read_lock_sched_notrace(); \
+@@ -239,15 +236,19 @@ void tracepoint_update_probe_range(struc
+ * "void *__data, proto" as the callback prototype.
+ */
+ #define DECLARE_TRACE_NOARGS(name) \
+- __DECLARE_TRACE(name, void, , 1, void *__data, __data)
++ __DECLARE_TRACE(name, void, , \
++ cpu_online(raw_smp_processor_id()), \
++ void *__data, __data)
+
+ #define DECLARE_TRACE(name, proto, args) \
+- __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
+- PARAMS(void *__data, proto), \
+- PARAMS(__data, args))
++ __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
++ cpu_online(raw_smp_processor_id()), \
++ PARAMS(void *__data, proto), \
++ PARAMS(__data, args))
+
+ #define DECLARE_TRACE_CONDITION(name, proto, args, cond) \
+- __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \
++ __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
++ cpu_online(raw_smp_processor_id()) && (PARAMS(cond)), \
+ PARAMS(void *__data, proto), \
+ PARAMS(__data, args))
+
diff --git a/series.conf b/series.conf
index 7c1e5e437d..ecce2721ae 100644
--- a/series.conf
+++ b/series.conf
@@ -23185,6 +23185,7 @@
patches.fixes/ring-buffer-always-reset-iterator-to-reader-page.patch
patches.fixes/ring-buffer-fix-infinite-spin-in-reading-buffer.patch
patches.fixes/tracepoints-do-not-trace-when-cpu-is-offline.patch
+ patches.fixes/tracing-fix-check-for-cpu-online-when-event-is-disabled.patch
########################################################
# KVM patches