Lines Matching full:frame
16 * Unwind the current stack frame and store the new register values in the
47 static int frame_pointer_check(struct stackframe *frame) in frame_pointer_check() argument
50 unsigned long fp = frame->fp; in frame_pointer_check()
51 unsigned long pc = frame->pc; in frame_pointer_check()
63 low = frame->sp; in frame_pointer_check()
66 /* check current frame pointer is within bounds */ in frame_pointer_check()
78 int notrace unwind_frame(struct stackframe *frame) in unwind_frame() argument
80 unsigned long fp = frame->fp; in unwind_frame()
82 if (frame_pointer_check(frame)) in unwind_frame()
89 if (frame->ex_frame) { in unwind_frame()
90 struct pt_regs *regs = (struct pt_regs *)frame->sp; in unwind_frame()
96 * when frame->ex_frame is a false positive. in unwind_frame()
98 if ((unsigned long)®s[1] > ALIGN(frame->sp, THREAD_SIZE)) in unwind_frame()
101 frame->pc = regs->ARM_pc; in unwind_frame()
102 frame->ex_frame = false; in unwind_frame()
106 /* restore the registers from the stack frame */ in unwind_frame()
108 frame->sp = frame->fp; in unwind_frame()
109 frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); in unwind_frame()
110 frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 4)); in unwind_frame()
112 frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 12)); in unwind_frame()
113 frame->sp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 8)); in unwind_frame()
114 frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 4)); in unwind_frame()
117 if (is_kretprobe_trampoline(frame->pc)) in unwind_frame()
118 frame->pc = kretprobe_find_ret_addr(frame->tsk, in unwind_frame()
119 (void *)frame->fp, &frame->kr_cur); in unwind_frame()
122 if (in_entry_text(frame->pc)) in unwind_frame()
123 frame->ex_frame = true; in unwind_frame()
129 void notrace walk_stackframe(struct stackframe *frame, in walk_stackframe() argument
135 if (!fn(data, frame->pc)) in walk_stackframe()
137 ret = unwind_frame(frame); in walk_stackframe()
145 static void start_stack_trace(struct stackframe *frame, struct task_struct *task, in start_stack_trace() argument
149 frame->fp = fp; in start_stack_trace()
150 frame->sp = sp; in start_stack_trace()
151 frame->lr = lr; in start_stack_trace()
152 frame->pc = pc; in start_stack_trace()
154 frame->kr_cur = NULL; in start_stack_trace()
155 frame->tsk = task; in start_stack_trace()
158 frame->ex_frame = in_entry_text(frame->pc); in start_stack_trace()
165 struct stackframe frame; in arch_stack_walk() local
168 start_stack_trace(&frame, NULL, regs->ARM_fp, regs->ARM_sp, in arch_stack_walk()
179 start_stack_trace(&frame, task, thread_saved_fp(task), in arch_stack_walk()
185 start_stack_trace(&frame, task, in arch_stack_walk()
191 if (unwind_frame(&frame)) in arch_stack_walk()
195 walk_stackframe(&frame, consume_entry, cookie); in arch_stack_walk()