ARM64: unwind: Fix PC calculation
authorOlof Johansson <olof@lixom.net>
Fri, 14 Feb 2014 19:35:15 +0000 (19:35 +0000)
committerJiri Slaby <jslaby@suse.cz>
Wed, 5 Mar 2014 16:13:54 +0000 (17:13 +0100)
commitb9cac36b22d4a4c4dca3a42b63931702bd4cc4c8
treeb45370ee51a254e8a4daa76c9e30bc62a0b3f04d
parent23c0ac16e67d6583d4ca1fa1e1bbf4e66d019bb2
ARM64: unwind: Fix PC calculation

commit e306dfd06fcb44d21c80acb8e5a88d55f3d1cf63 upstream.

The frame PC value in the unwind code used to just take the saved LR
value and use that.  That's incorrect as a stack trace, since it shows
the return path stack, not the call path stack.

In particular, it shows faulty information in case the bl is done as
the very last instruction of one label, since the return point will be
in the next label. That can easily be seen with tail calls to panic(),
which is marked __noreturn and thus doesn't have anything useful after it.

Easiest here is to just correct the unwind code and do a -4, to get the
actual call site for the backtrace instead of the return site.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm64/kernel/stacktrace.c