aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorJean Pihet <jean.pihet@linaro.org>2014-02-03 13:18:29 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2014-03-13 07:22:38 -0400
commit5f888a1d33c48900012e6b4c18296ce7c715dc6c (patch)
tree5780cbb3eb57dd931c571c5e92f8f31b26559c58 /arch/arm64
parent23c7d70d55c6d963f225744cd1b996dee68c88d1 (diff)
ARM64: perf: support dwarf unwinding in compat mode
Add support for unwinding using the dwarf information in compat mode. Using the correct user stack pointer allows perf to record the frames correctly in the native and compat modes. Note that although the dwarf frame unwinding works ok using libunwind in native mode (on ARMv7 & ARMv8), some changes are required to the libunwind code for the compat mode. Those changes are posted separately on the libunwind mailing list. Tested on ARMv8 platform with v8 and compat v7 binaries, the latter are statically built. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/include/asm/compat.h2
-rw-r--r--arch/arm64/include/asm/ptrace.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index fda2704b3f9f..e71f81fe127a 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -228,7 +228,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
228 return (u32)(unsigned long)uptr; 228 return (u32)(unsigned long)uptr;
229} 229}
230 230
231#define compat_user_stack_pointer() (current_pt_regs()->compat_sp) 231#define compat_user_stack_pointer() (user_stack_pointer(current_pt_regs()))
232 232
233static inline void __user *arch_compat_alloc_user_space(long len) 233static inline void __user *arch_compat_alloc_user_space(long len)
234{ 234{
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 35ff2f9de072..c7ba261dd4b3 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -133,7 +133,7 @@ struct pt_regs {
133 (!((regs)->pstate & PSR_F_BIT)) 133 (!((regs)->pstate & PSR_F_BIT))
134 134
135#define user_stack_pointer(regs) \ 135#define user_stack_pointer(regs) \
136 ((regs)->sp) 136 (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp)
137 137
138/* 138/*
139 * Are the current registers suitable for user mode? (used to maintain 139 * Are the current registers suitable for user mode? (used to maintain