linux/arch/mips/lib
Tiezhu Yang 78cf0eb926 MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER
When update the latest mainline kernel with the following three configs,
the kernel hangs during startup:

(1) CONFIG_FUNCTION_GRAPH_TRACER=y
(2) CONFIG_PREEMPT_TRACER=y
(3) CONFIG_FTRACE_STARTUP_TEST=y

When update the latest mainline kernel with the above two configs (1)
and (2), the kernel starts normally, but it still hangs when execute
the following command:

echo "function_graph" > /sys/kernel/debug/tracing/current_tracer

Without CONFIG_PREEMPT_TRACER=y, the above two kinds of kernel hangs
disappeared, so it seems that CONFIG_PREEMPT_TRACER has some influences
with function_graph tracer at the first glance.

I use ejtag to find out the epc address is related with preempt_enable()
in the file arch/mips/lib/mips-atomic.c, because function tracing can
trace the preempt_{enable,disable} calls that are traced, replace them
with preempt_{enable,disable}_notrace to prevent function tracing from
going into an infinite loop, and then it can fix the kernel hang issue.

By the way, it seems that this commit is a complement and improvement of
commit f93a1a00f2 ("MIPS: Fix crash that occurs when function tracing
is enabled").

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-05-25 15:33:17 +02:00
..
Makefile MIPS: Use GENERIC_IOMAP 2018-08-30 09:41:16 -07:00
bitops.c MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG 2019-10-07 09:42:55 -07:00
bswapdi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bswapsi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
csum_partial.S mips: propagate the calling convention change down into __csum_partial_copy_..._user() 2020-08-20 15:45:20 -04:00
delay.c MIPS: do not compile generic functions for CONFIG_CAVIUM_OCTEON_SOC 2020-03-25 16:07:13 +01:00
dump_tlb.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
iomap-pci.c arch: mips: update references to current linux-mips list 2021-02-23 13:24:38 +01:00
iomap_copy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 504 2019-06-19 17:09:56 +02:00
libgcc.h MIPS: Implement __multi3 for GCC7 MIPS64r6 builds 2018-01-11 14:40:31 +01:00
memcpy.S MIPS: Remove get_fs/set_fs 2021-04-06 15:12:58 +02:00
memset.S MIPS: Remove get_fs/set_fs 2021-04-06 15:12:58 +02:00
mips-atomic.c MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER 2021-05-25 15:33:17 +02:00
multi3.c MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 2018-08-21 12:14:11 -07:00
r3k_dump_tlb.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
strncpy_user.S MIPS: Remove get_fs/set_fs 2021-04-06 15:12:58 +02:00
strnlen_user.S MIPS: Remove get_fs/set_fs 2021-04-06 15:12:58 +02:00
uncached.c mips: lib: uncached: fix non-standard usage of variable 'sp' 2020-12-14 16:03:11 +01:00