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

Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (21 commits)
[S390] dasd: fix race condition in resume code
[S390] Add EX_TABLE for addressing exception in usercopy functions.
[S390] 64-bit register support for 31-bit processes
[S390] hibernate: Use correct place for CPU address in lowcore
[S390] pm: ignore time spend in suspended state
[S390] zcrypt: Improve some comments
[S390] zcrypt: Fix sparse warning.
[S390] perf_counter: fix vdso detection
[S390] ftrace: drop nmi protection
[S390] compat: fix truncate system call wrapper
[S390] Provide arch specific mdelay implementation.
[S390] Fix enabled udelay for short delays.
[S390] cio: allow setting boxed devices offline
[S390] cio: make not operational handling consistent
[S390] cio: make disconnected handling consistent
[S390] Fix memory leak in /proc/cio_ignore
[S390] cio: channel path memory leak
[S390] module: fix memory leak in s390 module loader
[S390] Enable kmemleak on s390.
[S390] 3270 console build fix
...

+282 -82
+4 -3
arch/s390/include/asm/delay.h
··· 14 14 #ifndef _S390_DELAY_H 15 15 #define _S390_DELAY_H 16 16 17 - extern void __udelay(unsigned long usecs); 18 - extern void udelay_simple(unsigned long usecs); 17 + extern void __udelay(unsigned long long usecs); 18 + extern void udelay_simple(unsigned long long usecs); 19 19 extern void __delay(unsigned long loops); 20 20 21 - #define udelay(n) __udelay(n) 21 + #define udelay(n) __udelay((unsigned long long) (n)) 22 + #define mdelay(n) __udelay((unsigned long long) (n) * 1000) 22 23 23 24 #endif /* defined(_S390_DELAY_H) */
+12
arch/s390/include/asm/elf.h
··· 92 92 /* Keep this the last entry. */ 93 93 #define R_390_NUM 61 94 94 95 + /* Bits present in AT_HWCAP. */ 96 + #define HWCAP_S390_ESAN3 1 97 + #define HWCAP_S390_ZARCH 2 98 + #define HWCAP_S390_STFLE 4 99 + #define HWCAP_S390_MSA 8 100 + #define HWCAP_S390_LDISP 16 101 + #define HWCAP_S390_EIMM 32 102 + #define HWCAP_S390_DFP 64 103 + #define HWCAP_S390_HPAGE 128 104 + #define HWCAP_S390_ETF3EH 256 105 + #define HWCAP_S390_HIGH_GPRS 512 106 + 95 107 /* 96 108 * These are used to set parameters in the core dumps. 97 109 */
+4
arch/s390/include/asm/ptrace.h
··· 311 311 __u32 orig_gpr2; 312 312 } s390_compat_regs; 313 313 314 + typedef struct 315 + { 316 + __u32 gprs_high[NUM_GPRS]; 317 + } s390_compat_regs_high; 314 318 315 319 #ifdef __KERNEL__ 316 320
+15
arch/s390/include/asm/ucontext.h
··· 9 9 #ifndef _ASM_S390_UCONTEXT_H 10 10 #define _ASM_S390_UCONTEXT_H 11 11 12 + #define UC_EXTENDED 0x00000001 13 + 14 + #ifndef __s390x__ 15 + 16 + struct ucontext_extended { 17 + unsigned long uc_flags; 18 + struct ucontext *uc_link; 19 + stack_t uc_stack; 20 + _sigregs uc_mcontext; 21 + unsigned long uc_sigmask[2]; 22 + unsigned long uc_gprs_high[16]; 23 + }; 24 + 25 + #endif 26 + 12 27 struct ucontext { 13 28 unsigned long uc_flags; 14 29 struct ucontext *uc_link;
+34 -1
arch/s390/kernel/compat_signal.c
··· 39 39 struct sigcontext32 sc; 40 40 _sigregs32 sregs; 41 41 int signo; 42 + __u32 gprs_high[NUM_GPRS]; 42 43 __u8 retcode[S390_SYSCALL_SIZE]; 43 44 } sigframe32; 44 45 ··· 49 48 __u8 retcode[S390_SYSCALL_SIZE]; 50 49 compat_siginfo_t info; 51 50 struct ucontext32 uc; 51 + __u32 gprs_high[NUM_GPRS]; 52 52 } rt_sigframe32; 53 53 54 54 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) ··· 346 344 return 0; 347 345 } 348 346 347 + static int save_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs) 348 + { 349 + __u32 gprs_high[NUM_GPRS]; 350 + int i; 351 + 352 + for (i = 0; i < NUM_GPRS; i++) 353 + gprs_high[i] = regs->gprs[i] >> 32; 354 + 355 + return __copy_to_user(uregs, &gprs_high, sizeof(gprs_high)); 356 + } 357 + 358 + static int restore_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs) 359 + { 360 + __u32 gprs_high[NUM_GPRS]; 361 + int err, i; 362 + 363 + err = __copy_from_user(&gprs_high, uregs, sizeof(gprs_high)); 364 + if (err) 365 + return err; 366 + for (i = 0; i < NUM_GPRS; i++) 367 + *(__u32 *)&regs->gprs[i] = gprs_high[i]; 368 + return 0; 369 + } 370 + 349 371 asmlinkage long sys32_sigreturn(void) 350 372 { 351 373 struct pt_regs *regs = task_pt_regs(current); ··· 388 362 spin_unlock_irq(&current->sighand->siglock); 389 363 390 364 if (restore_sigregs32(regs, &frame->sregs)) 365 + goto badframe; 366 + if (restore_sigregs_gprs_high(regs, frame->gprs_high)) 391 367 goto badframe; 392 368 393 369 return regs->gprs[2]; ··· 421 393 spin_unlock_irq(&current->sighand->siglock); 422 394 423 395 if (restore_sigregs32(regs, &frame->uc.uc_mcontext)) 396 + goto badframe; 397 + if (restore_sigregs_gprs_high(regs, frame->gprs_high)) 424 398 goto badframe; 425 399 426 400 err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp); ··· 504 474 505 475 if (save_sigregs32(regs, &frame->sregs)) 506 476 goto give_sigsegv; 477 + if (save_sigregs_gprs_high(regs, frame->gprs_high)) 478 + goto give_sigsegv; 507 479 if (__put_user((unsigned long) &frame->sregs, &frame->sc.sregs)) 508 480 goto give_sigsegv; 509 481 ··· 561 529 goto give_sigsegv; 562 530 563 531 /* Create the ucontext. */ 564 - err |= __put_user(0, &frame->uc.uc_flags); 532 + err |= __put_user(UC_EXTENDED, &frame->uc.uc_flags); 565 533 err |= __put_user(0, &frame->uc.uc_link); 566 534 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 567 535 err |= __put_user(sas_ss_flags(regs->gprs[15]), 568 536 &frame->uc.uc_stack.ss_flags); 569 537 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); 570 538 err |= save_sigregs32(regs, &frame->uc.uc_mcontext); 539 + err |= save_sigregs_gprs_high(regs, frame->gprs_high); 571 540 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 572 541 if (err) 573 542 goto give_sigsegv;
+1 -1
arch/s390/kernel/compat_wrapper.S
··· 409 409 .globl sys32_truncate_wrapper 410 410 sys32_truncate_wrapper: 411 411 llgtr %r2,%r2 # const char * 412 - llgfr %r3,%r3 # unsigned long 412 + lgfr %r3,%r3 # long 413 413 jg sys_truncate # branch to system call 414 414 415 415 .globl sys32_ftruncate_wrapper
-3
arch/s390/kernel/ftrace.c
··· 185 185 { 186 186 struct ftrace_graph_ent trace; 187 187 188 - /* Nmi's are currently unsupported. */ 189 - if (unlikely(in_nmi())) 190 - goto out; 191 188 if (unlikely(atomic_read(&current->tracing_graph_pause))) 192 189 goto out; 193 190 if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)
+3
arch/s390/kernel/module.c
··· 55 55 /* Free memory returned from module_alloc */ 56 56 void module_free(struct module *mod, void *module_region) 57 57 { 58 + vfree(mod->arch.syminfo); 59 + mod->arch.syminfo = NULL; 58 60 vfree(module_region); 59 61 } 60 62 ··· 404 402 struct module *me) 405 403 { 406 404 vfree(me->arch.syminfo); 405 + me->arch.syminfo = NULL; 407 406 return module_bug_finalize(hdr, sechdrs, me); 408 407 } 409 408
+70
arch/s390/kernel/ptrace.c
··· 57 57 enum s390_regset { 58 58 REGSET_GENERAL, 59 59 REGSET_FP, 60 + REGSET_GENERAL_EXTENDED, 60 61 }; 61 62 62 63 static void ··· 880 879 return rc; 881 880 } 882 881 882 + static int s390_compat_regs_high_get(struct task_struct *target, 883 + const struct user_regset *regset, 884 + unsigned int pos, unsigned int count, 885 + void *kbuf, void __user *ubuf) 886 + { 887 + compat_ulong_t *gprs_high; 888 + 889 + gprs_high = (compat_ulong_t *) 890 + &task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)]; 891 + if (kbuf) { 892 + compat_ulong_t *k = kbuf; 893 + while (count > 0) { 894 + *k++ = *gprs_high; 895 + gprs_high += 2; 896 + count -= sizeof(*k); 897 + } 898 + } else { 899 + compat_ulong_t __user *u = ubuf; 900 + while (count > 0) { 901 + if (__put_user(*gprs_high, u++)) 902 + return -EFAULT; 903 + gprs_high += 2; 904 + count -= sizeof(*u); 905 + } 906 + } 907 + return 0; 908 + } 909 + 910 + static int s390_compat_regs_high_set(struct task_struct *target, 911 + const struct user_regset *regset, 912 + unsigned int pos, unsigned int count, 913 + const void *kbuf, const void __user *ubuf) 914 + { 915 + compat_ulong_t *gprs_high; 916 + int rc = 0; 917 + 918 + gprs_high = (compat_ulong_t *) 919 + &task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)]; 920 + if (kbuf) { 921 + const compat_ulong_t *k = kbuf; 922 + while (count > 0) { 923 + *gprs_high = *k++; 924 + *gprs_high += 2; 925 + count -= sizeof(*k); 926 + } 927 + } else { 928 + const compat_ulong_t __user *u = ubuf; 929 + while (count > 0 && !rc) { 930 + unsigned long word; 931 + rc = __get_user(word, u++); 932 + if (rc) 933 + break; 934 + *gprs_high = word; 935 + *gprs_high += 2; 936 + count -= sizeof(*u); 937 + } 938 + } 939 + 940 + return rc; 941 + } 942 + 883 943 static const struct user_regset s390_compat_regsets[] = { 884 944 [REGSET_GENERAL] = { 885 945 .core_note_type = NT_PRSTATUS, ··· 957 895 .align = sizeof(compat_long_t), 958 896 .get = s390_fpregs_get, 959 897 .set = s390_fpregs_set, 898 + }, 899 + [REGSET_GENERAL_EXTENDED] = { 900 + .core_note_type = NT_PRXSTATUS, 901 + .n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t), 902 + .size = sizeof(compat_long_t), 903 + .align = sizeof(compat_long_t), 904 + .get = s390_compat_regs_high_get, 905 + .set = s390_compat_regs_high_set, 960 906 }, 961 907 }; 962 908
+12 -3
arch/s390/kernel/setup.c
··· 729 729 730 730 if ((facility_list & (1UL << (31 - 22))) 731 731 && (facility_list & (1UL << (31 - 30)))) 732 - elf_hwcap |= 1UL << 8; 732 + elf_hwcap |= HWCAP_S390_ETF3EH; 733 733 734 734 /* 735 735 * Check for additional facilities with store-facility-list-extended. ··· 748 748 __stfle(&facility_list_extended, 1) > 0) { 749 749 if ((facility_list_extended & (1ULL << (63 - 42))) 750 750 && (facility_list_extended & (1ULL << (63 - 44)))) 751 - elf_hwcap |= 1UL << 6; 751 + elf_hwcap |= HWCAP_S390_DFP; 752 752 } 753 753 754 + /* 755 + * Huge page support HWCAP_S390_HPAGE is bit 7. 756 + */ 754 757 if (MACHINE_HAS_HPAGE) 755 - elf_hwcap |= 1UL << 7; 758 + elf_hwcap |= HWCAP_S390_HPAGE; 759 + 760 + /* 761 + * 64-bit register support for 31-bit processes 762 + * HWCAP_S390_HIGH_GPRS is bit 9. 763 + */ 764 + elf_hwcap |= HWCAP_S390_HIGH_GPRS; 756 765 757 766 switch (S390_lowcore.cpu_id.machine) { 758 767 case 0x9672:
+19 -7
arch/s390/kernel/swsusp_asm64.S
··· 43 43 lghi %r1,0x1000 44 44 45 45 /* Save CPU address */ 46 - stap __LC_CPU_ADDRESS(%r1) 46 + stap __LC_CPU_ADDRESS(%r0) 47 47 48 48 /* Store registers */ 49 49 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ ··· 69 69 stmg %r0,%r15,0x280(%r1) /* store general registers */ 70 70 71 71 stpt 0x328(%r1) /* store timer */ 72 + stck __SF_EMPTY(%r15) /* store clock */ 72 73 stckc 0x330(%r1) /* store clock comparator */ 74 + 75 + /* Update cputime accounting before going to sleep */ 76 + lg %r0,__LC_LAST_UPDATE_TIMER 77 + slg %r0,0x328(%r1) 78 + alg %r0,__LC_SYSTEM_TIMER 79 + stg %r0,__LC_SYSTEM_TIMER 80 + mvc __LC_LAST_UPDATE_TIMER(8),0x328(%r1) 81 + lg %r0,__LC_LAST_UPDATE_CLOCK 82 + slg %r0,__SF_EMPTY(%r15) 83 + alg %r0,__LC_STEAL_TIMER 84 + stg %r0,__LC_STEAL_TIMER 85 + mvc __LC_LAST_UPDATE_CLOCK(8),__SF_EMPTY(%r15) 73 86 74 87 /* Activate DAT */ 75 88 stosm __SF_EMPTY(%r15),0x04 ··· 172 159 larl %r1,.Lresume_cpu /* Resume CPU address: r2 */ 173 160 stap 0(%r1) 174 161 llgh %r2,0(%r1) 175 - lghi %r3,0x1000 176 - llgh %r1,__LC_CPU_ADDRESS(%r3) /* Suspend CPU address: r1 */ 162 + llgh %r1,__LC_CPU_ADDRESS(%r0) /* Suspend CPU address: r1 */ 177 163 cgr %r1,%r2 178 164 je restore_registers /* r1 = r2 -> nothing to do */ 179 165 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ ··· 212 200 213 201 restore_registers: 214 202 /* Restore registers */ 215 - lghi %r13,0x1000 /* %r1 = pointer to save arae */ 203 + lghi %r13,0x1000 /* %r1 = pointer to save area */ 216 204 205 + /* Ignore time spent in suspended state. */ 206 + llgf %r1,0x318(%r13) 207 + stck __LC_LAST_UPDATE_CLOCK(%r1) 217 208 spt 0x328(%r13) /* reprogram timer */ 218 209 //sckc 0x330(%r13) /* set clock comparator */ 219 210 ··· 243 228 244 229 /* Load old stack */ 245 230 lg %r15,0x2f8(%r13) 246 - 247 - /* Pointer to save area */ 248 - lghi %r13,0x1000 249 231 250 232 /* Restore prefix register */ 251 233 spx 0x318(%r13)
+8 -8
arch/s390/kernel/vdso.c
··· 247 247 } 248 248 249 249 /* 250 + * Put vDSO base into mm struct. We need to do this before calling 251 + * install_special_mapping or the perf counter mmap tracking code 252 + * will fail to recognise it as a vDSO (since arch_vma_name fails). 253 + */ 254 + current->mm->context.vdso_base = vdso_base; 255 + 256 + /* 250 257 * our vma flags don't have VM_WRITE so by default, the process 251 258 * isn't allowed to write those pages. 252 259 * gdb can break that with ptrace interface, and thus trigger COW ··· 274 267 VM_ALWAYSDUMP, 275 268 vdso_pagelist); 276 269 if (rc) 277 - goto out_up; 278 - 279 - /* Put vDSO base into mm struct */ 280 - current->mm->context.vdso_base = vdso_base; 281 - 282 - up_write(&mm->mmap_sem); 283 - return 0; 284 - 270 + current->mm->context.vdso_base = 0; 285 271 out_up: 286 272 up_write(&mm->mmap_sem); 287 273 return rc;
+1
arch/s390/kernel/vmlinux.lds.S
··· 51 51 52 52 . = ALIGN(PAGE_SIZE); 53 53 _eshared = .; /* End of shareable data */ 54 + _sdata = .; /* Start of data section */ 54 55 55 56 EXCEPTION_TABLE(16) :data 56 57
+16 -11
arch/s390/lib/delay.c
··· 25 25 asm volatile("0: brct %0,0b" : : "d" ((loops/2) + 1)); 26 26 } 27 27 28 - static void __udelay_disabled(unsigned long usecs) 28 + static void __udelay_disabled(unsigned long long usecs) 29 29 { 30 30 unsigned long mask, cr0, cr0_saved; 31 31 u64 clock_saved; 32 32 33 33 clock_saved = local_tick_disable(); 34 - set_clock_comparator(get_clock() + ((u64) usecs << 12)); 34 + set_clock_comparator(get_clock() + (usecs << 12)); 35 35 __ctl_store(cr0_saved, 0, 0); 36 36 cr0 = (cr0_saved & 0xffff00e0) | 0x00000800; 37 37 __ctl_load(cr0 , 0, 0); ··· 46 46 set_clock_comparator(S390_lowcore.clock_comparator); 47 47 } 48 48 49 - static void __udelay_enabled(unsigned long usecs) 49 + static void __udelay_enabled(unsigned long long usecs) 50 50 { 51 51 unsigned long mask; 52 - u64 end, time; 52 + u64 clock_saved; 53 + u64 end; 53 54 54 55 mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT | PSW_MASK_IO; 55 - end = get_clock() + ((u64) usecs << 12); 56 + end = get_clock() + (usecs << 12); 56 57 do { 57 - time = end < S390_lowcore.clock_comparator ? 58 - end : S390_lowcore.clock_comparator; 59 - set_clock_comparator(time); 58 + clock_saved = 0; 59 + if (end < S390_lowcore.clock_comparator) { 60 + clock_saved = local_tick_disable(); 61 + set_clock_comparator(end); 62 + } 60 63 trace_hardirqs_on(); 61 64 __load_psw_mask(mask); 62 65 local_irq_disable(); 66 + if (clock_saved) 67 + local_tick_enable(clock_saved); 63 68 } while (get_clock() < end); 64 69 set_clock_comparator(S390_lowcore.clock_comparator); 65 70 } ··· 72 67 /* 73 68 * Waits for 'usecs' microseconds using the TOD clock comparator. 74 69 */ 75 - void __udelay(unsigned long usecs) 70 + void __udelay(unsigned long long usecs) 76 71 { 77 72 unsigned long flags; 78 73 ··· 106 101 * Simple udelay variant. To be used on startup and reboot 107 102 * when the interrupt handler isn't working. 108 103 */ 109 - void udelay_simple(unsigned long usecs) 104 + void udelay_simple(unsigned long long usecs) 110 105 { 111 106 u64 end; 112 107 113 - end = get_clock() + ((u64) usecs << 12); 108 + end = get_clock() + (usecs << 12); 114 109 while (get_clock() < end) 115 110 cpu_relax(); 116 111 }
+6 -6
arch/s390/lib/uaccess_mvcos.c
··· 36 36 tmp1 = -4096UL; 37 37 asm volatile( 38 38 "0: .insn ss,0xc80000000000,0(%0,%2),0(%1),0\n" 39 - " jz 7f\n" 39 + "9: jz 7f\n" 40 40 "1:"ALR" %0,%3\n" 41 41 " "SLR" %1,%3\n" 42 42 " "SLR" %2,%3\n" ··· 47 47 " "CLR" %0,%4\n" /* copy crosses next page boundary? */ 48 48 " jnh 4f\n" 49 49 "3: .insn ss,0xc80000000000,0(%4,%2),0(%1),0\n" 50 - " "SLR" %0,%4\n" 50 + "10:"SLR" %0,%4\n" 51 51 " "ALR" %2,%4\n" 52 52 "4:"LHI" %4,-1\n" 53 53 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */ ··· 61 61 " j 8f\n" 62 62 "7:"SLR" %0,%0\n" 63 63 "8: \n" 64 - EX_TABLE(0b,2b) EX_TABLE(3b,4b) 64 + EX_TABLE(0b,2b) EX_TABLE(3b,4b) EX_TABLE(9b,2b) EX_TABLE(10b,4b) 65 65 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) 66 66 : "d" (reg0) : "cc", "memory"); 67 67 return size; ··· 82 82 tmp1 = -4096UL; 83 83 asm volatile( 84 84 "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n" 85 - " jz 4f\n" 85 + "6: jz 4f\n" 86 86 "1:"ALR" %0,%3\n" 87 87 " "SLR" %1,%3\n" 88 88 " "SLR" %2,%3\n" ··· 93 93 " "CLR" %0,%4\n" /* copy crosses next page boundary? */ 94 94 " jnh 5f\n" 95 95 "3: .insn ss,0xc80000000000,0(%4,%1),0(%2),0\n" 96 - " "SLR" %0,%4\n" 96 + "7:"SLR" %0,%4\n" 97 97 " j 5f\n" 98 98 "4:"SLR" %0,%0\n" 99 99 "5: \n" 100 - EX_TABLE(0b,2b) EX_TABLE(3b,5b) 100 + EX_TABLE(0b,2b) EX_TABLE(3b,5b) EX_TABLE(6b,2b) EX_TABLE(7b,5b) 101 101 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) 102 102 : "d" (reg0) : "cc", "memory"); 103 103 return size;
+8 -6
arch/s390/lib/uaccess_std.c
··· 36 36 tmp1 = -256UL; 37 37 asm volatile( 38 38 "0: mvcp 0(%0,%2),0(%1),%3\n" 39 - " jz 8f\n" 39 + "10:jz 8f\n" 40 40 "1:"ALR" %0,%3\n" 41 41 " la %1,256(%1)\n" 42 42 " la %2,256(%2)\n" 43 43 "2: mvcp 0(%0,%2),0(%1),%3\n" 44 - " jnz 1b\n" 44 + "11:jnz 1b\n" 45 45 " j 8f\n" 46 46 "3: la %4,255(%1)\n" /* %4 = ptr + 255 */ 47 47 " "LHI" %3,-4096\n" ··· 50 50 " "CLR" %0,%4\n" /* copy crosses next page boundary? */ 51 51 " jnh 5f\n" 52 52 "4: mvcp 0(%4,%2),0(%1),%3\n" 53 - " "SLR" %0,%4\n" 53 + "12:"SLR" %0,%4\n" 54 54 " "ALR" %2,%4\n" 55 55 "5:"LHI" %4,-1\n" 56 56 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */ ··· 65 65 "8:"SLR" %0,%0\n" 66 66 "9: \n" 67 67 EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,5b) 68 + EX_TABLE(10b,3b) EX_TABLE(11b,3b) EX_TABLE(12b,5b) 68 69 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) 69 70 : : "cc", "memory"); 70 71 return size; ··· 86 85 tmp1 = -256UL; 87 86 asm volatile( 88 87 "0: mvcs 0(%0,%1),0(%2),%3\n" 89 - " jz 5f\n" 88 + "7: jz 5f\n" 90 89 "1:"ALR" %0,%3\n" 91 90 " la %1,256(%1)\n" 92 91 " la %2,256(%2)\n" 93 92 "2: mvcs 0(%0,%1),0(%2),%3\n" 94 - " jnz 1b\n" 93 + "8: jnz 1b\n" 95 94 " j 5f\n" 96 95 "3: la %4,255(%1)\n" /* %4 = ptr + 255 */ 97 96 " "LHI" %3,-4096\n" ··· 100 99 " "CLR" %0,%4\n" /* copy crosses next page boundary? */ 101 100 " jnh 6f\n" 102 101 "4: mvcs 0(%4,%1),0(%2),%3\n" 103 - " "SLR" %0,%4\n" 102 + "9:"SLR" %0,%4\n" 104 103 " j 6f\n" 105 104 "5:"SLR" %0,%0\n" 106 105 "6: \n" 107 106 EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,6b) 107 + EX_TABLE(7b,3b) EX_TABLE(8b,3b) EX_TABLE(9b,6b) 108 108 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2) 109 109 : : "cc", "memory"); 110 110 return size;
+8 -2
arch/s390/mm/pgtable.c
··· 279 279 /* lets check if we are allowed to replace the mm */ 280 280 task_lock(tsk); 281 281 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || 282 - tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) { 282 + #ifdef CONFIG_AIO 283 + !hlist_empty(&tsk->mm->ioctx_list) || 284 + #endif 285 + tsk->mm != tsk->active_mm) { 283 286 task_unlock(tsk); 284 287 return -EINVAL; 285 288 } ··· 298 295 /* Now lets check again if something happened */ 299 296 task_lock(tsk); 300 297 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || 301 - tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) { 298 + #ifdef CONFIG_AIO 299 + !hlist_empty(&tsk->mm->ioctx_list) || 300 + #endif 301 + tsk->mm != tsk->active_mm) { 302 302 mmput(mm); 303 303 task_unlock(tsk); 304 304 return -EINVAL;
+3 -2
drivers/s390/block/dasd.c
··· 2508 2508 device->stopped &= ~DASD_UNRESUMED_PM; 2509 2509 2510 2510 dasd_schedule_device_bh(device); 2511 - if (device->block) 2512 - dasd_schedule_block_bh(device->block); 2513 2511 2514 2512 if (device->discipline->restore) 2515 2513 rc = device->discipline->restore(device); ··· 2517 2519 * an UNRESUMED stop state 2518 2520 */ 2519 2521 device->stopped |= DASD_UNRESUMED_PM; 2522 + 2523 + if (device->block) 2524 + dasd_schedule_block_bh(device->block); 2520 2525 2521 2526 dasd_put_device(device); 2522 2527 return 0;
+7 -2
drivers/s390/block/dasd_eckd.c
··· 2338 2338 /* Calculate number of blocks/records per track. */ 2339 2339 blksize = block->bp_block; 2340 2340 blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize); 2341 + if (blk_per_trk == 0) 2342 + return ERR_PTR(-EINVAL); 2341 2343 /* Calculate record id of first and last block. */ 2342 2344 first_rec = first_trk = blk_rq_pos(req) >> block->s2b_shift; 2343 2345 first_offs = sector_div(first_trk, blk_per_trk); ··· 3213 3211 int dasd_eckd_restore_device(struct dasd_device *device) 3214 3212 { 3215 3213 struct dasd_eckd_private *private; 3214 + struct dasd_eckd_characteristics temp_rdc_data; 3216 3215 int is_known, rc; 3217 3216 struct dasd_uid temp_uid; 3218 3217 ··· 3248 3245 dasd_eckd_read_features(device); 3249 3246 3250 3247 /* Read Device Characteristics */ 3251 - memset(&private->rdc_data, 0, sizeof(private->rdc_data)); 3252 3248 rc = dasd_generic_read_dev_chars(device, DASD_ECKD_MAGIC, 3253 - &private->rdc_data, 64); 3249 + &temp_rdc_data, 64); 3254 3250 if (rc) { 3255 3251 DBF_EVENT(DBF_WARNING, 3256 3252 "Read device characteristics failed, rc=%d for " 3257 3253 "device: %s", rc, dev_name(&device->cdev->dev)); 3258 3254 goto out_err; 3259 3255 } 3256 + spin_lock(get_ccwdev_lock(device->cdev)); 3257 + memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data)); 3258 + spin_unlock(get_ccwdev_lock(device->cdev)); 3260 3259 3261 3260 /* add device to alias management */ 3262 3261 dasd_alias_add_device(device);
+2
drivers/s390/char/raw3270.c
··· 1361 1361 1362 1362 void raw3270_pm_unfreeze(struct raw3270_view *view) 1363 1363 { 1364 + #ifdef CONFIG_TN3270_CONSOLE 1364 1365 struct raw3270 *rp; 1365 1366 1366 1367 rp = view->dev; 1367 1368 if (rp && test_bit(RAW3270_FLAGS_FROZEN, &rp->flags)) 1368 1369 ccw_device_force_console(); 1370 + #endif 1369 1371 } 1370 1372 1371 1373 static struct ccw_device_id raw3270_id[] = {
+5 -8
drivers/s390/cio/blacklist.c
··· 265 265 static void * 266 266 cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset) 267 267 { 268 - struct ccwdev_iter *iter; 268 + struct ccwdev_iter *iter = s->private; 269 269 270 270 if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) 271 271 return NULL; 272 - iter = kzalloc(sizeof(struct ccwdev_iter), GFP_KERNEL); 273 - if (!iter) 274 - return ERR_PTR(-ENOMEM); 272 + memset(iter, 0, sizeof(*iter)); 275 273 iter->ssid = *offset / (__MAX_SUBCHANNEL + 1); 276 274 iter->devno = *offset % (__MAX_SUBCHANNEL + 1); 277 275 return iter; ··· 278 280 static void 279 281 cio_ignore_proc_seq_stop(struct seq_file *s, void *it) 280 282 { 281 - if (!IS_ERR(it)) 282 - kfree(it); 283 283 } 284 284 285 285 static void * ··· 374 378 static int 375 379 cio_ignore_proc_open(struct inode *inode, struct file *file) 376 380 { 377 - return seq_open(file, &cio_ignore_proc_seq_ops); 381 + return seq_open_private(file, &cio_ignore_proc_seq_ops, 382 + sizeof(struct ccwdev_iter)); 378 383 } 379 384 380 385 static const struct file_operations cio_ignore_proc_fops = { 381 386 .open = cio_ignore_proc_open, 382 387 .read = seq_read, 383 388 .llseek = seq_lseek, 384 - .release = seq_release, 389 + .release = seq_release_private, 385 390 .write = cio_ignore_write, 386 391 }; 387 392
+1 -1
drivers/s390/cio/chp.c
··· 393 393 chp->state = 1; 394 394 chp->dev.parent = &channel_subsystems[chpid.cssid]->device; 395 395 chp->dev.release = chp_release; 396 - dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id); 397 396 398 397 /* Obtain channel path description and fill it in. */ 399 398 ret = chsc_determine_base_channel_path_desc(chpid, &chp->desc); ··· 410 411 } else { 411 412 chp->cmg = -1; 412 413 } 414 + dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id); 413 415 414 416 /* make it known to the system */ 415 417 ret = device_register(&chp->dev);
+2 -2
drivers/s390/cio/device.c
··· 1609 1609 return 0; 1610 1610 } 1611 1611 1612 - static void device_set_disconnected(struct ccw_device *cdev) 1612 + void ccw_device_set_disconnected(struct ccw_device *cdev) 1613 1613 { 1614 1614 if (!cdev) 1615 1615 return; ··· 1705 1705 ccw_device_trigger_reprobe(cdev); 1706 1706 break; 1707 1707 case DISC: 1708 - device_set_disconnected(cdev); 1708 + ccw_device_set_disconnected(cdev); 1709 1709 break; 1710 1710 default: 1711 1711 break;
+1
drivers/s390/cio/device.h
··· 125 125 void ccw_device_trigger_reprobe(struct ccw_device *); 126 126 void ccw_device_kill_io(struct ccw_device *); 127 127 int ccw_device_notify(struct ccw_device *, int); 128 + void ccw_device_set_disconnected(struct ccw_device *cdev); 128 129 void ccw_device_set_notoper(struct ccw_device *cdev); 129 130 130 131 /* qdio needs this. */
+27 -8
drivers/s390/cio/device_fsm.c
··· 387 387 388 388 cdev->private->state = state; 389 389 390 - if (state == DEV_STATE_BOXED) { 390 + switch (state) { 391 + case DEV_STATE_BOXED: 391 392 CIO_MSG_EVENT(0, "Boxed device %04x on subchannel %04x\n", 392 393 cdev->private->dev_id.devno, sch->schid.sch_no); 393 394 if (cdev->online && !ccw_device_notify(cdev, CIO_BOXED)) 394 395 ccw_device_schedule_sch_unregister(cdev); 395 396 cdev->private->flags.donotify = 0; 396 - } 397 - if (state == DEV_STATE_NOT_OPER) { 397 + break; 398 + case DEV_STATE_NOT_OPER: 398 399 CIO_MSG_EVENT(0, "Device %04x gone on subchannel %04x\n", 399 400 cdev->private->dev_id.devno, sch->schid.sch_no); 400 401 if (!ccw_device_notify(cdev, CIO_GONE)) 401 402 ccw_device_schedule_sch_unregister(cdev); 403 + else 404 + ccw_device_set_disconnected(cdev); 402 405 cdev->private->flags.donotify = 0; 406 + break; 407 + case DEV_STATE_DISCONNECTED: 408 + CIO_MSG_EVENT(0, "Disconnected device %04x on subchannel " 409 + "%04x\n", cdev->private->dev_id.devno, 410 + sch->schid.sch_no); 411 + if (!ccw_device_notify(cdev, CIO_NO_PATH)) 412 + ccw_device_schedule_sch_unregister(cdev); 413 + else 414 + ccw_device_set_disconnected(cdev); 415 + cdev->private->flags.donotify = 0; 416 + break; 417 + default: 418 + break; 403 419 } 404 420 405 421 if (cdev->private->flags.donotify) { ··· 687 671 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 688 672 return 0; 689 673 } 674 + if (cdev->private->state == DEV_STATE_BOXED) { 675 + ccw_device_done(cdev, DEV_STATE_BOXED); 676 + return 0; 677 + } 690 678 if (ccw_device_is_orphan(cdev)) { 691 679 ccw_device_done(cdev, DEV_STATE_OFFLINE); 692 680 return 0; ··· 750 730 static void ccw_device_generic_notoper(struct ccw_device *cdev, 751 731 enum dev_event dev_event) 752 732 { 753 - struct subchannel *sch; 754 - 755 - ccw_device_set_notoper(cdev); 756 - sch = to_subchannel(cdev->dev.parent); 757 - css_schedule_eval(sch->schid); 733 + if (!ccw_device_notify(cdev, CIO_GONE)) 734 + ccw_device_schedule_sch_unregister(cdev); 735 + else 736 + ccw_device_set_disconnected(cdev); 758 737 } 759 738 760 739 /*
+8 -5
drivers/s390/crypto/zcrypt_pcixcc.c
··· 361 361 .ToCardLen1 = sizeof *msg - sizeof(msg->hdr), 362 362 .FromCardLen1 = sizeof *msg - sizeof(msg->hdr), 363 363 }; 364 - static struct CPRBX static_cprbx = { 364 + static struct CPRBX local_cprbx = { 365 365 .cprb_len = 0x00dc, 366 366 .cprb_ver_id = 0x02, 367 367 .func_id = {0x54, 0x32}, ··· 372 372 373 373 msg->hdr = static_type6_hdrX; 374 374 msg->hdr.FromCardLen2 = random_number_length, 375 - msg->cprbx = static_cprbx; 375 + msg->cprbx = local_cprbx; 376 376 msg->cprbx.rpl_datal = random_number_length, 377 377 msg->cprbx.domain = AP_QID_QUEUE(ap_dev->qid); 378 378 memcpy(msg->function_code, msg->hdr.function_code, 0x02); ··· 561 561 if (msg->cprbx.cprb_ver_id == 0x02) 562 562 return convert_type86_ica(zdev, reply, 563 563 outputdata, outputdatalength); 564 - /* no break, incorrect cprb version is an unknown response */ 564 + /* Fall through, no break, incorrect cprb version is an unknown 565 + * response */ 565 566 default: /* Unknown response type, this should NEVER EVER happen */ 566 567 zdev->online = 0; 567 568 return -EAGAIN; /* repeat the request on a different device. */ ··· 588 587 } 589 588 if (msg->cprbx.cprb_ver_id == 0x02) 590 589 return convert_type86_xcrb(zdev, reply, xcRB); 591 - /* no break, incorrect cprb version is an unknown response */ 590 + /* Fall through, no break, incorrect cprb version is an unknown 591 + * response */ 592 592 default: /* Unknown response type, this should NEVER EVER happen */ 593 593 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */ 594 594 zdev->online = 0; ··· 612 610 return -EINVAL; 613 611 if (msg->cprbx.cprb_ver_id == 0x02) 614 612 return convert_type86_rng(zdev, reply, data); 615 - /* no break, incorrect cprb version is an unknown response */ 613 + /* Fall through, no break, incorrect cprb version is an unknown 614 + * response */ 616 615 default: /* Unknown response type, this should NEVER EVER happen */ 617 616 zdev->online = 0; 618 617 return -EAGAIN; /* repeat the request on a different device. */
+1
include/linux/elf.h
··· 361 361 #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ 362 362 #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ 363 363 #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ 364 + #define NT_PRXSTATUS 0x300 /* s390 upper register halves */ 364 365 365 366 366 367 /* Note header in a PT_NOTE section */
+4 -3
lib/Kconfig.debug
··· 346 346 347 347 config DEBUG_KMEMLEAK 348 348 bool "Kernel memory leak detector" 349 - depends on DEBUG_KERNEL && EXPERIMENTAL && (X86 || ARM || PPC) && \ 350 - !MEMORY_HOTPLUG 349 + depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \ 350 + (X86 || ARM || PPC || S390) 351 + 351 352 select DEBUG_FS if SYSFS 352 353 select STACKTRACE if STACKTRACE_SUPPORT 353 354 select KALLSYMS ··· 371 370 config DEBUG_KMEMLEAK_EARLY_LOG_SIZE 372 371 int "Maximum kmemleak early log entries" 373 372 depends on DEBUG_KMEMLEAK 374 - range 200 2000 373 + range 200 40000 375 374 default 400 376 375 help 377 376 Kmemleak must track all the memory allocations to avoid