linux-stable/arch/arm/kernel
Li Huafei 61a71a9028 ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value
[ Upstream commit 752ec621ef ]

Because an exception stack frame is not created in the exception entry,
save_trace() does special handling for the exception PC, but this is
only needed when CONFIG_FRAME_POINTER_UNWIND=y. When
CONFIG_ARM_UNWIND=y, unwind annotations have been added to the exception
entry and save_trace() will repeatedly save the exception PC:

    [0x7f000090] hrtimer_hander+0x8/0x10 [hrtimer]
    [0x8019ec50] __hrtimer_run_queues+0x18c/0x394
    [0x8019f760] hrtimer_run_queues+0xbc/0xd0
    [0x8019def0] update_process_times+0x34/0x80
    [0x801ad2a4] tick_periodic+0x48/0xd0
    [0x801ad3dc] tick_handle_periodic+0x1c/0x7c
    [0x8010f2e0] twd_handler+0x30/0x40
    [0x80177620] handle_percpu_devid_irq+0xa0/0x23c
    [0x801718d0] generic_handle_domain_irq+0x24/0x34
    [0x80502d28] gic_handle_irq+0x74/0x88
    [0x8085817c] generic_handle_arch_irq+0x58/0x78
    [0x80100ba8] __irq_svc+0x88/0xc8
    [0x80108114] arch_cpu_idle+0x38/0x3c
    [0x80108114] arch_cpu_idle+0x38/0x3c    <==== duplicate saved exception PC
    [0x80861bf8] default_idle_call+0x38/0x130
    [0x8015d5cc] do_idle+0x150/0x214
    [0x8015d978] cpu_startup_entry+0x18/0x1c
    [0x808589c0] rest_init+0xd8/0xdc
    [0x80c00a44] arch_post_acpi_subsys_init+0x0/0x8

We can move the special handling of the exception PC in save_trace() to
the unwind_frame() of the frame pointer unwinder.

Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Reviewed-by: Linus Waleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-21 12:39:20 +02:00
..
.gitignore
arch_timer.c
armksyms.c
asm-offsets.c ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems 2021-12-06 12:49:17 +01:00
atags.h ARM: 9011/1: centralize phys-to-virt conversion of DT/ATAGS address 2020-10-27 12:10:59 +00:00
atags_compat.c
atags_parse.c ARM: 9011/1: centralize phys-to-virt conversion of DT/ATAGS address 2020-10-27 12:10:59 +00:00
atags_proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
bios32.c ARM/PCI: Remove unused fields from struct hw_pci 2020-09-18 22:39:09 +01:00
bugs.c
cpuidle.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
debug.S ARM: 9005/1: debug: Select flow control for all debug UARTs 2020-09-15 14:35:28 +01:00
devtree.c ARM: Use of_get_cpu_hwid() 2021-10-20 13:36:30 -05:00
dma-isa.c
dma.c
early_printk.c
efi.c
elf.c
entry-armv.S ARM: 9201/1: spectre-bhb: rely on linker to emit cross-section literal loads 2022-05-20 12:33:47 +01:00
entry-common.S RCU pull request for v5.20 (or whatever) 2022-08-02 19:12:45 -07:00
entry-ftrace.S ARM: ftrace: enable the graph tracer with the EABI unwinder 2022-02-09 09:13:59 +01:00
entry-header.S context_tracking: Split user tracking Kconfig 2022-06-29 17:04:09 -07:00
entry-v7m.S ARM: v7m: enable support for IRQ stacks 2021-12-06 12:49:17 +01:00
fiq.c
fiqasm.S
ftrace.c ftrace: Remove return value of ftrace_arch_modify_*() 2022-05-26 21:13:00 -04:00
head-common.S ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems 2021-12-06 12:49:17 +01:00
head-inflate-data.c
head-nommu.S ARM: 9160/1: NOMMU: Reload __secondary_data after PROCINFO_INITFUNC 2021-12-17 12:02:16 +00:00
head.S ARM: head.S: rename PMD_ORDER to PMD_ENTRY_ORDER 2022-07-17 17:14:44 -07:00
hibernate.c
hw_breakpoint.c ARM: 9206/1: A9: Add ARM ERRATA 764319 workaround (Updated) 2022-05-20 12:33:48 +01:00
hyp-stub.S Merge branch 'devel-stable' into for-next 2020-12-21 11:19:26 +00:00
insn.c ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link() 2021-06-07 12:56:20 +01:00
io.c
irq.c asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig. 2022-09-05 17:20:55 +02:00
isa.c
iwmmxt.h ARM: 9029/1: Make iwmmxt.S support Clang's integrated assembler 2020-12-08 10:14:59 +00:00
iwmmxt.S ARM: 9029/1: Make iwmmxt.S support Clang's integrated assembler 2020-12-08 10:14:59 +00:00
jump_label.c jump_label: make initial NOP patching the special case 2022-06-24 09:48:55 +02:00
kgdb.c ARM: Fix kgdb breakpoint for Thumb2 2022-02-21 14:56:53 +00:00
machine_kexec.c ARM: 9060/1: kexec: Remove unused kexec_reinit callback 2021-03-09 10:25:35 +00:00
Makefile ARM development updates for 5.18: 2022-03-23 17:35:57 -07:00
module-plts.c ARM: 9098/1: ftrace: MODULE_PLT: Fix build problem without DYNAMIC_FTRACE 2021-07-05 11:52:26 +01:00
module.c ARM: 9204/2: module: Add all unwind tables when load module 2022-05-20 12:34:55 +01:00
opcodes.c
paravirt.c x86/paravirt: Switch time pvops functions to use static_call() 2021-03-11 16:17:52 +01:00
patch.c
perf_callchain.c perf: Drop dead and useless guest "support" from arm, csky, nds32 and riscv 2021-11-17 14:49:07 +01:00
perf_event_v6.c
perf_event_v7.c arm_pmu: Fix write counter incorrect in ARMv7 big-endian mode 2021-06-01 14:17:01 +01:00
perf_event_xscale.c
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
phys2virt.S ARM: p2v: reduce p2v alignment requirement to 2 MiB 2020-10-28 16:59:43 +01:00
pj4-cp0.c
process.c fork: Generalize PF_IO_WORKER handling 2022-05-07 09:01:59 -05:00
psci_smp.c
ptrace.c ptrace: Create ptrace_report_syscall_{entry,exit} in ptrace.h 2022-03-10 13:35:08 -06:00
reboot.c ARM: 9219/1: fix undeclared soft_restart 2022-07-28 15:09:17 +01:00
reboot.h
relocate_kernel.S ARM: kexec: fix oops after TLB are invalidated 2021-02-05 10:23:29 +00:00
return_address.c ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value 2022-10-21 12:39:20 +02:00
setup.c ARM fixes for 5.18-rc1: 2022-04-03 10:17:48 -07:00
signal.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-04-22 12:14:05 +02:00
signal.h
sigreturn_codes.S
sleep.S ARM: mm: switch to swapper_pg_dir early for vmap'ed stack 2022-01-24 20:37:55 +01:00
smccc-call.S ARM: 9075/1: kernel: Fix interrupted SMC calls 2021-04-18 19:15:14 +01:00
smp.c profile: setup_profiling_timer() is moslty not implemented 2022-07-29 18:12:36 -07:00
smp_scu.c
smp_tlb.c
smp_twd.c
spectre.c ARM: fix build error when BPF_SYSCALL is disabled 2022-03-08 12:53:05 -08:00
stacktrace.c ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value 2022-10-21 12:39:20 +02:00
suspend.c ARM: 9066/1: ftrace: pause/unpause function graph tracer in cpu_suspend() 2021-03-25 10:27:42 +00:00
swp_emulate.c uaccess: fix type mismatch warnings from access_ok() 2022-02-25 09:36:05 +01:00
sys_arm.c
sys_oabi-compat.c ARM: 9110/1: oabi-compat: fix oabi epoll sparse warning 2021-08-20 11:39:27 +01:00
tcm.c
thumbee.c
time.c ARM: rpc: use legacy_timer_tick 2020-10-30 21:57:05 +01:00
topology.c ARM, sched/topology: Revert back to default scheduler topology 2020-08-19 10:49:47 +02:00
traps.c asm-generic updates for 5.18 2022-03-23 18:03:08 -07:00
unwind.c ARM: unwind: only permit stack switch when unwinding call_with_stack() 2022-03-11 13:01:00 +00:00
v7m.c
vdso.c mm: forbid splitting special mappings 2020-12-15 12:13:41 -08:00
vmlinux-xip.lds.S Merge branches 'devel-stable' and 'misc' into for-linus 2021-11-02 09:04:22 +00:00
vmlinux.lds.S ARM: implement support for vmap'ed stacks 2021-12-03 15:11:33 +01:00
xscale-cp0.c