linux-stable/arch/parisc/kernel
王贇 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
..
syscalls compat: remove some compat entry points 2021-09-08 15:32:35 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
alternative.c parisc: Refactor alternative code to accept multiple conditions 2020-04-05 22:50:40 +02:00
asm-offsets.c parisc: Implement __get/put_kernel_nofault() 2021-09-09 22:53:09 +02:00
audit.c
cache.c mm: remove flush_kernel_dcache_page 2021-09-03 09:58:13 -07:00
compat_audit.c
drivers.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
entry.S parisc: Optimize per-pagetable spinlocks 2021-02-12 16:39:42 +01:00
firmware.c isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
ftrace.c ftrace: disable preemption when recursion locked 2021-10-27 11:21:49 -04:00
hardware.c parisc: hardware: Update references to parisc website 2020-06-01 23:02:39 +02:00
head.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
hpmc.S parisc: Fix IVT checksum calculation wrt HPMC 2021-02-12 16:31:42 +01:00
inventory.c parisc: Add qemu fw_cfg interface 2020-10-15 08:10:37 +02:00
irq.c Rework of the X86 irq stack handling: 2021-02-24 16:32:23 -08:00
jump_label.c parisc: Add static branch and JUMP_LABEL feature 2019-05-06 00:10:03 +02:00
kexec.c parisc: add support for kexec_file_load() syscall 2019-09-08 15:41:46 +02:00
kexec_file.c parisc: add support for kexec_file_load() syscall 2019-09-08 15:41:46 +02:00
kgdb.c maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
kprobes.c kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
Makefile parisc: fix compilation when KEXEC=n and KEXEC_FILE=y 2019-12-15 21:05:38 +01:00
module.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
pa7300lc.c
pacache.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
parisc_ksyms.c parisc: Drop strnlen_user() in favour of generic version 2021-09-09 12:44:30 +02:00
patch.c parisc: add spinlock to patch function 2019-06-08 12:56:26 +02:00
pci-dma.c parisc: pci-dma: fix warning unused-function 2020-12-15 05:41:11 +01:00
pci.c parisc: Drop comments which are already in pci.h 2019-09-05 16:41:11 +02:00
pdc_chassis.c kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
pdc_cons.c tty: pdc_cons, free tty_driver upon failure 2021-07-27 12:17:21 +02:00
pdt.c parisc: Report bad pages as HardwareCorrupted 2020-07-28 11:19:17 +02:00
perf.c parisc/perf: open access for CAP_PERFMON privileged process 2020-04-16 12:19:08 -03:00
perf_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
perf_images.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
process.c isystem: trim/fixup stdarg.h and other headers 2021-08-19 09:02:55 +09:00
processor.c parisc: Drop loops_per_jiffy from per_cpu struct 2020-11-11 14:57:30 +01:00
ptrace.c arch/parisc/kernel: remove duplicate include in ptrace 2021-03-04 09:12:29 +01:00
real2.S parisc: Fix and improve kernel stack unwinding 2018-08-13 09:54:17 +02:00
relocate_kernel.S parisc: add kexec syscall support 2019-09-08 15:37:04 +02:00
setup.c parisc: Mark sched_clock unstable only if clocks are not syncronized 2021-09-09 12:44:31 +02:00
signal.c parisc: Reduce sigreturn trampoline to 3 instructions 2021-09-09 12:44:31 +02:00
signal32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
signal32.h parisc: Reduce sigreturn trampoline to 3 instructions 2021-09-09 12:44:31 +02:00
smp.c sched/core: Initialize the idle task with preemption disabled 2021-05-12 13:01:45 +02:00
stacktrace.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
sys_parisc.c parisc: Make user stack size configurable 2020-11-11 14:59:08 +01:00
sys_parisc32.c
syscall.S parisc: syscalls: switch to generic syscalltbl.sh 2021-04-27 09:43:56 +02:00
time.c parisc: Mark sched_clock unstable only if clocks are not syncronized 2021-09-09 12:44:31 +02:00
topology.c parisc: Add CPU topology support 2017-11-17 15:27:22 +01:00
traps.c trap: cleanup trap_init() 2021-09-08 11:50:27 -07:00
unaligned.c Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-07-08 21:48:15 -07:00
unwind.c parisc: Use __ro_after_init in unwind.c 2019-05-10 21:00:45 +02:00
vmlinux.lds.S vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG 2020-09-01 09:50:35 +02:00