arm64: report correct stack pointer in KSTK_ESP for compat tasks
authorWill Deacon <will.deacon@arm.com>
Fri, 29 Aug 2014 15:11:10 +0000 (16:11 +0100)
committerGreg Hackmann <ghackmann@google.com>
Fri, 29 Aug 2014 23:49:10 +0000 (16:49 -0700)
commitdc52724b7222f368c49b578787b2fd876c796fc7
treef99fb2a0c0c5366329187128ecb79549efa276f0
parent8db0b1851e5e636d61c9d0d15fc4f5de4af0857c
arm64: report correct stack pointer in KSTK_ESP for compat tasks

The KSTK_ESP macro is used to determine the user stack pointer for a
given task. In particular, this is used to to report the '[stack]' VMA
in /proc/self/maps, which is used by Android to determine the stack
location for children of the main thread.

This patch fixes the macro to use user_stack_pointer instead of directly
returning sp. This means that we report w13 instead of sp, since the
former is used as the stack pointer when executing in AArch32 state.

Cc: <stable@vger.kernel.org>
Reported-by: Serban Constantinescu <Serban.Constantinescu@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/processor.h