]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
arm64: unwind: remove sp from struct stackframe
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sun, 23 Jul 2017 08:05:38 +0000 (09:05 +0100)
committerMark Rutland <mark.rutland@arm.com>
Wed, 9 Aug 2017 13:10:29 +0000 (14:10 +0100)
The unwind code sets the sp member of struct stackframe to
'frame pointer + 0x10' unconditionally, without regard for whether
doing so produces a legal value. So let's simply remove it now that
we have stopped using it anyway.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/stacktrace.h
arch/arm64/kernel/perf_callchain.c
arch/arm64/kernel/process.c
arch/arm64/kernel/return_address.c
arch/arm64/kernel/stacktrace.c
arch/arm64/kernel/time.c
arch/arm64/kernel/traps.c

index 5b6eafccc5d8f76d95d0208ee058bc1ad38d19d9..3bebab378c7217932e507fca67f2382cde13131d 100644 (file)
@@ -20,7 +20,6 @@ struct task_struct;
 
 struct stackframe {
        unsigned long fp;
-       unsigned long sp;
        unsigned long pc;
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        unsigned int graph;
index 713ca824f266a7fa771b3609ec8dec5264eef3ed..bcafd7dcfe8b186c07c1f7138ca4dc62035aa61e 100644 (file)
@@ -162,7 +162,6 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
        }
 
        frame.fp = regs->regs[29];
-       frame.sp = regs->sp;
        frame.pc = regs->pc;
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        frame.graph = current->curr_ret_stack;
index 659ae8094ed5b1bc3f0f1ae6c6b4297062725864..85b953dd023a9b1219d961545fd696928bcb899d 100644 (file)
@@ -382,15 +382,12 @@ unsigned long get_wchan(struct task_struct *p)
                return 0;
 
        frame.fp = thread_saved_fp(p);
-       frame.sp = thread_saved_sp(p);
        frame.pc = thread_saved_pc(p);
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        frame.graph = p->curr_ret_stack;
 #endif
        do {
-               if (frame.sp < stack_page ||
-                   frame.sp >= stack_page + THREAD_SIZE ||
-                   unwind_frame(p, &frame))
+               if (unwind_frame(p, &frame))
                        goto out;
                if (!in_sched_functions(frame.pc)) {
                        ret = frame.pc;
index 12a87f2600f2f65d03799a44402eabda5024277e..933adbc0f654d84e2e7331a93455ee74c747a091 100644 (file)
@@ -42,7 +42,6 @@ void *return_address(unsigned int level)
        data.addr = NULL;
 
        frame.fp = (unsigned long)__builtin_frame_address(0);
-       frame.sp = current_stack_pointer;
        frame.pc = (unsigned long)return_address; /* dummy */
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        frame.graph = current->curr_ret_stack;
index 81d9262acaf0b1409b70eb658e96f06cd376296c..35588caad9d05c0a1ad889e58d993f5c1881a010 100644 (file)
@@ -58,7 +58,6 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
            !on_task_stack(tsk, fp))
                return -EINVAL;
 
-       frame->sp = fp + 0x10;
        frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp));
        frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8));
 
@@ -136,7 +135,6 @@ void save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace)
        data.no_sched_functions = 0;
 
        frame.fp = regs->regs[29];
-       frame.sp = regs->sp;
        frame.pc = regs->pc;
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        frame.graph = current->curr_ret_stack;
@@ -161,12 +159,10 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
        if (tsk != current) {
                data.no_sched_functions = 1;
                frame.fp = thread_saved_fp(tsk);
-               frame.sp = thread_saved_sp(tsk);
                frame.pc = thread_saved_pc(tsk);
        } else {
                data.no_sched_functions = 0;
                frame.fp = (unsigned long)__builtin_frame_address(0);
-               frame.sp = current_stack_pointer;
                frame.pc = (unsigned long)save_stack_trace_tsk;
        }
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
index da33c90248e98eaf1e14a6a0e0061ccddad21420..a4391280fba9631d69cf8bda434c307956b92668 100644 (file)
@@ -50,7 +50,6 @@ unsigned long profile_pc(struct pt_regs *regs)
                return regs->pc;
 
        frame.fp = regs->regs[29];
-       frame.sp = regs->sp;
        frame.pc = regs->pc;
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        frame.graph = -1; /* no task info */
index 075c29a24345324a04ea96609aa4e0b80882d08d..c2a81bf8827e2ccf2b1cf8a972934d27379a3d97 100644 (file)
@@ -155,14 +155,12 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
 
        if (tsk == current) {
                frame.fp = (unsigned long)__builtin_frame_address(0);
-               frame.sp = current_stack_pointer;
                frame.pc = (unsigned long)dump_backtrace;
        } else {
                /*
                 * task blocked in __switch_to
                 */
                frame.fp = thread_saved_fp(tsk);
-               frame.sp = thread_saved_sp(tsk);
                frame.pc = thread_saved_pc(tsk);
        }
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER