]> git.baikalelectronics.ru Git - kernel.git/commit
percpu: use notrace variant of preempt_disable/preempt_enable
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 3 Nov 2016 12:09:24 +0000 (13:09 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 8 Nov 2016 09:29:44 +0000 (10:29 +0100)
commit1fe30a73094e07be33e908ceaebb0dd260d2c014
treef3eb2f26a65bf6c212819af6cd3aa9215d3078a1
parent5fd557c39df5d02778fb306ff9bc5dc71a7c559a
percpu: use notrace variant of preempt_disable/preempt_enable

Commit eeb9a5a34232 ("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: Sebastian Ott <sebott@linux.vnet.ibm.com>
Tested-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Fixes: eeb9a5a34232 ("ftrace: Have set_ftrace_pid use the bitmap like events do")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
include/asm-generic/percpu.h