From: Greg Kroah-Hartman Date: Thu, 25 Oct 2012 22:54:35 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.49~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1956cd94f6c8b140fc8fe94acb537c094360dd5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: sparc64-be-less-verbose-during-vmemmap-population.patch sparc64-do-not-clobber-personality-flags-in-sys_sparc64_personality.patch sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch --- diff --git a/queue-3.0/series b/queue-3.0/series index 1998bb858e9..d5568adc37a 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -20,3 +20,8 @@ net-fix-skb_under_panic-oops-in-neigh_resolve_output.patch skge-add-dma-mask-quirk-for-marvell-88e8001-on-asus-p5nsli-motherboard.patch rds-fix-rds-ping-spinlock-recursion.patch tcp-resets-are-misrouted.patch +sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch +sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch +sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch +sparc64-do-not-clobber-personality-flags-in-sys_sparc64_personality.patch +sparc64-be-less-verbose-during-vmemmap-population.patch diff --git a/queue-3.0/sparc64-be-less-verbose-during-vmemmap-population.patch b/queue-3.0/sparc64-be-less-verbose-during-vmemmap-population.patch new file mode 100644 index 00000000000..5b4cc5cb656 --- /dev/null +++ b/queue-3.0/sparc64-be-less-verbose-during-vmemmap-population.patch @@ -0,0 +1,76 @@ +From d95bc56ac394a6cab136a87330680132a8068afd Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Wed, 15 Aug 2012 00:37:29 -0700 +Subject: sparc64: Be less verbose during vmemmap population. + + +From: "David S. Miller" + +[ Upstream commit 2856cc2e4d0852c3ddaae9dcb19cb9396512eb08 ] + +On a 2-node machine with 256GB of ram we get 512 lines of +console output, which is just too much. + +This mimicks Yinghai Lu's x86 commit c2b91e2eec9678dbda274e906cc32ea8f711da3b +(x86_64/mm: check and print vmemmap allocation continuous) except that +we aren't ever going to get contiguous block pointers in between calls +so just print when the virtual address or node changes. + +This decreases the output by an order of 16. + +Also demote this to KERN_DEBUG. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/mm/init_64.c | 28 +++++++++++++++++++++++----- + 1 file changed, 23 insertions(+), 5 deletions(-) + +--- a/arch/sparc/mm/init_64.c ++++ b/arch/sparc/mm/init_64.c +@@ -2118,6 +2118,9 @@ EXPORT_SYMBOL(_PAGE_CACHE); + #ifdef CONFIG_SPARSEMEM_VMEMMAP + unsigned long vmemmap_table[VMEMMAP_SIZE]; + ++static long __meminitdata addr_start, addr_end; ++static int __meminitdata node_start; ++ + int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node) + { + unsigned long vstart = (unsigned long) start; +@@ -2148,15 +2151,30 @@ int __meminit vmemmap_populate(struct pa + + *vmem_pp = pte_base | __pa(block); + +- printk(KERN_INFO "[%p-%p] page_structs=%lu " +- "node=%d entry=%lu/%lu\n", start, block, nr, +- node, +- addr >> VMEMMAP_CHUNK_SHIFT, +- VMEMMAP_SIZE); ++ /* check to see if we have contiguous blocks */ ++ if (addr_end != addr || node_start != node) { ++ if (addr_start) ++ printk(KERN_DEBUG " [%lx-%lx] on node %d\n", ++ addr_start, addr_end-1, node_start); ++ addr_start = addr; ++ node_start = node; ++ } ++ addr_end = addr + VMEMMAP_CHUNK; + } + } + return 0; + } ++ ++void __meminit vmemmap_populate_print_last(void) ++{ ++ if (addr_start) { ++ printk(KERN_DEBUG " [%lx-%lx] on node %d\n", ++ addr_start, addr_end-1, node_start); ++ addr_start = 0; ++ addr_end = 0; ++ node_start = 0; ++ } ++} + #endif /* CONFIG_SPARSEMEM_VMEMMAP */ + + static void prot_init_common(unsigned long page_none, diff --git a/queue-3.0/sparc64-do-not-clobber-personality-flags-in-sys_sparc64_personality.patch b/queue-3.0/sparc64-do-not-clobber-personality-flags-in-sys_sparc64_personality.patch new file mode 100644 index 00000000000..b897e90c3a8 --- /dev/null +++ b/queue-3.0/sparc64-do-not-clobber-personality-flags-in-sys_sparc64_personality.patch @@ -0,0 +1,51 @@ +From 63f5dbbff2508abbf19627b8679d39895af8dfa3 Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Wed, 1 Aug 2012 21:10:51 +0200 +Subject: sparc64: do not clobber personality flags in sys_sparc64_personality() + + +From: Jiri Kosina + +[ Upstream commit a27032eee8cb6e16516f13c8a9752e9d5d4cc430 ] + +There are multiple errors in how sys_sparc64_personality() handles +personality flags stored in top three bytes. + +- directly comparing current->personality against PER_LINUX32 doesn't work + in cases when any of the personality flags stored in the top three bytes + are used. +- directly forcefully setting personality to PER_LINUX32 or PER_LINUX + discards any flags stored in the top three bytes + +Fix the first one by properly using personality() macro to compare only +PER_MASK bytes. +Fix the second one by setting only the bits that should be set, instead of +overwriting the whole value. + +Signed-off-by: Jiri Kosina +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/sys_sparc_64.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/sparc/kernel/sys_sparc_64.c ++++ b/arch/sparc/kernel/sys_sparc_64.c +@@ -519,12 +519,12 @@ SYSCALL_DEFINE1(sparc64_personality, uns + { + int ret; + +- if (current->personality == PER_LINUX32 && +- personality == PER_LINUX) +- personality = PER_LINUX32; ++ if (personality(current->personality) == PER_LINUX32 && ++ personality(personality) == PER_LINUX) ++ personality |= PER_LINUX32; + ret = sys_personality(personality); +- if (ret == PER_LINUX32) +- ret = PER_LINUX; ++ if (personality(ret) == PER_LINUX32) ++ ret &= ~PER_LINUX32; + + return ret; + } diff --git a/queue-3.0/sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch b/queue-3.0/sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch new file mode 100644 index 00000000000..e8b991b3c24 --- /dev/null +++ b/queue-3.0/sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch @@ -0,0 +1,49 @@ +From e73ff5c0c0bba8cb9c7b51691bc290a7e4a9fc61 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Tue, 16 Oct 2012 13:05:25 -0700 +Subject: sparc64: Fix bit twiddling in sparc_pmu_enable_event(). + + +From: "David S. Miller" + +[ Upstream commit e793d8c6740f8fe704fa216e95685f4d92c4c4b9 ] + +There was a serious disconnect in the logic happening in +sparc_pmu_disable_event() vs. sparc_pmu_enable_event(). + +Event disable is implemented by programming a NOP event into the PCR. + +However, event enable was not reversing this operation. Instead, it +was setting the User/Priv/Hypervisor trace enable bits. + +That's not sparc_pmu_enable_event()'s job, that's what +sparc_pmu_enable() and sparc_pmu_disable() do . + +The intent of sparc_pmu_enable_event() is clear, since it first clear +out the event type encoding field. So fix this by OR'ing in the event +encoding rather than the trace enable bits. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/perf_event.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/arch/sparc/kernel/perf_event.c ++++ b/arch/sparc/kernel/perf_event.c +@@ -513,11 +513,13 @@ static u64 nop_for_index(int idx) + + static inline void sparc_pmu_enable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx) + { +- u64 val, mask = mask_for_index(idx); ++ u64 enc, val, mask = mask_for_index(idx); ++ ++ enc = perf_event_get_enc(cpuc->events[idx]); + + val = cpuc->pcr; + val &= ~mask; +- val |= hwc->config; ++ val |= event_encoding(enc, idx); + cpuc->pcr = val; + + pcr_ops->write(cpuc->pcr); diff --git a/queue-3.0/sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch b/queue-3.0/sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch new file mode 100644 index 00000000000..c13d0c53ef7 --- /dev/null +++ b/queue-3.0/sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch @@ -0,0 +1,83 @@ +From 93532cc9548558200709c8e014240999535ff356 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Wed, 10 Oct 2012 17:25:00 -0700 +Subject: sparc64: fix ptrace interaction with force_successful_syscall_return() + + +From: Al Viro + +[ Upstream commit 55c2770e413e96871147b9406a9c41fe9bc5209c ] + +we want syscall_trace_leave() called on exit from any syscall; +skipping its call in case we'd done force_successful_syscall_return() +is broken... + +Signed-off-by: Al Viro +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/syscalls.S | 32 ++++++++++++++------------------ + 1 file changed, 14 insertions(+), 18 deletions(-) + +--- a/arch/sparc/kernel/syscalls.S ++++ b/arch/sparc/kernel/syscalls.S +@@ -212,24 +212,20 @@ linux_sparc_syscall: + 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] + ret_sys_call: + ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 +- ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc + sra %o0, 0, %o0 + mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 + sllx %g2, 32, %g2 + +- /* Check if force_successful_syscall_return() +- * was invoked. +- */ +- ldub [%g6 + TI_SYS_NOERROR], %l2 +- brnz,a,pn %l2, 80f +- stb %g0, [%g6 + TI_SYS_NOERROR] +- + cmp %o0, -ERESTART_RESTARTBLOCK + bgeu,pn %xcc, 1f +- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6 +-80: ++ andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 ++ ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc ++ ++2: ++ stb %g0, [%g6 + TI_SYS_NOERROR] + /* System call success, clear Carry condition code. */ + andn %g3, %g2, %g3 ++3: + stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] + bne,pn %icc, linux_syscall_trace2 + add %l1, 0x4, %l2 ! npc = npc+4 +@@ -238,20 +234,20 @@ ret_sys_call: + stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] + + 1: ++ /* Check if force_successful_syscall_return() ++ * was invoked. ++ */ ++ ldub [%g6 + TI_SYS_NOERROR], %l2 ++ brnz,pn %l2, 2b ++ ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc + /* System call failure, set Carry condition code. + * Also, get abs(errno) to return to the process. + */ +- andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6 + sub %g0, %o0, %o0 +- or %g3, %g2, %g3 + stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] +- stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] +- bne,pn %icc, linux_syscall_trace2 +- add %l1, 0x4, %l2 ! npc = npc+4 +- stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] ++ ba,pt %xcc, 3b ++ or %g3, %g2, %g3 + +- b,pt %xcc, rtrap +- stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] + linux_syscall_trace2: + call syscall_trace_leave + add %sp, PTREGS_OFF, %o0 diff --git a/queue-3.0/sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch b/queue-3.0/sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch new file mode 100644 index 00000000000..6b555a1c7bc --- /dev/null +++ b/queue-3.0/sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch @@ -0,0 +1,51 @@ +From c988fe16b5dd4a50595dcfb8a7dfd4fc1ff871d9 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Sun, 14 Oct 2012 17:59:40 -0700 +Subject: sparc64: Like x86 we should check current->mm during perf backtrace generation. + + +From: "David S. Miller" + +[ Upstream commit 08280e6c4c2e8049ac61d9e8e3536ec1df629c0d ] + +If the MM is not active, only report the top-level PC. Do not try to +access the address space. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/perf_event.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/arch/sparc/kernel/perf_event.c ++++ b/arch/sparc/kernel/perf_event.c +@@ -1380,8 +1380,6 @@ static void perf_callchain_user_64(struc + { + unsigned long ufp; + +- perf_callchain_store(entry, regs->tpc); +- + ufp = regs->u_regs[UREG_I6] + STACK_BIAS; + do { + struct sparc_stackf *usf, sf; +@@ -1402,8 +1400,6 @@ static void perf_callchain_user_32(struc + { + unsigned long ufp; + +- perf_callchain_store(entry, regs->tpc); +- + ufp = regs->u_regs[UREG_I6] & 0xffffffffUL; + do { + struct sparc_stackf32 *usf, sf; +@@ -1422,6 +1418,11 @@ static void perf_callchain_user_32(struc + void + perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) + { ++ perf_callchain_store(entry, regs->tpc); ++ ++ if (!current->mm) ++ return; ++ + flushw_user(); + if (test_thread_flag(TIF_32BIT)) + perf_callchain_user_32(entry, regs);