linux-stable/arch
王贇 ce5e48036c ftrace: disable preemption when recursion locked
As the documentation explained, ftrace_test_recursion_trylock()
and ftrace_test_recursion_unlock() were supposed to disable and
enable preemption properly, however currently this work is done
outside of the function, which could be missing by mistake.

And since the internal using of trace_test_and_set_recursion()
and trace_clear_recursion() also require preemption disabled, we
can just merge the logical.

This patch will make sure the preemption has been disabled when
trace_test_and_set_recursion() return bit >= 0, and
trace_clear_recursion() will enable the preemption if previously
enabled.

Link: https://lkml.kernel.org/r/13bde807-779c-aa4c-0672-20515ae365ea@linux.alibaba.com

CC: Petr Mladek <pmladek@suse.com>
Cc: Guo Ren <guoren@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Jisheng Zhang <jszhang@kernel.org>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Miroslav Benes <mbenes@suse.cz>
Reported-by: Abaci <abaci@linux.alibaba.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Michael Wang <yun.wang@linux.alibaba.com>
[ Removed extra line in comment - SDR ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-10-27 11:21:49 -04:00
..
alpha alpha: enable GENERIC_PCI_IOMAP unconditionally 2021-09-19 10:37:00 -07:00
arc ARC: Add instruction_pointer_set() API 2021-09-30 21:24:07 -04:00
arm ARM: Recover kretprobe modified return address in stacktrace 2021-10-22 12:16:53 -04:00
arm64 arm64: Recover kretprobe modified return address in stacktrace 2021-10-22 12:16:53 -04:00
csky ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
h8300 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
ia64 ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
m68k m68k: mvme: Remove overdue #warnings in RTC handling 2021-09-13 11:19:05 +02:00
microblaze ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
mips kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
nds32 ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
nios2 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
openrisc Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
parisc ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
powerpc ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
riscv ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
s390 ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
sh ftrace/sh: Add arch_ftrace_ops_list_func stub to have compressed image still link 2021-10-26 17:23:36 -04:00
sparc ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
um This pull request contains the following changes for UML: 2021-09-09 13:45:26 -07:00
x86 ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
xtensa Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
.gitignore
Kconfig kprobes: Add a test case for stacktrace from kretprobe handler 2021-10-26 17:23:45 -04:00