Commit 7f8d61f0 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

percpu: use notrace variant of preempt_disable/preempt_enable

Commit 345ddcc8 ("ftrace: Have set_ftrace_pid use the bitmap like
events do") added a couple of this_cpu_read calls to the ftrace code.

On x86 this is not a problem, since it has single instructions to read
percpu data. Other architectures which use the generic variant now
have additional preempt_disable and preempt_enable calls in the core
ftrace code. This may lead to recursive calls and in result to a dead
machine, e.g. if preemption and debugging options are enabled.

To fix this use the notrace variant of preempt_disable and
preempt_enable within the generic percpu code.
Reported-and-bisected-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Tested-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Fixes: 345ddcc8 ("ftrace: Have set_ftrace_pid use the bitmap like events do")
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 237d6e68
...@@ -118,9 +118,9 @@ do { \ ...@@ -118,9 +118,9 @@ do { \
#define this_cpu_generic_read(pcp) \ #define this_cpu_generic_read(pcp) \
({ \ ({ \
typeof(pcp) __ret; \ typeof(pcp) __ret; \
preempt_disable(); \ preempt_disable_notrace(); \
__ret = raw_cpu_generic_read(pcp); \ __ret = raw_cpu_generic_read(pcp); \
preempt_enable(); \ preempt_enable_notrace(); \
__ret; \ __ret; \
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment