]> git.baikalelectronics.ru Git - kernel.git/commit
ARM64: unwind: Fix PC calculation
authorOlof Johansson <olof@lixom.net>
Fri, 14 Feb 2014 19:35:15 +0000 (19:35 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 17 Feb 2014 09:16:33 +0000 (09:16 +0000)
commitab5aa12cb092d2d73e3d7d89bdf4b7d8c4f92b2a
tree27dea73b0449bd5790e5897a55d3c64fe0063393
parentaf18dbdc538d68661a2dc170065e02fb49a2ec53
ARM64: unwind: Fix PC calculation

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>
Cc: stable@vger.kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/stacktrace.c