diff options
author | Kerwin Wan <kerwinw@nvidia.com> | 2014-06-05 15:28:31 +0800 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2014-06-06 07:27:11 -0700 |
commit | cc0d4317057d190d465e1890c2aed29aef84762d (patch) | |
tree | bc6891af8c11108e4e3d12b94bdd4fa530ca6edd /arch/arm64 | |
parent | fb6db1f5ca883ab0fa889124bfae035cdd978a8e (diff) |
ARM64: fix KSTK_ESP
If a thread is compat, then stack start address is stored in
compat_sp not sp of pt_regs.
Bug 200006667
Change-Id: I4814d4b2a39224e0541ce988f84e038bca7d57bf
Signed-off-by: Kerwin Wan <kerwinw@nvidia.com>
Reviewed-on: http://git-master/r/419378
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/asm/processor.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 1dc42f699073..2d19877563fa 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -161,7 +161,19 @@ extern struct task_struct *cpu_switch_to(struct task_struct *prev, ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) #define KSTK_EIP(tsk) task_pt_regs(tsk)->pc +#ifndef CONFIG_COMPAT #define KSTK_ESP(tsk) task_pt_regs(tsk)->sp +#else +#define KSTK_ESP(tsk) \ +({ \ + u64 ptr; \ + if (is_compat_thread(task_thread_info(tsk))) \ + ptr = task_pt_regs(tsk)->compat_sp; \ + else \ + ptr = task_pt_regs(tsk)->sp; \ + ptr; \ +}) +#endif /* * Prefetching support |