Merge tag 'mips_4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips
[sfrench/cifs-2.6.git] / arch / arm / kernel / stacktrace.c
index 65228bf4c6dfee221e4e3a38112c0d59ecda65f9..a56e7c856ab5648995888ae5f47c5d1ab23b08bf 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/sched/debug.h>
 #include <linux/stacktrace.h>
 
+#include <asm/sections.h>
 #include <asm/stacktrace.h>
 #include <asm/traps.h>
 
@@ -63,7 +64,6 @@ EXPORT_SYMBOL(walk_stackframe);
 #ifdef CONFIG_STACKTRACE
 struct stack_trace_data {
        struct stack_trace *trace;
-       unsigned long last_pc;
        unsigned int no_sched_functions;
        unsigned int skip;
 };
@@ -87,16 +87,7 @@ static int save_trace(struct stackframe *frame, void *d)
        if (trace->nr_entries >= trace->max_entries)
                return 1;
 
-       /*
-        * in_exception_text() is designed to test if the PC is one of
-        * the functions which has an exception stack above it, but
-        * unfortunately what is in frame->pc is the return LR value,
-        * not the saved PC value.  So, we need to track the previous
-        * frame PC value when doing this.
-        */
-       addr = data->last_pc;
-       data->last_pc = frame->pc;
-       if (!in_exception_text(addr))
+       if (!in_entry_text(frame->pc))
                return 0;
 
        regs = (struct pt_regs *)frame->sp;
@@ -114,7 +105,6 @@ static noinline void __save_stack_trace(struct task_struct *tsk,
        struct stackframe frame;
 
        data.trace = trace;
-       data.last_pc = ULONG_MAX;
        data.skip = trace->skip;
        data.no_sched_functions = nosched;