Skip to content

Commit

Permalink
xtensa: fix get_wchan
Browse files Browse the repository at this point in the history
Stack unwinding is implemented incorrectly in xtensa get_wchan: instead
of extracting a0 and a1 registers from the spill location under the
stack pointer it extracts a word pointed to by the stack pointer and
subtracts 4 or 3 from it.

Cc: [email protected]
Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
jcmvbkbc committed Feb 7, 2019
1 parent 579afe8 commit d90b88f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/xtensa/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ unsigned long get_wchan(struct task_struct *p)

/* Stack layout: sp-4: ra, sp-3: sp' */

pc = MAKE_PC_FROM_RA(*(unsigned long*)sp - 4, sp);
sp = *(unsigned long *)sp - 3;
pc = MAKE_PC_FROM_RA(SPILL_SLOT(sp, 0), sp);
sp = SPILL_SLOT(sp, 1);
} while (count++ < 16);
return 0;
}

0 comments on commit d90b88f

Please sign in to comment.