]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 20:44:04 +0000 (13:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 20:44:04 +0000 (13:44 -0700)
added patches:
arc-make-sure-instruction_pointer-returns-unsigned-value.patch
s390-sclp-clear-upper-register-halves-in-_sclp_print_early.patch

queue-3.10/arc-make-sure-instruction_pointer-returns-unsigned-value.patch [new file with mode: 0644]
queue-3.10/s390-sclp-clear-upper-register-halves-in-_sclp_print_early.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/arc-make-sure-instruction_pointer-returns-unsigned-value.patch b/queue-3.10/arc-make-sure-instruction_pointer-returns-unsigned-value.patch
new file mode 100644 (file)
index 0000000..5c5a772
--- /dev/null
@@ -0,0 +1,73 @@
+From f51e2f1911122879eefefa4c592dea8bf794b39c Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin <abrodkin@synopsys.com>
+Date: Mon, 13 Jul 2015 10:25:17 +0300
+Subject: ARC: make sure instruction_pointer() returns unsigned value
+
+From: Alexey Brodkin <abrodkin@synopsys.com>
+
+commit f51e2f1911122879eefefa4c592dea8bf794b39c upstream.
+
+Currently instruction_pointer() returns pt_regs->ret and so return value
+is of type "long", which implicitly stands for "signed long".
+
+While that's perfectly fine when dealing with 32-bit values if return
+value of instruction_pointer() gets assigned to 64-bit variable sign
+extension may happen.
+
+And at least in one real use-case it happens already.
+In perf_prepare_sample() return value of perf_instruction_pointer()
+(which is an alias to instruction_pointer() in case of ARC) is assigned
+to (struct perf_sample_data)->ip (which type is "u64").
+
+And what we see if instuction pointer points to user-space application
+that in case of ARC lays below 0x8000_0000 "ip" gets set properly with
+leading 32 zeros. But if instruction pointer points to kernel address
+space that starts from 0x8000_0000 then "ip" is set with 32 leadig
+"f"-s. I.e. id instruction_pointer() returns 0x8100_0000, "ip" will be
+assigned with 0xffff_ffff__8100_0000. Which is obviously wrong.
+
+In particular that issuse broke output of perf, because perf was unable
+to associate addresses like 0xffff_ffff__8100_0000 with anything from
+/proc/kallsyms.
+
+That's what we used to see:
+ ----------->8----------
+  6.27%  ls       [unknown]                [k] 0xffffffff8046c5cc
+  2.96%  ls       libuClibc-0.9.34-git.so  [.] memcpy
+  2.25%  ls       libuClibc-0.9.34-git.so  [.] memset
+  1.66%  ls       [unknown]                [k] 0xffffffff80666536
+  1.54%  ls       libuClibc-0.9.34-git.so  [.] 0x000224d6
+  1.18%  ls       libuClibc-0.9.34-git.so  [.] 0x00022472
+ ----------->8----------
+
+With that change perf output looks much better now:
+ ----------->8----------
+  8.21%  ls       [kernel.kallsyms]        [k] memset
+  3.52%  ls       libuClibc-0.9.34-git.so  [.] memcpy
+  2.11%  ls       libuClibc-0.9.34-git.so  [.] malloc
+  1.88%  ls       libuClibc-0.9.34-git.so  [.] memset
+  1.64%  ls       [kernel.kallsyms]        [k] _raw_spin_unlock_irqrestore
+  1.41%  ls       [kernel.kallsyms]        [k] __d_lookup_rcu
+ ----------->8----------
+
+Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
+Cc: arc-linux-dev@synopsys.com
+Cc: linux-kernel@vger.kernel.org
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/include/asm/ptrace.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arc/include/asm/ptrace.h
++++ b/arch/arc/include/asm/ptrace.h
+@@ -83,7 +83,7 @@ struct callee_regs {
+       long r13;
+ };
+-#define instruction_pointer(regs)     ((regs)->ret)
++#define instruction_pointer(regs)     (unsigned long)((regs)->ret)
+ #define profile_pc(regs)              instruction_pointer(regs)
+ /* return 1 if user mode or 0 if kernel mode */
diff --git a/queue-3.10/s390-sclp-clear-upper-register-halves-in-_sclp_print_early.patch b/queue-3.10/s390-sclp-clear-upper-register-halves-in-_sclp_print_early.patch
new file mode 100644 (file)
index 0000000..04d1ac8
--- /dev/null
@@ -0,0 +1,46 @@
+From f9c87a6f46d508eae0d9ae640be98d50f237f827 Mon Sep 17 00:00:00 2001
+From: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Date: Mon, 6 Jul 2015 17:58:19 +0200
+Subject: s390/sclp: clear upper register halves in _sclp_print_early
+
+From: Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+commit f9c87a6f46d508eae0d9ae640be98d50f237f827 upstream.
+
+If the kernel is compiled with gcc 5.1 and the XZ compression option
+the decompress_kernel function calls _sclp_print_early in 64-bit mode
+while the content of the upper register half of %r6 is non-zero.
+This causes a specification exception on the servc instruction in
+_sclp_servc.
+
+The _sclp_print_early function saves and restores the upper registers
+halves but it fails to clear them for the 31-bit code of the mini sclp
+driver.
+
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/s390/kernel/sclp.S |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/s390/kernel/sclp.S
++++ b/arch/s390/kernel/sclp.S
+@@ -276,6 +276,8 @@ ENTRY(_sclp_print_early)
+       jno     .Lesa2
+       ahi     %r15,-80
+       stmh    %r6,%r15,96(%r15)               # store upper register halves
++      basr    %r13,0
++      lmh     %r0,%r15,.Lzeroes-.(%r13)       # clear upper register halves
+ .Lesa2:
+ #endif
+       lr      %r10,%r2                        # save string pointer
+@@ -299,6 +301,8 @@ ENTRY(_sclp_print_early)
+ #endif
+       lm      %r6,%r15,120(%r15)              # restore registers
+       br      %r14
++.Lzeroes:
++      .fill   64,4,0
+ .LwritedataS4:
+       .long   0x00760005                      # SCLP command for write data
index f858ec4eec4ccb081fd94bb495ce0fd0ef22a274..d4825318958c9a252b84204a449737631a28c7f9 100644 (file)
@@ -1,2 +1,4 @@
 mm-avoid-setting-up-anonymous-pages-into-file-mapping.patch
 freeing-unlinked-file-indefinitely-delayed.patch
+s390-sclp-clear-upper-register-halves-in-_sclp_print_early.patch
+arc-make-sure-instruction_pointer-returns-unsigned-value.patch