]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Oct 2014 19:52:10 +0000 (12:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Oct 2014 19:52:10 +0000 (12:52 -0700)
added patches:
powerpc-perf-fix-abiv2-kernel-backtraces.patch

queue-3.10/powerpc-perf-fix-abiv2-kernel-backtraces.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/powerpc-perf-fix-abiv2-kernel-backtraces.patch b/queue-3.10/powerpc-perf-fix-abiv2-kernel-backtraces.patch
new file mode 100644 (file)
index 0000000..9a0fffe
--- /dev/null
@@ -0,0 +1,85 @@
+From 85101af13bb854a6572fa540df7c7201958624b9 Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton@samba.org>
+Date: Tue, 26 Aug 2014 12:44:15 +1000
+Subject: powerpc/perf: Fix ABIv2 kernel backtraces
+
+From: Anton Blanchard <anton@samba.org>
+
+commit 85101af13bb854a6572fa540df7c7201958624b9 upstream.
+
+ABIv2 kernels are failing to backtrace through the kernel. An example:
+
+39.30%  readseek2_proce  [kernel.kallsyms]    [k] find_get_entry
+            |
+            --- find_get_entry
+               __GI___libc_read
+
+The problem is in valid_next_sp() where we check that the new stack
+pointer is at least STACK_FRAME_OVERHEAD below the previous one.
+
+ABIv1 has a minimum stack frame size of 112 bytes consisting of 48 bytes
+and 64 bytes of parameter save area. ABIv2 changes that to 32 bytes
+with no paramter save area.
+
+STACK_FRAME_OVERHEAD is in theory the minimum stack frame size,
+but we over 240 uses of it, some of which assume that it includes
+space for the parameter area.
+
+We need to work through all our stack defines and rationalise them
+but let's fix perf now by creating STACK_FRAME_MIN_SIZE and using
+in valid_next_sp(). This fixes the issue:
+
+30.64%  readseek2_proce  [kernel.kallsyms]    [k] find_get_entry
+            |
+            --- find_get_entry
+               pagecache_get_page
+               generic_file_read_iter
+               new_sync_read
+               vfs_read
+               sys_read
+               syscall_exit
+               __GI___libc_read
+
+Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
+Signed-off-by: Anton Blanchard <anton@samba.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/include/asm/ptrace.h |    7 +++++++
+ arch/powerpc/perf/callchain.c     |    2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+--- a/arch/powerpc/include/asm/ptrace.h
++++ b/arch/powerpc/include/asm/ptrace.h
+@@ -35,6 +35,12 @@
+                                       STACK_FRAME_OVERHEAD + 288)
+ #define STACK_FRAME_MARKER    12
++#if defined(_CALL_ELF) && _CALL_ELF == 2
++#define STACK_FRAME_MIN_SIZE  32
++#else
++#define STACK_FRAME_MIN_SIZE  STACK_FRAME_OVERHEAD
++#endif
++
+ /* Size of dummy stack frame allocated when calling signal handler. */
+ #define __SIGNAL_FRAMESIZE    128
+ #define __SIGNAL_FRAMESIZE32  64
+@@ -46,6 +52,7 @@
+ #define STACK_FRAME_REGS_MARKER       ASM_CONST(0x72656773)
+ #define STACK_INT_FRAME_SIZE  (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
+ #define STACK_FRAME_MARKER    2
++#define STACK_FRAME_MIN_SIZE  STACK_FRAME_OVERHEAD
+ /* Size of stack frame allocated when calling signal handler. */
+ #define __SIGNAL_FRAMESIZE    64
+--- a/arch/powerpc/perf/callchain.c
++++ b/arch/powerpc/perf/callchain.c
+@@ -35,7 +35,7 @@ static int valid_next_sp(unsigned long s
+               return 0;               /* must be 16-byte aligned */
+       if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
+               return 0;
+-      if (sp >= prev_sp + STACK_FRAME_OVERHEAD)
++      if (sp >= prev_sp + STACK_FRAME_MIN_SIZE)
+               return 1;
+       /*
+        * sp could decrease when we jump off an interrupt stack
index 38effe9a0698b37b43e9b1d0595843a234652a19..513087058d91add302ab0aa7a3fa24d6daef091e 100644 (file)
@@ -116,3 +116,4 @@ fs-notify-don-t-show-f_handle-if-exportfs_encode_inode_fh-failed.patch
 nilfs2-fix-data-loss-with-mmap.patch
 ocfs2-dlm-do-not-get-resource-spinlock-if-lockres-is-new.patch
 sched-fix-unreleased-llc_shared_mask-bit-during-cpu-hotplug.patch
+powerpc-perf-fix-abiv2-kernel-backtraces.patch