History

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 ...

Linus Torvalds committed 17 years ago

Commit f144c782 parents ef1f7a7 6fca97a28 files · +282 −82Browse files

Unified · Split

28 files
  1. arch/s390/include/asm/delay.h +4 −3
  2. arch/s390/include/asm/elf.h +12 −0
  3. arch/s390/include/asm/ptrace.h +4 −0
  4. arch/s390/include/asm/ucontext.h +15 −0
  5. arch/s390/kernel/compat_signal.c +34 −1
  6. arch/s390/kernel/compat_wrapper.S +1 −1
  7. arch/s390/kernel/ftrace.c +0 −3
  8. arch/s390/kernel/module.c +3 −0
  9. arch/s390/kernel/ptrace.c +70 −0
  10. arch/s390/kernel/setup.c +12 −3
  11. arch/s390/kernel/swsusp_asm64.S +19 −7
  12. arch/s390/kernel/vdso.c +8 −8
  13. arch/s390/kernel/vmlinux.lds.S +1 −0
  14. arch/s390/lib/delay.c +16 −11
  15. arch/s390/lib/uaccess_mvcos.c +6 −6
  16. arch/s390/lib/uaccess_std.c +8 −6
  17. arch/s390/mm/pgtable.c +8 −2
  18. drivers/s390/block/dasd.c +3 −2
  19. drivers/s390/block/dasd_eckd.c +7 −2
  20. drivers/s390/char/raw3270.c +2 −0
  21. drivers/s390/cio/blacklist.c +5 −8
  22. drivers/s390/cio/chp.c +1 −1
  23. drivers/s390/cio/device.c +2 −2
  24. drivers/s390/cio/device.h +1 −0
  25. drivers/s390/cio/device_fsm.c +27 −8
  26. drivers/s390/crypto/zcrypt_pcixcc.c +8 −5
  27. include/linux/elf.h +1 −0
  28. lib/Kconfig.debug +4 −3
arch/s390/include/asm/delay.h+4−3
@@ -14,10 +14,11 @@ · 13 unmodified lines
1414 #ifndef _S390_DELAY_H
1515 #define _S390_DELAY_H
1616
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);
1919 extern void __delay(unsigned long loops);
2020
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)
2223
2324 #endif /* defined(_S390_DELAY_H) */
arch/s390/include/asm/elf.h+12−0
@@ -92,6 +92,18 @@ · 91 unmodified lines
9292 /* Keep this the last entry. */
9393 #define R_390_NUM 61
9494
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+
95107 /*
96108 * These are used to set parameters in the core dumps.
97109 */
arch/s390/include/asm/ptrace.h+4−0
@@ -311,6 +311,10 @@ typedef struct · 310 unmodified lines
311311 __u32 orig_gpr2;
312312 } s390_compat_regs;
313313
314+typedef struct
315+{
316+ __u32 gprs_high[NUM_GPRS];
317+} s390_compat_regs_high;
314318
315319 #ifdef __KERNEL__
316320
arch/s390/include/asm/ucontext.h+15−0
@@ -9,6 +9,21 @@ · 8 unmodified lines
99 #ifndef _ASM_S390_UCONTEXT_H
1010 #define _ASM_S390_UCONTEXT_H
1111
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+
1227 struct ucontext {
1328 unsigned long uc_flags;
1429 struct ucontext *uc_link;
arch/s390/kernel/compat_signal.c+34−1
@@ -39,6 +39,7 @@ typedef struct · 38 unmodified lines
3939 struct sigcontext32 sc;
4040 _sigregs32 sregs;
4141 int signo;
42+ __u32 gprs_high[NUM_GPRS];
4243 __u8 retcode[S390_SYSCALL_SIZE];
4344 } sigframe32;
4445
@@ -48,6 +49,7 @@ typedef struct · 3 unmodified lines
4849 __u8 retcode[S390_SYSCALL_SIZE];
4950 compat_siginfo_t info;
5051 struct ucontext32 uc;
52+ __u32 gprs_high[NUM_GPRS];
5153 } rt_sigframe32;
5254
5355 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
@@ -344,6 +346,30 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) · 290 unmodified lines
344346 return 0;
345347 }
346348
349+static int save_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs)
350+{
351+ __u32 gprs_high[NUM_GPRS];
352+ int i;
353+
354+ for (i = 0; i < NUM_GPRS; i++)
355+ gprs_high[i] = regs->gprs[i] >> 32;
356+
357+ return __copy_to_user(uregs, &gprs_high, sizeof(gprs_high));
358+}
359+
360+static int restore_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs)
361+{
362+ __u32 gprs_high[NUM_GPRS];
363+ int err, i;
364+
365+ err = __copy_from_user(&gprs_high, uregs, sizeof(gprs_high));
366+ if (err)
367+ return err;
368+ for (i = 0; i < NUM_GPRS; i++)
369+ *(__u32 *)&regs->gprs[i] = gprs_high[i];
370+ return 0;
371+}
372+
347373 asmlinkage long sys32_sigreturn(void)
348374 {
349375 struct pt_regs *regs = task_pt_regs(current);
@@ -363,6 +389,8 @@ asmlinkage long sys32_sigreturn(void) · 13 unmodified lines
363389
364390 if (restore_sigregs32(regs, &frame->sregs))
365391 goto badframe;
392+ if (restore_sigregs_gprs_high(regs, frame->gprs_high))
393+ goto badframe;
366394
367395 return regs->gprs[2];
368396
@@ -394,6 +422,8 @@ asmlinkage long sys32_rt_sigreturn(void) · 25 unmodified lines
394422
395423 if (restore_sigregs32(regs, &frame->uc.uc_mcontext))
396424 goto badframe;
425+ if (restore_sigregs_gprs_high(regs, frame->gprs_high))
426+ goto badframe;
397427
398428 err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp);
399429 st.ss_sp = compat_ptr(ss_sp);
@@ -474,6 +504,8 @@ static int setup_frame32(int sig, struct k_sigaction *ka, · 74 unmodified lines
474504
475505 if (save_sigregs32(regs, &frame->sregs))
476506 goto give_sigsegv;
507+ if (save_sigregs_gprs_high(regs, frame->gprs_high))
508+ goto give_sigsegv;
477509 if (__put_user((unsigned long) &frame->sregs, &frame->sc.sregs))
478510 goto give_sigsegv;
479511
@@ -529,13 +561,14 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info, · 49 unmodified lines
529561 goto give_sigsegv;
530562
531563 /* Create the ucontext. */
532− err |= __put_user(0, &frame->uc.uc_flags);
564+ err |= __put_user(UC_EXTENDED, &frame->uc.uc_flags);
533565 err |= __put_user(0, &frame->uc.uc_link);
534566 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
535567 err |= __put_user(sas_ss_flags(regs->gprs[15]),
536568 &frame->uc.uc_stack.ss_flags);
537569 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
538570 err |= save_sigregs32(regs, &frame->uc.uc_mcontext);
571+ err |= save_sigregs_gprs_high(regs, frame->gprs_high);
539572 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
540573 if (err)
541574 goto give_sigsegv;
arch/s390/kernel/compat_wrapper.S+1−1
@@ -409,7 +409,7 @@ sys32_munmap_wrapper: · 408 unmodified lines
409409 .globl sys32_truncate_wrapper
410410 sys32_truncate_wrapper:
411411 llgtr %r2,%r2 # const char *
412− llgfr %r3,%r3 # unsigned long
412+ lgfr %r3,%r3 # long
413413 jg sys_truncate # branch to system call
414414
415415 .globl sys32_ftruncate_wrapper
arch/s390/kernel/ftrace.c+0−3
@@ -185,9 +185,6 @@ unsigned long prepare_ftrace_return(unsigned long ip, unsigned long parent) · 184 unmodified lines
185185 {
186186 struct ftrace_graph_ent trace;
187187
188− /* Nmi's are currently unsupported. */
189− if (unlikely(in_nmi()))
190− goto out;
191188 if (unlikely(atomic_read(&current->tracing_graph_pause)))
192189 goto out;
193190 if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)
arch/s390/kernel/module.c+3−0
@@ -55,6 +55,8 @@ void *module_alloc(unsigned long size) · 54 unmodified lines
5555 /* Free memory returned from module_alloc */
5656 void module_free(struct module *mod, void *module_region)
5757 {
58+ vfree(mod->arch.syminfo);
59+ mod->arch.syminfo = NULL;
5860 vfree(module_region);
5961 }
6062
@@ -402,6 +404,7 @@ int module_finalize(const Elf_Ehdr *hdr, · 341 unmodified lines
402404 struct module *me)
403405 {
404406 vfree(me->arch.syminfo);
407+ me->arch.syminfo = NULL;
405408 return module_bug_finalize(hdr, sechdrs, me);
406409 }
407410
arch/s390/kernel/ptrace.c+70−0
@@ -57,6 +57,7 @@ · 56 unmodified lines
5757 enum s390_regset {
5858 REGSET_GENERAL,
5959 REGSET_FP,
60+ REGSET_GENERAL_EXTENDED,
6061 };
6162
6263 static void
@@ -879,6 +880,67 @@ static int s390_compat_regs_set(struct task_struct *target, · 816 unmodified lines
879880 return rc;
880881 }
881882
883+static int s390_compat_regs_high_get(struct task_struct *target,
884+ const struct user_regset *regset,
885+ unsigned int pos, unsigned int count,
886+ void *kbuf, void __user *ubuf)
887+{
888+ compat_ulong_t *gprs_high;
889+
890+ gprs_high = (compat_ulong_t *)
891+ &task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)];
892+ if (kbuf) {
893+ compat_ulong_t *k = kbuf;
894+ while (count > 0) {
895+ *k++ = *gprs_high;
896+ gprs_high += 2;
897+ count -= sizeof(*k);
898+ }
899+ } else {
900+ compat_ulong_t __user *u = ubuf;
901+ while (count > 0) {
902+ if (__put_user(*gprs_high, u++))
903+ return -EFAULT;
904+ gprs_high += 2;
905+ count -= sizeof(*u);
906+ }
907+ }
908+ return 0;
909+}
910+
911+static int s390_compat_regs_high_set(struct task_struct *target,
912+ const struct user_regset *regset,
913+ unsigned int pos, unsigned int count,
914+ const void *kbuf, const void __user *ubuf)
915+{
916+ compat_ulong_t *gprs_high;
917+ int rc = 0;
918+
919+ gprs_high = (compat_ulong_t *)
920+ &task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)];
921+ if (kbuf) {
922+ const compat_ulong_t *k = kbuf;
923+ while (count > 0) {
924+ *gprs_high = *k++;
925+ *gprs_high += 2;
926+ count -= sizeof(*k);
927+ }
928+ } else {
929+ const compat_ulong_t __user *u = ubuf;
930+ while (count > 0 && !rc) {
931+ unsigned long word;
932+ rc = __get_user(word, u++);
933+ if (rc)
934+ break;
935+ *gprs_high = word;
936+ *gprs_high += 2;
937+ count -= sizeof(*u);
938+ }
939+ }
940+
941+ return rc;
942+}
943+
882944 static const struct user_regset s390_compat_regsets[] = {
883945 [REGSET_GENERAL] = {
884946 .core_note_type = NT_PRSTATUS,
@@ -896,6 +958,14 @@ static const struct user_regset s390_compat_regsets[] = { · 11 unmodified lines
896958 .get = s390_fpregs_get,
897959 .set = s390_fpregs_set,
898960 },
961+ [REGSET_GENERAL_EXTENDED] = {
962+ .core_note_type = NT_PRXSTATUS,
963+ .n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t),
964+ .size = sizeof(compat_long_t),
965+ .align = sizeof(compat_long_t),
966+ .get = s390_compat_regs_high_get,
967+ .set = s390_compat_regs_high_set,
968+ },
899969 };
900970
901971 static const struct user_regset_view user_s390_compat_view = {
arch/s390/kernel/setup.c+12−3
@@ -729,7 +729,7 @@ static void __init setup_hwcaps(void) · 728 unmodified lines
729729
730730 if ((facility_list & (1UL << (31 - 22)))
731731 && (facility_list & (1UL << (31 - 30))))
732− elf_hwcap |= 1UL << 8;
732+ elf_hwcap |= HWCAP_S390_ETF3EH;
733733
734734 /*
735735 * Check for additional facilities with store-facility-list-extended.
@@ -748,11 +748,20 @@ static void __init setup_hwcaps(void) · 12 unmodified lines
748748 __stfle(&facility_list_extended, 1) > 0) {
749749 if ((facility_list_extended & (1ULL << (63 - 42)))
750750 && (facility_list_extended & (1ULL << (63 - 44))))
751− elf_hwcap |= 1UL << 6;
751+ elf_hwcap |= HWCAP_S390_DFP;
752752 }
753753
754+ /*
755+ * Huge page support HWCAP_S390_HPAGE is bit 7.
756+ */
754757 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;
756765
757766 switch (S390_lowcore.cpu_id.machine) {
758767 case 0x9672:
arch/s390/kernel/swsusp_asm64.S+19−7
@@ -43,7 +43,7 @@ swsusp_arch_suspend: · 42 unmodified lines
4343 lghi %r1,0x1000
4444
4545 /* Save CPU address */
46− stap __LC_CPU_ADDRESS(%r1)
46+ stap __LC_CPU_ADDRESS(%r0)
4747
4848 /* Store registers */
4949 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */
@@ -69,8 +69,21 @@ swsusp_arch_suspend: · 19 unmodified lines
6969 stmg %r0,%r15,0x280(%r1) /* store general registers */
7070
7171 stpt 0x328(%r1) /* store timer */
72+ stck __SF_EMPTY(%r15) /* store clock */
7273 stckc 0x330(%r1) /* store clock comparator */
7374
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)
86+
7487 /* Activate DAT */
7588 stosm __SF_EMPTY(%r15),0x04
7689
@@ -159,8 +172,7 @@ pgm_check_entry: · 82 unmodified lines
159172 larl %r1,.Lresume_cpu /* Resume CPU address: r2 */
160173 stap 0(%r1)
161174 llgh %r2,0(%r1)
162− lghi %r3,0x1000
163− llgh %r1,__LC_CPU_ADDRESS(%r3) /* Suspend CPU address: r1 */
175+ llgh %r1,__LC_CPU_ADDRESS(%r0) /* Suspend CPU address: r1 */
164176 cgr %r1,%r2
165177 je restore_registers /* r1 = r2 -> nothing to do */
166178 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */
@@ -200,8 +212,11 @@ restart_suspend: · 33 unmodified lines
200212
201213 restore_registers:
202214 /* Restore registers */
203− lghi %r13,0x1000 /* %r1 = pointer to save arae */
215+ lghi %r13,0x1000 /* %r1 = pointer to save area */
204216
217+ /* Ignore time spent in suspended state. */
218+ llgf %r1,0x318(%r13)
219+ stck __LC_LAST_UPDATE_CLOCK(%r1)
205220 spt 0x328(%r13) /* reprogram timer */
206221 //sckc 0x330(%r13) /* set clock comparator */
207222
@@ -229,9 +244,6 @@ restore_registers: · 21 unmodified lines
229244 /* Load old stack */
230245 lg %r15,0x2f8(%r13)
231246
232− /* Pointer to save area */
233− lghi %r13,0x1000
234−
235247 /* Restore prefix register */
236248 spx 0x318(%r13)
237249
arch/s390/kernel/vdso.c+8−8
@@ -246,6 +246,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) · 245 unmodified lines
246246 goto out_up;
247247 }
248248
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+
249256 /*
250257 * our vma flags don't have VM_WRITE so by default, the process
251258 * isn't allowed to write those pages.
@@ -267,14 +274,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) · 15 unmodified lines
267274 VM_ALWAYSDUMP,
268275 vdso_pagelist);
269276 if (rc)
270− goto out_up;
271−
272− /* Put vDSO base into mm struct */
273− current->mm->context.vdso_base = vdso_base;
274−
275− up_write(&mm->mmap_sem);
276− return 0;
277−
277+ current->mm->context.vdso_base = 0;
278278 out_up:
279279 up_write(&mm->mmap_sem);
280280 return rc;
arch/s390/kernel/vmlinux.lds.S+1−0
@@ -51,6 +51,7 @@ SECTIONS · 50 unmodified lines
5151
5252 . = ALIGN(PAGE_SIZE);
5353 _eshared = .; /* End of shareable data */
54+ _sdata = .; /* Start of data section */
5455
5556 EXCEPTION_TABLE(16) :data
5657
arch/s390/lib/delay.c+16−11
@@ -25,13 +25,13 @@ void __delay(unsigned long loops) · 24 unmodified lines
2525 asm volatile("0: brct %0,0b" : : "d" ((loops/2) + 1));
2626 }
2727
28−static void __udelay_disabled(unsigned long usecs)
28+static void __udelay_disabled(unsigned long long usecs)
2929 {
3030 unsigned long mask, cr0, cr0_saved;
3131 u64 clock_saved;
3232
3333 clock_saved = local_tick_disable();
34− set_clock_comparator(get_clock() + ((u64) usecs << 12));
34+ set_clock_comparator(get_clock() + (usecs << 12));
3535 __ctl_store(cr0_saved, 0, 0);
3636 cr0 = (cr0_saved & 0xffff00e0) | 0x00000800;
3737 __ctl_load(cr0 , 0, 0);
@@ -46,20 +46,25 @@ static void __udelay_disabled(unsigned long usecs) · 8 unmodified lines
4646 set_clock_comparator(S390_lowcore.clock_comparator);
4747 }
4848
49−static void __udelay_enabled(unsigned long usecs)
49+static void __udelay_enabled(unsigned long long usecs)
5050 {
5151 unsigned long mask;
52− u64 end, time;
52+ u64 clock_saved;
53+ u64 end;
5354
5455 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);
5657 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+ }
6063 trace_hardirqs_on();
6164 __load_psw_mask(mask);
6265 local_irq_disable();
66+ if (clock_saved)
67+ local_tick_enable(clock_saved);
6368 } while (get_clock() < end);
6469 set_clock_comparator(S390_lowcore.clock_comparator);
6570 }
@@ -67,7 +72,7 @@ static void __udelay_enabled(unsigned long usecs) · 1 unmodified line
6772 /*
6873 * Waits for 'usecs' microseconds using the TOD clock comparator.
6974 */
70−void __udelay(unsigned long usecs)
75+void __udelay(unsigned long long usecs)
7176 {
7277 unsigned long flags;
7378
@@ -101,11 +106,11 @@ EXPORT_SYMBOL(__udelay); · 27 unmodified lines
101106 * Simple udelay variant. To be used on startup and reboot
102107 * when the interrupt handler isn't working.
103108 */
104−void udelay_simple(unsigned long usecs)
109+void udelay_simple(unsigned long long usecs)
105110 {
106111 u64 end;
107112
108− end = get_clock() + ((u64) usecs << 12);
113+ end = get_clock() + (usecs << 12);
109114 while (get_clock() < end)
110115 cpu_relax();
111116 }
arch/s390/lib/uaccess_mvcos.c+6−6
@@ -36,7 +36,7 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x) · 35 unmodified lines
3636 tmp1 = -4096UL;
3737 asm volatile(
3838 "0: .insn ss,0xc80000000000,0(%0,%2),0(%1),0\n"
39− " jz 7f\n"
39+ "9: jz 7f\n"
4040 "1:"ALR" %0,%3\n"
4141 " "SLR" %1,%3\n"
4242 " "SLR" %2,%3\n"
@@ -47,7 +47,7 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x) · 4 unmodified lines
4747 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
4848 " jnh 4f\n"
4949 "3: .insn ss,0xc80000000000,0(%4,%2),0(%1),0\n"
50− " "SLR" %0,%4\n"
50+ "10:"SLR" %0,%4\n"
5151 " "ALR" %2,%4\n"
5252 "4:"LHI" %4,-1\n"
5353 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */
@@ -61,7 +61,7 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x) · 7 unmodified lines
6161 " j 8f\n"
6262 "7:"SLR" %0,%0\n"
6363 "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)
6565 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
6666 : "d" (reg0) : "cc", "memory");
6767 return size;
@@ -82,7 +82,7 @@ static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x) · 14 unmodified lines
8282 tmp1 = -4096UL;
8383 asm volatile(
8484 "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
85− " jz 4f\n"
85+ "6: jz 4f\n"
8686 "1:"ALR" %0,%3\n"
8787 " "SLR" %1,%3\n"
8888 " "SLR" %2,%3\n"
@@ -93,11 +93,11 @@ static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x) · 4 unmodified lines
9393 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
9494 " jnh 5f\n"
9595 "3: .insn ss,0xc80000000000,0(%4,%1),0(%2),0\n"
96− " "SLR" %0,%4\n"
96+ "7:"SLR" %0,%4\n"
9797 " j 5f\n"
9898 "4:"SLR" %0,%0\n"
9999 "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)
101101 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
102102 : "d" (reg0) : "cc", "memory");
103103 return size;
arch/s390/lib/uaccess_std.c+8−6
@@ -36,12 +36,12 @@ size_t copy_from_user_std(size_t size, const void __user *ptr, void *x) · 35 unmodified lines
3636 tmp1 = -256UL;
3737 asm volatile(
3838 "0: mvcp 0(%0,%2),0(%1),%3\n"
39− " jz 8f\n"
39+ "10:jz 8f\n"
4040 "1:"ALR" %0,%3\n"
4141 " la %1,256(%1)\n"
4242 " la %2,256(%2)\n"
4343 "2: mvcp 0(%0,%2),0(%1),%3\n"
44− " jnz 1b\n"
44+ "11:jnz 1b\n"
4545 " j 8f\n"
4646 "3: la %4,255(%1)\n" /* %4 = ptr + 255 */
4747 " "LHI" %3,-4096\n"
@@ -50,7 +50,7 @@ size_t copy_from_user_std(size_t size, const void __user *ptr, void *x) · 2 unmodified lines
5050 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
5151 " jnh 5f\n"
5252 "4: mvcp 0(%4,%2),0(%1),%3\n"
53− " "SLR" %0,%4\n"
53+ "12:"SLR" %0,%4\n"
5454 " "ALR" %2,%4\n"
5555 "5:"LHI" %4,-1\n"
5656 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */
@@ -65,6 +65,7 @@ size_t copy_from_user_std(size_t size, const void __user *ptr, void *x) · 8 unmodified lines
6565 "8:"SLR" %0,%0\n"
6666 "9: \n"
6767 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)
6869 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
6970 : : "cc", "memory");
7071 return size;
@@ -85,12 +86,12 @@ size_t copy_to_user_std(size_t size, void __user *ptr, const void *x) · 14 unmodified lines
8586 tmp1 = -256UL;
8687 asm volatile(
8788 "0: mvcs 0(%0,%1),0(%2),%3\n"
88− " jz 5f\n"
89+ "7: jz 5f\n"
8990 "1:"ALR" %0,%3\n"
9091 " la %1,256(%1)\n"
9192 " la %2,256(%2)\n"
9293 "2: mvcs 0(%0,%1),0(%2),%3\n"
93− " jnz 1b\n"
94+ "8: jnz 1b\n"
9495 " j 5f\n"
9596 "3: la %4,255(%1)\n" /* %4 = ptr + 255 */
9697 " "LHI" %3,-4096\n"
@@ -99,11 +100,12 @@ size_t copy_to_user_std(size_t size, void __user *ptr, const void *x) · 2 unmodified lines
99100 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
100101 " jnh 6f\n"
101102 "4: mvcs 0(%4,%1),0(%2),%3\n"
102− " "SLR" %0,%4\n"
103+ "9:"SLR" %0,%4\n"
103104 " j 6f\n"
104105 "5:"SLR" %0,%0\n"
105106 "6: \n"
106107 EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,6b)
108+ EX_TABLE(7b,3b) EX_TABLE(8b,3b) EX_TABLE(9b,6b)
107109 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
108110 : : "cc", "memory");
109111 return size;
arch/s390/mm/pgtable.c+8−2
@@ -279,7 +279,10 @@ int s390_enable_sie(void) · 278 unmodified lines
279279 /* lets check if we are allowed to replace the mm */
280280 task_lock(tsk);
281281 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) {
283286 task_unlock(tsk);
284287 return -EINVAL;
285288 }
@@ -295,7 +298,10 @@ int s390_enable_sie(void) · 9 unmodified lines
295298 /* Now lets check again if something happened */
296299 task_lock(tsk);
297300 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
298− tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) {
301+#ifdef CONFIG_AIO
302+ !hlist_empty(&tsk->mm->ioctx_list) ||
303+#endif
304+ tsk->mm != tsk->active_mm) {
299305 mmput(mm);
300306 task_unlock(tsk);
301307 return -EINVAL;
drivers/s390/block/dasd.c+3−2
@@ -2508,8 +2508,6 @@ int dasd_generic_restore_device(struct ccw_device *cdev) · 2507 unmodified lines
25082508 device->stopped &= ~DASD_UNRESUMED_PM;
25092509
25102510 dasd_schedule_device_bh(device);
2511− if (device->block)
2512− dasd_schedule_block_bh(device->block);
25132511
25142512 if (device->discipline->restore)
25152513 rc = device->discipline->restore(device);
@@ -2520,6 +2518,9 @@ int dasd_generic_restore_device(struct ccw_device *cdev) · 4 unmodified lines
25202518 */
25212519 device->stopped |= DASD_UNRESUMED_PM;
25222520
2521+ if (device->block)
2522+ dasd_schedule_block_bh(device->block);
2523+
25232524 dasd_put_device(device);
25242525 return 0;
25252526 }
drivers/s390/block/dasd_eckd.c+7−2
@@ -2338,6 +2338,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev, · 2337 unmodified lines
23382338 /* Calculate number of blocks/records per track. */
23392339 blksize = block->bp_block;
23402340 blk_per_trk = recs_per_track(&private->rdc_data, 0, blksize);
2341+ if (blk_per_trk == 0)
2342+ return ERR_PTR(-EINVAL);
23412343 /* Calculate record id of first and last block. */
23422344 first_rec = first_trk = blk_rq_pos(req) >> block->s2b_shift;
23432345 first_offs = sector_div(first_trk, blk_per_trk);
@@ -3211,6 +3213,7 @@ int dasd_eckd_pm_freeze(struct dasd_device *device) · 867 unmodified lines
32113213 int dasd_eckd_restore_device(struct dasd_device *device)
32123214 {
32133215 struct dasd_eckd_private *private;
3216+ struct dasd_eckd_characteristics temp_rdc_data;
32143217 int is_known, rc;
32153218 struct dasd_uid temp_uid;
32163219
@@ -3245,15 +3248,17 @@ int dasd_eckd_restore_device(struct dasd_device *device) · 28 unmodified lines
32453248 dasd_eckd_read_features(device);
32463249
32473250 /* Read Device Characteristics */
3248− memset(&private->rdc_data, 0, sizeof(private->rdc_data));
32493251 rc = dasd_generic_read_dev_chars(device, DASD_ECKD_MAGIC,
3250− &private->rdc_data, 64);
3252+ &temp_rdc_data, 64);
32513253 if (rc) {
32523254 DBF_EVENT(DBF_WARNING,
32533255 "Read device characteristics failed, rc=%d for "
32543256 "device: %s", rc, dev_name(&device->cdev->dev));
32553257 goto out_err;
32563258 }
3259+ spin_lock(get_ccwdev_lock(device->cdev));
3260+ memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data));
3261+ spin_unlock(get_ccwdev_lock(device->cdev));
32573262
32583263 /* add device to alias management */
32593264 dasd_alias_add_device(device);
drivers/s390/char/raw3270.c+2−0
@@ -1361,11 +1361,13 @@ static int raw3270_pm_start(struct ccw_device *cdev) · 1360 unmodified lines
13611361
13621362 void raw3270_pm_unfreeze(struct raw3270_view *view)
13631363 {
1364+#ifdef CONFIG_TN3270_CONSOLE
13641365 struct raw3270 *rp;
13651366
13661367 rp = view->dev;
13671368 if (rp && test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
13681369 ccw_device_force_console();
1370+#endif
13691371 }
13701372
13711373 static struct ccw_device_id raw3270_id[] = {
drivers/s390/cio/blacklist.c+5−8
@@ -265,13 +265,11 @@ struct ccwdev_iter { · 264 unmodified lines
265265 static void *
266266 cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset)
267267 {
268− struct ccwdev_iter *iter;
268+ struct ccwdev_iter *iter = s->private;
269269
270270 if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1))
271271 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));
275273 iter->ssid = *offset / (__MAX_SUBCHANNEL + 1);
276274 iter->devno = *offset % (__MAX_SUBCHANNEL + 1);
277275 return iter;
@@ -280,8 +278,6 @@ cio_ignore_proc_seq_start(struct seq_file *s, loff_t *offset) · 2 unmodified lines
280278 static void
281279 cio_ignore_proc_seq_stop(struct seq_file *s, void *it)
282280 {
283− if (!IS_ERR(it))
284− kfree(it);
285281 }
286282
287283 static void *
@@ -378,14 +374,15 @@ static const struct seq_operations cio_ignore_proc_seq_ops = { · 90 unmodified lines
378374 static int
379375 cio_ignore_proc_open(struct inode *inode, struct file *file)
380376 {
381− return seq_open(file, &cio_ignore_proc_seq_ops);
377+ return seq_open_private(file, &cio_ignore_proc_seq_ops,
378+ sizeof(struct ccwdev_iter));
382379 }
383380
384381 static const struct file_operations cio_ignore_proc_fops = {
385382 .open = cio_ignore_proc_open,
386383 .read = seq_read,
387384 .llseek = seq_lseek,
388− .release = seq_release,
385+ .release = seq_release_private,
389386 .write = cio_ignore_write,
390387 };
391388
drivers/s390/cio/chp.c+1−1
@@ -393,7 +393,6 @@ int chp_new(struct chp_id chpid) · 392 unmodified lines
393393 chp->state = 1;
394394 chp->dev.parent = &channel_subsystems[chpid.cssid]->device;
395395 chp->dev.release = chp_release;
396− dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
397396
398397 /* Obtain channel path description and fill it in. */
399398 ret = chsc_determine_base_channel_path_desc(chpid, &chp->desc);
@@ -411,6 +410,7 @@ int chp_new(struct chp_id chpid) · 11 unmodified lines
411410 } else {
412411 chp->cmg = -1;
413412 }
413+ dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
414414
415415 /* make it known to the system */
416416 ret = device_register(&chp->dev);
drivers/s390/cio/device.c+2−2
@@ -1609,7 +1609,7 @@ int ccw_purge_blacklisted(void) · 1608 unmodified lines
16091609 return 0;
16101610 }
16111611
1612−static void device_set_disconnected(struct ccw_device *cdev)
1612+void ccw_device_set_disconnected(struct ccw_device *cdev)
16131613 {
16141614 if (!cdev)
16151615 return;
@@ -1705,7 +1705,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int slow) · 89 unmodified lines
17051705 ccw_device_trigger_reprobe(cdev);
17061706 break;
17071707 case DISC:
1708− device_set_disconnected(cdev);
1708+ ccw_device_set_disconnected(cdev);
17091709 break;
17101710 default:
17111711 break;
drivers/s390/cio/device.h+1−0
@@ -125,6 +125,7 @@ int ccw_device_stlck(struct ccw_device *); · 124 unmodified lines
125125 void ccw_device_trigger_reprobe(struct ccw_device *);
126126 void ccw_device_kill_io(struct ccw_device *);
127127 int ccw_device_notify(struct ccw_device *, int);
128+void ccw_device_set_disconnected(struct ccw_device *cdev);
128129 void ccw_device_set_notoper(struct ccw_device *cdev);
129130
130131 /* qdio needs this. */
drivers/s390/cio/device_fsm.c+27−8
@@ -387,19 +387,35 @@ ccw_device_done(struct ccw_device *cdev, int state) · 386 unmodified lines
387387
388388 cdev->private->state = state;
389389
390− if (state == DEV_STATE_BOXED) {
390+ switch (state) {
391+ case DEV_STATE_BOXED:
391392 CIO_MSG_EVENT(0, "Boxed device %04x on subchannel %04x\n",
392393 cdev->private->dev_id.devno, sch->schid.sch_no);
393394 if (cdev->online && !ccw_device_notify(cdev, CIO_BOXED))
394395 ccw_device_schedule_sch_unregister(cdev);
395396 cdev->private->flags.donotify = 0;
396− }
397− if (state == DEV_STATE_NOT_OPER) {
397+ break;
398+ case DEV_STATE_NOT_OPER:
398399 CIO_MSG_EVENT(0, "Device %04x gone on subchannel %04x\n",
399400 cdev->private->dev_id.devno, sch->schid.sch_no);
400401 if (!ccw_device_notify(cdev, CIO_GONE))
401402 ccw_device_schedule_sch_unregister(cdev);
403+ else
404+ ccw_device_set_disconnected(cdev);
402405 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;
403419 }
404420
405421 if (cdev->private->flags.donotify) {
@@ -671,6 +687,10 @@ ccw_device_offline(struct ccw_device *cdev) · 265 unmodified lines
671687 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
672688 return 0;
673689 }
690+ if (cdev->private->state == DEV_STATE_BOXED) {
691+ ccw_device_done(cdev, DEV_STATE_BOXED);
692+ return 0;
693+ }
674694 if (ccw_device_is_orphan(cdev)) {
675695 ccw_device_done(cdev, DEV_STATE_OFFLINE);
676696 return 0;
@@ -730,11 +750,10 @@ ccw_device_recog_notoper(struct ccw_device *cdev, enum dev_event dev_event) · 53 unmodified lines
730750 static void ccw_device_generic_notoper(struct ccw_device *cdev,
731751 enum dev_event dev_event)
732752 {
733− struct subchannel *sch;
734−
735− ccw_device_set_notoper(cdev);
736− sch = to_subchannel(cdev->dev.parent);
737− css_schedule_eval(sch->schid);
753+ if (!ccw_device_notify(cdev, CIO_GONE))
754+ ccw_device_schedule_sch_unregister(cdev);
755+ else
756+ ccw_device_set_disconnected(cdev);
738757 }
739758
740759 /*
drivers/s390/crypto/zcrypt_pcixcc.c+8−5
@@ -361,7 +361,7 @@ static void rng_type6CPRB_msgX(struct ap_device *ap_dev, · 360 unmodified lines
361361 .ToCardLen1 = sizeof *msg - sizeof(msg->hdr),
362362 .FromCardLen1 = sizeof *msg - sizeof(msg->hdr),
363363 };
364− static struct CPRBX static_cprbx = {
364+ static struct CPRBX local_cprbx = {
365365 .cprb_len = 0x00dc,
366366 .cprb_ver_id = 0x02,
367367 .func_id = {0x54, 0x32},
@@ -372,7 +372,7 @@ static void rng_type6CPRB_msgX(struct ap_device *ap_dev, · 4 unmodified lines
372372
373373 msg->hdr = static_type6_hdrX;
374374 msg->hdr.FromCardLen2 = random_number_length,
375− msg->cprbx = static_cprbx;
375+ msg->cprbx = local_cprbx;
376376 msg->cprbx.rpl_datal = random_number_length,
377377 msg->cprbx.domain = AP_QID_QUEUE(ap_dev->qid);
378378 memcpy(msg->function_code, msg->hdr.function_code, 0x02);
@@ -561,7 +561,8 @@ static int convert_response_ica(struct zcrypt_device *zdev, · 182 unmodified lines
561561 if (msg->cprbx.cprb_ver_id == 0x02)
562562 return convert_type86_ica(zdev, reply,
563563 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 */
565566 default: /* Unknown response type, this should NEVER EVER happen */
566567 zdev->online = 0;
567568 return -EAGAIN; /* repeat the request on a different device. */
@@ -587,7 +588,8 @@ static int convert_response_xcrb(struct zcrypt_device *zdev, · 19 unmodified lines
587588 }
588589 if (msg->cprbx.cprb_ver_id == 0x02)
589590 return convert_type86_xcrb(zdev, reply, xcRB);
590− /* no break, incorrect cprb version is an unknown response */
591+ /* Fall through, no break, incorrect cprb version is an unknown
592+ * response */
591593 default: /* Unknown response type, this should NEVER EVER happen */
592594 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */
593595 zdev->online = 0;
@@ -610,7 +612,8 @@ static int convert_response_rng(struct zcrypt_device *zdev, · 16 unmodified lines
610612 return -EINVAL;
611613 if (msg->cprbx.cprb_ver_id == 0x02)
612614 return convert_type86_rng(zdev, reply, data);
613− /* no break, incorrect cprb version is an unknown response */
615+ /* Fall through, no break, incorrect cprb version is an unknown
616+ * response */
614617 default: /* Unknown response type, this should NEVER EVER happen */
615618 zdev->online = 0;
616619 return -EAGAIN; /* repeat the request on a different device. */
include/linux/elf.h+1−0
@@ -361,6 +361,7 @@ typedef struct elf64_shdr { · 360 unmodified lines
361361 #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
362362 #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
363363 #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
364+#define NT_PRXSTATUS 0x300 /* s390 upper register halves */
364365
365366
366367 /* Note header in a PT_NOTE section */
lib/Kconfig.debug+4−3
@@ -346,8 +346,9 @@ config SLUB_STATS · 345 unmodified lines
346346
347347 config DEBUG_KMEMLEAK
348348 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+
351352 select DEBUG_FS if SYSFS
352353 select STACKTRACE if STACKTRACE_SUPPORT
353354 select KALLSYMS
@@ -370,7 +371,7 @@ config DEBUG_KMEMLEAK · 16 unmodified lines
370371 config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
371372 int "Maximum kmemleak early log entries"
372373 depends on DEBUG_KMEMLEAK
373− range 200 2000
374+ range 200 40000
374375 default 400
375376 help
376377 Kmemleak must track all the memory allocations to avoid

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t