]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2013 23:03:48 +0000 (16:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2013 23:03:48 +0000 (16:03 -0700)
added patches:
ftrace-consistently-restore-trace-function-on-sysctl-enabling.patch
hwspinlock-fix-__hwspin_lock_request-error-path.patch
powerpc-pseries_lpar_hpte_remove-fails-from-adjunct-partition-being-performed-before-the-andcond-test.patch
x86-remove-the-x32-syscall-bitmask-from-syscall_get_nr.patch

queue-3.4/ftrace-consistently-restore-trace-function-on-sysctl-enabling.patch [new file with mode: 0644]
queue-3.4/hwspinlock-fix-__hwspin_lock_request-error-path.patch [new file with mode: 0644]
queue-3.4/powerpc-pseries_lpar_hpte_remove-fails-from-adjunct-partition-being-performed-before-the-andcond-test.patch [new file with mode: 0644]
queue-3.4/series
queue-3.4/x86-remove-the-x32-syscall-bitmask-from-syscall_get_nr.patch [new file with mode: 0644]

diff --git a/queue-3.4/ftrace-consistently-restore-trace-function-on-sysctl-enabling.patch b/queue-3.4/ftrace-consistently-restore-trace-function-on-sysctl-enabling.patch
new file mode 100644 (file)
index 0000000..c45311c
--- /dev/null
@@ -0,0 +1,40 @@
+From 5000c418840b309251c5887f0b56503aae30f84c Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <jan.kiszka@siemens.com>
+Date: Tue, 26 Mar 2013 17:53:03 +0100
+Subject: ftrace: Consistently restore trace function on sysctl enabling
+
+From: Jan Kiszka <jan.kiszka@siemens.com>
+
+commit 5000c418840b309251c5887f0b56503aae30f84c upstream.
+
+If we reenable ftrace via syctl, we currently set ftrace_trace_function
+based on the previous simplistic algorithm. This is inconsistent with
+what update_ftrace_function does. So better call that helper instead.
+
+Link: http://lkml.kernel.org/r/5151D26F.1070702@siemens.com
+
+Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/ftrace.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/kernel/trace/ftrace.c
++++ b/kernel/trace/ftrace.c
+@@ -4381,12 +4381,8 @@ ftrace_enable_sysctl(struct ctl_table *t
+               ftrace_startup_sysctl();
+               /* we are starting ftrace again */
+-              if (ftrace_ops_list != &ftrace_list_end) {
+-                      if (ftrace_ops_list->next == &ftrace_list_end)
+-                              ftrace_trace_function = ftrace_ops_list->func;
+-                      else
+-                              ftrace_trace_function = ftrace_ops_list_func;
+-              }
++              if (ftrace_ops_list != &ftrace_list_end)
++                      update_ftrace_function();
+       } else {
+               /* stopping ftrace calls (just send to ftrace_stub) */
diff --git a/queue-3.4/hwspinlock-fix-__hwspin_lock_request-error-path.patch b/queue-3.4/hwspinlock-fix-__hwspin_lock_request-error-path.patch
new file mode 100644 (file)
index 0000000..9733a9b
--- /dev/null
@@ -0,0 +1,38 @@
+From c10b90d85a5126d25c89cbaa50dc9fdd1c4d001a Mon Sep 17 00:00:00 2001
+From: Li Fei <fei.li@intel.com>
+Date: Fri, 5 Apr 2013 21:20:36 +0800
+Subject: hwspinlock: fix __hwspin_lock_request error path
+
+From: Li Fei <fei.li@intel.com>
+
+commit c10b90d85a5126d25c89cbaa50dc9fdd1c4d001a upstream.
+
+Even in failed case of pm_runtime_get_sync, the usage_count
+is incremented. In order to keep the usage_count with correct
+value and runtime power management to behave correctly, call
+pm_runtime_put_noidle in such case.
+
+In __hwspin_lock_request, module_put is also called before
+return in pm_runtime_get_sync failed case.
+
+Signed-off-by Liu Chuansheng <chuansheng.liu@intel.com>
+Signed-off-by: Li Fei <fei.li@intel.com>
+[edit commit log]
+Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwspinlock/hwspinlock_core.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/hwspinlock/hwspinlock_core.c
++++ b/drivers/hwspinlock/hwspinlock_core.c
+@@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct
+       ret = pm_runtime_get_sync(dev);
+       if (ret < 0) {
+               dev_err(dev, "%s: can't power on device\n", __func__);
++              pm_runtime_put_noidle(dev);
++              module_put(dev->driver->owner);
+               return ret;
+       }
diff --git a/queue-3.4/powerpc-pseries_lpar_hpte_remove-fails-from-adjunct-partition-being-performed-before-the-andcond-test.patch b/queue-3.4/powerpc-pseries_lpar_hpte_remove-fails-from-adjunct-partition-being-performed-before-the-andcond-test.patch
new file mode 100644 (file)
index 0000000..1ef65ac
--- /dev/null
@@ -0,0 +1,42 @@
+From 9fb2640159f9d4f5a2a9d60e490482d4cbecafdb Mon Sep 17 00:00:00 2001
+From: Michael Wolf <mjw@linux.vnet.ibm.com>
+Date: Fri, 5 Apr 2013 10:41:40 +0000
+Subject: powerpc: pSeries_lpar_hpte_remove fails from Adjunct partition being performed before the ANDCOND test
+
+From: Michael Wolf <mjw@linux.vnet.ibm.com>
+
+commit 9fb2640159f9d4f5a2a9d60e490482d4cbecafdb upstream.
+
+Some versions of pHyp will perform the adjunct partition test before the
+ANDCOND test.  The result of this is that H_RESOURCE can be returned and
+cause the BUG_ON condition to occur. The HPTE is not removed.  So add a
+check for H_RESOURCE, it is ok if this HPTE is not removed as
+pSeries_lpar_hpte_remove is looking for an HPTE to remove and not a
+specific HPTE to remove.  So it is ok to just move on to the next slot
+and try again.
+
+Signed-off-by: Michael Wolf <mjw@linux.vnet.ibm.com>
+Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/platforms/pseries/lpar.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/arch/powerpc/platforms/pseries/lpar.c
++++ b/arch/powerpc/platforms/pseries/lpar.c
+@@ -187,7 +187,13 @@ static long pSeries_lpar_hpte_remove(uns
+                                          (0x1UL << 4), &dummy1, &dummy2);
+               if (lpar_rc == H_SUCCESS)
+                       return i;
+-              BUG_ON(lpar_rc != H_NOT_FOUND);
++
++              /*
++               * The test for adjunct partition is performed before the
++               * ANDCOND test.  H_RESOURCE may be returned, so we need to
++               * check for that as well.
++               */
++              BUG_ON(lpar_rc != H_NOT_FOUND && lpar_rc != H_RESOURCE);
+               slot_offset++;
+               slot_offset &= 0x7;
index d9c16807e6d2b898acbd78413fec02684e3be7ed..8c8cf3e6c7e956a26280792fd11ab28e1e958482 100644 (file)
@@ -13,3 +13,7 @@ libata-use-integer-return-value-for-atapi_command_packet_set.patch
 libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch
 alpha-add-irongate_io-to-pci-bus-resources.patch
 ata_piix-fix-dvd-not-dectected-at-some-haswell-platforms.patch
+ftrace-consistently-restore-trace-function-on-sysctl-enabling.patch
+powerpc-pseries_lpar_hpte_remove-fails-from-adjunct-partition-being-performed-before-the-andcond-test.patch
+x86-remove-the-x32-syscall-bitmask-from-syscall_get_nr.patch
+hwspinlock-fix-__hwspin_lock_request-error-path.patch
diff --git a/queue-3.4/x86-remove-the-x32-syscall-bitmask-from-syscall_get_nr.patch b/queue-3.4/x86-remove-the-x32-syscall-bitmask-from-syscall_get_nr.patch
new file mode 100644 (file)
index 0000000..ea3de26
--- /dev/null
@@ -0,0 +1,63 @@
+From 8b4b9f27e57584f3d90e0bb84cf800ad81cfe3a1 Mon Sep 17 00:00:00 2001
+From: Paul Moore <pmoore@redhat.com>
+Date: Fri, 15 Feb 2013 12:21:43 -0500
+Subject: x86: remove the x32 syscall bitmask from syscall_get_nr()
+
+From: Paul Moore <pmoore@redhat.com>
+
+commit 8b4b9f27e57584f3d90e0bb84cf800ad81cfe3a1 upstream.
+
+Commit fca460f95e928bae373daa8295877b6905bc62b8 simplified the x32
+implementation by creating a syscall bitmask, equal to 0x40000000, that
+could be applied to x32 syscalls such that the masked syscall number
+would be the same as a x86_64 syscall.  While that patch was a nice
+way to simplify the code, it went a bit too far by adding the mask to
+syscall_get_nr(); returning the masked syscall numbers can cause
+confusion with callers that expect syscall numbers matching the x32
+ABI, e.g. unmasked syscall numbers.
+
+This patch fixes this by simply removing the mask from syscall_get_nr()
+while preserving the other changes from the original commit.  While
+there are several syscall_get_nr() callers in the kernel, most simply
+check that the syscall number is greater than zero, in this case this
+patch will have no effect.  Of those remaining callers, they appear
+to be few, seccomp and ftrace, and from my testing of seccomp without
+this patch the original commit definitely breaks things; the seccomp
+filter does not correctly filter the syscalls due to the difference in
+syscall numbers in the BPF filter and the value from syscall_get_nr().
+Applying this patch restores the seccomp BPF filter functionality on
+x32.
+
+I've tested this patch with the seccomp BPF filters as well as ftrace
+and everything looks reasonable to me; needless to say general usage
+seemed fine as well.
+
+Signed-off-by: Paul Moore <pmoore@redhat.com>
+Link: http://lkml.kernel.org/r/20130215172143.12549.10292.stgit@localhost
+Cc: Will Drewry <wad@chromium.org>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/syscall.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/include/asm/syscall.h
++++ b/arch/x86/include/asm/syscall.h
+@@ -27,13 +27,13 @@ extern const unsigned long sys_call_tabl
+  */
+ static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
+ {
+-      return regs->orig_ax & __SYSCALL_MASK;
++      return regs->orig_ax;
+ }
+ static inline void syscall_rollback(struct task_struct *task,
+                                   struct pt_regs *regs)
+ {
+-      regs->ax = regs->orig_ax & __SYSCALL_MASK;
++      regs->ax = regs->orig_ax;
+ }
+ static inline long syscall_get_error(struct task_struct *task,