Commit 826a307b authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc: Rename 'tsk' parameter into 'task'

To better match generic code, rename 'tsk' to 'task' in
some stacktrace functions in preparation of following
patch which converts powerpc to generic ARCH_STACKWALK.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/117f0200e11961af6c0fdf85c98373e5dcf96a47.1615881400.git.christophe.leroy@csgroup.eu
parent accdd093
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
* Save stack-backtrace addresses into a stack_trace buffer. * Save stack-backtrace addresses into a stack_trace buffer.
*/ */
static void save_context_stack(struct stack_trace *trace, unsigned long sp, static void save_context_stack(struct stack_trace *trace, unsigned long sp,
struct task_struct *tsk, int savesched) struct task_struct *task, int savesched)
{ {
for (;;) { for (;;) {
unsigned long *stack = (unsigned long *) sp; unsigned long *stack = (unsigned long *) sp;
unsigned long newsp, ip; unsigned long newsp, ip;
if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD)) if (!validate_sp(sp, task, STACK_FRAME_OVERHEAD))
return; return;
newsp = stack[0]; newsp = stack[0];
...@@ -94,18 +94,18 @@ EXPORT_SYMBOL_GPL(save_stack_trace_regs); ...@@ -94,18 +94,18 @@ EXPORT_SYMBOL_GPL(save_stack_trace_regs);
* *
* If the task is not 'current', the caller *must* ensure the task is inactive. * If the task is not 'current', the caller *must* ensure the task is inactive.
*/ */
static int __save_stack_trace_tsk_reliable(struct task_struct *tsk, static int __save_stack_trace_tsk_reliable(struct task_struct *task,
struct stack_trace *trace) struct stack_trace *trace)
{ {
unsigned long sp; unsigned long sp;
unsigned long newsp; unsigned long newsp;
unsigned long stack_page = (unsigned long)task_stack_page(tsk); unsigned long stack_page = (unsigned long)task_stack_page(task);
unsigned long stack_end; unsigned long stack_end;
int graph_idx = 0; int graph_idx = 0;
bool firstframe; bool firstframe;
stack_end = stack_page + THREAD_SIZE; stack_end = stack_page + THREAD_SIZE;
if (!is_idle_task(tsk)) { if (!is_idle_task(task)) {
/* /*
* For user tasks, this is the SP value loaded on * For user tasks, this is the SP value loaded on
* kernel entry, see "PACAKSAVE(r13)" in _switch() and * kernel entry, see "PACAKSAVE(r13)" in _switch() and
...@@ -129,10 +129,10 @@ static int __save_stack_trace_tsk_reliable(struct task_struct *tsk, ...@@ -129,10 +129,10 @@ static int __save_stack_trace_tsk_reliable(struct task_struct *tsk,
stack_end -= STACK_FRAME_OVERHEAD; stack_end -= STACK_FRAME_OVERHEAD;
} }
if (tsk == current) if (task == current)
sp = current_stack_frame(); sp = current_stack_frame();
else else
sp = tsk->thread.ksp; sp = task->thread.ksp;
if (sp < stack_page + sizeof(struct thread_struct) || if (sp < stack_page + sizeof(struct thread_struct) ||
sp > stack_end - STACK_FRAME_MIN_SIZE) { sp > stack_end - STACK_FRAME_MIN_SIZE) {
...@@ -181,7 +181,7 @@ static int __save_stack_trace_tsk_reliable(struct task_struct *tsk, ...@@ -181,7 +181,7 @@ static int __save_stack_trace_tsk_reliable(struct task_struct *tsk,
* FIXME: IMHO these tests do not belong in * FIXME: IMHO these tests do not belong in
* arch-dependent code, they are generic. * arch-dependent code, they are generic.
*/ */
ip = ftrace_graph_ret_addr(tsk, &graph_idx, ip, stack); ip = ftrace_graph_ret_addr(task, &graph_idx, ip, stack);
#ifdef CONFIG_KPROBES #ifdef CONFIG_KPROBES
/* /*
* Mark stacktraces with kretprobed functions on them * Mark stacktraces with kretprobed functions on them
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment