Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
"A couple of bug fixes for s390.

The ftrace comile fix is quite large for a -rc6 release, but it would
be nice to have it in 4.0"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/smp: reenable smt after resume
s390/mm: limit STACK_RND_MASK for compat tasks
s390/ftrace: fix compile error if CONFIG_KPROBES is disabled
s390/cpum_sf: add diagnostic sampling event only if it is authorized

+62 -19
+1 -1
arch/s390/include/asm/elf.h
··· 211 211 212 212 extern unsigned long mmap_rnd_mask; 213 213 214 - #define STACK_RND_MASK (mmap_rnd_mask) 214 + #define STACK_RND_MASK (test_thread_flag(TIF_31BIT) ? 0x7ff : mmap_rnd_mask) 215 215 216 216 #define ARCH_DLINFO \ 217 217 do { \
+45 -16
arch/s390/kernel/ftrace.c
··· 57 57 58 58 unsigned long ftrace_plt; 59 59 60 + static inline void ftrace_generate_orig_insn(struct ftrace_insn *insn) 61 + { 62 + #ifdef CC_USING_HOTPATCH 63 + /* brcl 0,0 */ 64 + insn->opc = 0xc004; 65 + insn->disp = 0; 66 + #else 67 + /* stg r14,8(r15) */ 68 + insn->opc = 0xe3e0; 69 + insn->disp = 0xf0080024; 70 + #endif 71 + } 72 + 73 + static inline int is_kprobe_on_ftrace(struct ftrace_insn *insn) 74 + { 75 + #ifdef CONFIG_KPROBES 76 + if (insn->opc == BREAKPOINT_INSTRUCTION) 77 + return 1; 78 + #endif 79 + return 0; 80 + } 81 + 82 + static inline void ftrace_generate_kprobe_nop_insn(struct ftrace_insn *insn) 83 + { 84 + #ifdef CONFIG_KPROBES 85 + insn->opc = BREAKPOINT_INSTRUCTION; 86 + insn->disp = KPROBE_ON_FTRACE_NOP; 87 + #endif 88 + } 89 + 90 + static inline void ftrace_generate_kprobe_call_insn(struct ftrace_insn *insn) 91 + { 92 + #ifdef CONFIG_KPROBES 93 + insn->opc = BREAKPOINT_INSTRUCTION; 94 + insn->disp = KPROBE_ON_FTRACE_CALL; 95 + #endif 96 + } 97 + 60 98 int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, 61 99 unsigned long addr) 62 100 { ··· 110 72 return -EFAULT; 111 73 if (addr == MCOUNT_ADDR) { 112 74 /* Initial code replacement */ 113 - #ifdef CC_USING_HOTPATCH 114 - /* We expect to see brcl 0,0 */ 115 - ftrace_generate_nop_insn(&orig); 116 - #else 117 - /* We expect to see stg r14,8(r15) */ 118 - orig.opc = 0xe3e0; 119 - orig.disp = 0xf0080024; 120 - #endif 75 + ftrace_generate_orig_insn(&orig); 121 76 ftrace_generate_nop_insn(&new); 122 - } else if (old.opc == BREAKPOINT_INSTRUCTION) { 77 + } else if (is_kprobe_on_ftrace(&old)) { 123 78 /* 124 79 * If we find a breakpoint instruction, a kprobe has been 125 80 * placed at the beginning of the function. We write the ··· 120 89 * bytes of the original instruction so that the kprobes 121 90 * handler can execute a nop, if it reaches this breakpoint. 122 91 */ 123 - new.opc = orig.opc = BREAKPOINT_INSTRUCTION; 124 - orig.disp = KPROBE_ON_FTRACE_CALL; 125 - new.disp = KPROBE_ON_FTRACE_NOP; 92 + ftrace_generate_kprobe_call_insn(&orig); 93 + ftrace_generate_kprobe_nop_insn(&new); 126 94 } else { 127 95 /* Replace ftrace call with a nop. */ 128 96 ftrace_generate_call_insn(&orig, rec->ip); ··· 141 111 142 112 if (probe_kernel_read(&old, (void *) rec->ip, sizeof(old))) 143 113 return -EFAULT; 144 - if (old.opc == BREAKPOINT_INSTRUCTION) { 114 + if (is_kprobe_on_ftrace(&old)) { 145 115 /* 146 116 * If we find a breakpoint instruction, a kprobe has been 147 117 * placed at the beginning of the function. We write the ··· 149 119 * bytes of the original instruction so that the kprobes 150 120 * handler can execute a brasl if it reaches this breakpoint. 151 121 */ 152 - new.opc = orig.opc = BREAKPOINT_INSTRUCTION; 153 - orig.disp = KPROBE_ON_FTRACE_NOP; 154 - new.disp = KPROBE_ON_FTRACE_CALL; 122 + ftrace_generate_kprobe_nop_insn(&orig); 123 + ftrace_generate_kprobe_call_insn(&new); 155 124 } else { 156 125 /* Replace nop with an ftrace call. */ 157 126 ftrace_generate_nop_insn(&orig);
+5 -2
arch/s390/kernel/perf_cpum_sf.c
··· 1415 1415 1416 1416 static struct attribute *cpumsf_pmu_events_attr[] = { 1417 1417 CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC), 1418 - CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC_DIAG), 1418 + NULL, 1419 1419 NULL, 1420 1420 }; 1421 1421 ··· 1606 1606 return -EINVAL; 1607 1607 } 1608 1608 1609 - if (si.ad) 1609 + if (si.ad) { 1610 1610 sfb_set_limits(CPUM_SF_MIN_SDB, CPUM_SF_MAX_SDB); 1611 + cpumsf_pmu_events_attr[1] = 1612 + CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC_DIAG); 1613 + } 1611 1614 1612 1615 sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80); 1613 1616 if (!sfdbg)
+11
arch/s390/kernel/swsusp_asm64.S
··· 177 177 lhi %r1,1 178 178 sigp %r1,%r0,SIGP_SET_ARCHITECTURE 179 179 sam64 180 + #ifdef CONFIG_SMP 181 + larl %r1,smp_cpu_mt_shift 182 + icm %r1,15,0(%r1) 183 + jz smt_done 184 + llgfr %r1,%r1 185 + smt_loop: 186 + sigp %r1,%r0,SIGP_SET_MULTI_THREADING 187 + brc 8,smt_done /* accepted */ 188 + brc 2,smt_loop /* busy, try again */ 189 + smt_done: 190 + #endif 180 191 larl %r1,.Lnew_pgm_check_psw 181 192 lpswe 0(%r1) 182 193 pgm_check_entry: