]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jul 2014 19:00:37 +0000 (12:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jul 2014 19:00:37 +0000 (12:00 -0700)
added patches:
arc-implement-ptrace-ptrace_get_thread_area.patch
sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch

queue-3.10/arc-implement-ptrace-ptrace_get_thread_area.patch [new file with mode: 0644]
queue-3.10/sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/arc-implement-ptrace-ptrace_get_thread_area.patch b/queue-3.10/arc-implement-ptrace-ptrace_get_thread_area.patch
new file mode 100644 (file)
index 0000000..44323f3
--- /dev/null
@@ -0,0 +1,44 @@
+From a4b6cb735b25aa84a462a1985e3e43bebaf5beb4 Mon Sep 17 00:00:00 2001
+From: Anton Kolesov <Anton.Kolesov@synopsys.com>
+Date: Fri, 20 Jun 2014 20:28:39 +0400
+Subject: ARC: Implement ptrace(PTRACE_GET_THREAD_AREA)
+
+From: Anton Kolesov <Anton.Kolesov@synopsys.com>
+
+commit a4b6cb735b25aa84a462a1985e3e43bebaf5beb4 upstream.
+
+This patch adds implementation of GET_THREAD_AREA ptrace request type. This
+is required by GDB to debug NPTL applications.
+
+Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/include/uapi/asm/ptrace.h |    1 +
+ arch/arc/kernel/ptrace.c           |    4 ++++
+ 2 files changed, 5 insertions(+)
+
+--- a/arch/arc/include/uapi/asm/ptrace.h
++++ b/arch/arc/include/uapi/asm/ptrace.h
+@@ -11,6 +11,7 @@
+ #ifndef _UAPI__ASM_ARC_PTRACE_H
+ #define _UAPI__ASM_ARC_PTRACE_H
++#define PTRACE_GET_THREAD_AREA        25
+ #ifndef __ASSEMBLY__
+ /*
+--- a/arch/arc/kernel/ptrace.c
++++ b/arch/arc/kernel/ptrace.c
+@@ -136,6 +136,10 @@ long arch_ptrace(struct task_struct *chi
+       pr_debug("REQ=%ld: ADDR =0x%lx, DATA=0x%lx)\n", request, addr, data);
+       switch (request) {
++      case PTRACE_GET_THREAD_AREA:
++              ret = put_user(task_thread_info(child)->thr_ptr,
++                             (unsigned long __user *)data);
++              break;
+       default:
+               ret = ptrace_request(child, request, addr, data);
+               break;
diff --git a/queue-3.10/sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch b/queue-3.10/sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch
new file mode 100644 (file)
index 0000000..eac858c
--- /dev/null
@@ -0,0 +1,44 @@
+From b0ab99e7736af88b8ac1b7ae50ea287fffa2badc Mon Sep 17 00:00:00 2001
+From: Mateusz Guzik <mguzik@redhat.com>
+Date: Sat, 14 Jun 2014 15:00:09 +0200
+Subject: sched: Fix possible divide by zero in avg_atom() calculation
+
+From: Mateusz Guzik <mguzik@redhat.com>
+
+commit b0ab99e7736af88b8ac1b7ae50ea287fffa2badc upstream.
+
+proc_sched_show_task() does:
+
+  if (nr_switches)
+       do_div(avg_atom, nr_switches);
+
+nr_switches is unsigned long and do_div truncates it to 32 bits, which
+means it can test non-zero on e.g. x86-64 and be truncated to zero for
+division.
+
+Fix the problem by using div64_ul() instead.
+
+As a side effect calculations of avg_atom for big nr_switches are now correct.
+
+Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
+Signed-off-by: Peter Zijlstra <peterz@infradead.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Link: http://lkml.kernel.org/r/1402750809-31991-1-git-send-email-mguzik@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/sched/debug.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/sched/debug.c
++++ b/kernel/sched/debug.c
+@@ -551,7 +551,7 @@ void proc_sched_show_task(struct task_st
+               avg_atom = p->se.sum_exec_runtime;
+               if (nr_switches)
+-                      do_div(avg_atom, nr_switches);
++                      avg_atom = div64_ul(avg_atom, nr_switches);
+               else
+                       avg_atom = -1LL;
index 2d3440b5039bb1c9b3404d66b389f03fb7054264..93a444f4f87f77f64a33d31dccdf25bd9a669e18 100644 (file)
@@ -52,3 +52,5 @@ dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch
 dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch
 pm-sleep-fix-request_firmware-error-at-resume.patch
 locking-mutex-disable-optimistic-spinning-on-some-architectures.patch
+sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch
+arc-implement-ptrace-ptrace_get_thread_area.patch