tmp_suning_uos_patched/arch/mips/lib
Tiezhu Yang 7519ece673 MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER
[ Upstream commit 78cf0eb926cb1abeff2106bae67752e032fe5f3e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-16 12:01:37 +02: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_copy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 504 2019-06-19 17:09:56 +02:00
iomap-pci.c MIPS: Use GENERIC_IOMAP 2018-08-30 09:41:16 -07:00
libgcc.h MIPS: Implement __multi3 for GCC7 MIPS64r6 builds 2018-01-11 14:40:31 +01:00
Makefile MIPS: Use GENERIC_IOMAP 2018-08-30 09:41:16 -07:00
memcpy.S MIPS: do not compile generic functions for CONFIG_CAVIUM_OCTEON_SOC 2020-03-25 16:07:13 +01:00
memset.S MIPS: make CPU_HAS_LOAD_STORE_LR opt-out 2020-01-22 10:16:47 -08:00
mips-atomic.c MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER 2021-06-16 12:01:37 +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 get rid of unused __strncpy_from_user() instances 2017-05-15 23:40:28 -04:00
strnlen_user.S mips: get rid of unused __strnlen_user() 2017-05-15 23:40:32 -04:00
uncached.c mips: lib: uncached: fix non-standard usage of variable 'sp' 2021-01-19 18:27:20 +01:00