]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: apply stack bias to user stack walks on SPARC
authorNick Alcock <nick.alcock@oracle.com>
Fri, 29 Jan 2016 15:04:40 +0000 (15:04 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 3 Feb 2016 16:37:06 +0000 (16:37 +0000)
We were walking the stack without applying the stack bias, leading to a
big chunk of the start of the stack being cut off (often all of it).

Orabug: 22629102
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
dtrace/dtrace_isa.c

index f107b425d924a1a74ace5316ac9ac67a01dd4eff..8b5e8c40ccb627ff97cb28597d6a7d525020c5ea 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/smp.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
+#include <asm/ptrace.h>
 #include <asm/stacktrace.h>
 
 #include "dtrace.h"
@@ -232,8 +233,10 @@ unsigned long dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack,
 
 #ifdef CONFIG_X86_64
        tos = current_user_stack_pointer();
+#elif defined(STACK_BIAS)
+       tos = user_stack_pointer(current_pt_regs()) + STACK_BIAS;
 #else
-       tos = user_stack_pointer(current_pt_regs());
+#error Not x86-64 nor a stack-biased platform, porting needed
 #endif
        stack_vma = find_user_vma(p, mm, NULL, (unsigned long) tos, 0);
        if (!stack_vma ||