]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
more .25 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 30 Jun 2008 16:39:23 +0000 (09:39 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 30 Jun 2008 16:39:23 +0000 (09:39 -0700)
queue-2.6.25/ptrace-get-set-fpxregs-broken.patch [new file with mode: 0644]
queue-2.6.25/sched-fix-cpu-hotplug.patch [new file with mode: 0644]
queue-2.6.25/series
queue-2.6.25/x86-fix-cpu-hotplug-crash.patch [new file with mode: 0644]

diff --git a/queue-2.6.25/ptrace-get-set-fpxregs-broken.patch b/queue-2.6.25/ptrace-get-set-fpxregs-broken.patch
new file mode 100644 (file)
index 0000000..b49cdb0
--- /dev/null
@@ -0,0 +1,115 @@
+From stable-bounces@linux.kernel.org Mon Jun 30 09:22:46 2008
+From: TAKADA Yoshihito <takada@mbf.nifty.com>
+Date: Mon, 30 Jun 2008 18:22:07 +0200
+Subject: ptrace GET/SET FPXREGS broken
+To: stable@kernel.org
+Message-ID: <20080630162207.GC17710@elte.hu>
+Content-Disposition: inline
+
+From: TAKADA Yoshihito <takada@mbf.nifty.com>
+
+Commit 11dbc963a8f6128595d0f6ecf138dc369e144997 upstream
+
+ptrace GET/SET FPXREGS broken
+
+When I update kernel 2.6.25 from 2.6.24, gdb does not work.
+On 2.6.25, ptrace(PTRACE_GETFPXREGS, ...) returns ENODEV.
+
+But 2.6.24 kernel's ptrace() returns EIO.
+It is issue of compatibility.
+
+I attached test program as pt.c and patch for fix it.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+
+struct user_fxsr_struct {
+       unsigned short  cwd;
+       unsigned short  swd;
+       unsigned short  twd;
+       unsigned short  fop;
+       long    fip;
+       long    fcs;
+       long    foo;
+       long    fos;
+       long    mxcsr;
+       long    reserved;
+       long    st_space[32];   /* 8*16 bytes for each FP-reg = 128 bytes */
+       long    xmm_space[32];  /* 8*16 bytes for each XMM-reg = 128 bytes */
+       long    padding[56];
+};
+
+int main(void)
+{
+  pid_t pid;
+
+  pid = fork();
+
+  switch(pid){
+  case -1:/*  error */
+    break;
+  case 0:/*  child */
+    child();
+    break;
+  default:
+    parent(pid);
+    break;
+  }
+  return 0;
+}
+
+int child(void)
+{
+  ptrace(PTRACE_TRACEME);
+  kill(getpid(), SIGSTOP);
+  sleep(10);
+  return 0;
+}
+int parent(pid_t pid)
+{
+  int ret;
+  struct user_fxsr_struct fpxregs;
+
+  ret = ptrace(PTRACE_GETFPXREGS, pid, 0, &fpxregs);
+  if(ret < 0){
+    printf("%d: %s.\n", errno, strerror(errno));
+  }
+  kill(pid, SIGCONT);
+  wait(pid);
+  return 0;
+}
+
+/* in the kerel, at kernel/i387.c get_fpxregs() */
+
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/i387.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/kernel/i387.c
++++ b/arch/x86/kernel/i387.c
+@@ -130,7 +130,7 @@ int xfpregs_get(struct task_struct *targ
+               void *kbuf, void __user *ubuf)
+ {
+       if (!cpu_has_fxsr)
+-              return -ENODEV;
++              return -EIO;
+       init_fpu(target);
+@@ -145,7 +145,7 @@ int xfpregs_set(struct task_struct *targ
+       int ret;
+       if (!cpu_has_fxsr)
+-              return -ENODEV;
++              return -EIO;
+       init_fpu(target);
+       set_stopped_child_used_math(target);
diff --git a/queue-2.6.25/sched-fix-cpu-hotplug.patch b/queue-2.6.25/sched-fix-cpu-hotplug.patch
new file mode 100644 (file)
index 0000000..2f17aa2
--- /dev/null
@@ -0,0 +1,48 @@
+From stable-bounces@linux.kernel.org Mon Jun 30 09:23:13 2008
+From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
+Date: Mon, 30 Jun 2008 18:22:34 +0200
+Subject: sched: fix cpu hotplug
+To: stable@kernel.org
+Message-ID: <20080630162234.GD17710@elte.hu>
+Content-Disposition: inline
+
+From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
+
+Commit 79c537998d143b127c8c662a403c3356cb885f1c upstream
+
+the CPU hotplug problems (crashes under high-volume unplug+replug
+tests) seem to be related to migrate_dead_tasks().
+
+Firstly I added traces to see all tasks being migrated with
+migrate_live_tasks() and migrate_dead_tasks(). On my setup the problem
+pops up (the one with "se == NULL" in the loop of
+pick_next_task_fair()) shortly after the traces indicate that some has
+been migrated with migrate_dead_tasks()). btw., I can reproduce it
+much faster now with just a plain cpu down/up loop.
+
+[disclaimer] Well, unless I'm really missing something important in
+this late hour [/desclaimer] pick_next_task() is not something
+appropriate for migrate_dead_tasks() :-)
+
+the following change seems to eliminate the problem on my setup
+(although, I kept it running only for a few minutes to get a few
+messages indicating migrate_dead_tasks() does move tasks and the
+system is still ok)
+
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/sched.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/kernel/sched.c
++++ b/kernel/sched.c
+@@ -5728,6 +5728,7 @@ static void migrate_dead_tasks(unsigned 
+               next = pick_next_task(rq, rq->curr);
+               if (!next)
+                       break;
++              next->sched_class->put_prev_task(rq, next);
+               migrate_dead(dead_cpu, next);
+       }
index bb700f4ff7322887600f458a5611f3a0f09cfeb9..229da85b2def99369cdb1d28ea9815b83ead27af 100644 (file)
@@ -4,3 +4,6 @@ futexes-fix-fault-handling-in-futex_lock_pi.patch
 ib-mthca-clear-icm-pages-before-handing-to-fw.patch
 drm-enable-bus-mastering-on-i915-at-resume-time.patch
 x86_64-ptrace-fix-sys32_ptrace-task_struct-leak.patch
+sched-fix-cpu-hotplug.patch
+ptrace-get-set-fpxregs-broken.patch
+x86-fix-cpu-hotplug-crash.patch
diff --git a/queue-2.6.25/x86-fix-cpu-hotplug-crash.patch b/queue-2.6.25/x86-fix-cpu-hotplug-crash.patch
new file mode 100644 (file)
index 0000000..7a49c58
--- /dev/null
@@ -0,0 +1,60 @@
+From stable-bounces@linux.kernel.org Mon Jun 30 09:22:34 2008
+From: Yanmin Zhang <yanmin_zhang@linux.intel.com>
+Date: Mon, 30 Jun 2008 18:21:54 +0200
+Subject: x86: fix cpu hotplug crash
+To: stable@kernel.org
+Message-ID: <20080630162154.GB17710@elte.hu>
+Content-Disposition: inline
+
+From: Yanmin Zhang <yanmin_zhang@linux.intel.com>
+
+Commit fcb43042ef55d2f46b0efa5d7746967cef38f056 upstream
+
+x86: fix cpu hotplug crash
+
+Vegard Nossum reported crashes during cpu hotplug tests:
+
+  http://marc.info/?l=linux-kernel&m=121413950227884&w=4
+
+In function _cpu_up, the panic happens when calling
+__raw_notifier_call_chain at the second time. Kernel doesn't panic when
+calling it at the first time. If just say because of nr_cpu_ids, that's
+not right.
+
+By checking the source code, I found that function do_boot_cpu is the culprit.
+Consider below call chain:
+ _cpu_up=>__cpu_up=>smp_ops.cpu_up=>native_cpu_up=>do_boot_cpu.
+
+So do_boot_cpu is called in the end. In do_boot_cpu, if
+boot_error==true, cpu_clear(cpu, cpu_possible_map) is executed. So later
+on, when _cpu_up calls __raw_notifier_call_chain at the second time to
+report CPU_UP_CANCELED, because this cpu is already cleared from
+cpu_possible_map, get_cpu_sysdev returns NULL.
+
+Many resources are related to cpu_possible_map, so it's better not to
+change it.
+
+Below patch against 2.6.26-rc7 fixes it by removing the bit clearing in
+cpu_possible_map.
+
+Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>
+Tested-by: Vegard Nossum <vegard.nossum@gmail.com>
+Acked-by: Rusty Russell <rusty@rustcorp.com.au>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ arch/x86/kernel/smpboot_64.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/arch/x86/kernel/smpboot_64.c
++++ b/arch/x86/kernel/smpboot_64.c
+@@ -704,7 +704,6 @@ do_rest:
+               clear_bit(cpu, (unsigned long *)&cpu_initialized); /* was set by cpu_init() */
+               clear_node_cpumask(cpu); /* was set by numa_add_cpu */
+               cpu_clear(cpu, cpu_present_map);
+-              cpu_clear(cpu, cpu_possible_map);
+               per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID;
+               return -EIO;
+       }