diff options
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 41 | ||||
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 9 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/ptrace.c | 8 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 8 | ||||
-rw-r--r-- | arch/s390/kernel/signal.c | 10 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 9 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 1 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 2 |
9 files changed, 36 insertions, 55 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 22c9e557bb22..11c3aba664ea 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -616,44 +616,35 @@ asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, | |||
616 | */ | 616 | */ |
617 | 617 | ||
618 | struct mmap_arg_struct_emu31 { | 618 | struct mmap_arg_struct_emu31 { |
619 | u32 addr; | 619 | compat_ulong_t addr; |
620 | u32 len; | 620 | compat_ulong_t len; |
621 | u32 prot; | 621 | compat_ulong_t prot; |
622 | u32 flags; | 622 | compat_ulong_t flags; |
623 | u32 fd; | 623 | compat_ulong_t fd; |
624 | u32 offset; | 624 | compat_ulong_t offset; |
625 | }; | 625 | }; |
626 | 626 | ||
627 | asmlinkage unsigned long | 627 | asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg) |
628 | old32_mmap(struct mmap_arg_struct_emu31 __user *arg) | ||
629 | { | 628 | { |
630 | struct mmap_arg_struct_emu31 a; | 629 | struct mmap_arg_struct_emu31 a; |
631 | int error = -EFAULT; | ||
632 | 630 | ||
633 | if (copy_from_user(&a, arg, sizeof(a))) | 631 | if (copy_from_user(&a, arg, sizeof(a))) |
634 | goto out; | 632 | return -EFAULT; |
635 | |||
636 | error = -EINVAL; | ||
637 | if (a.offset & ~PAGE_MASK) | 633 | if (a.offset & ~PAGE_MASK) |
638 | goto out; | 634 | return -EINVAL; |
639 | 635 | a.addr = (unsigned long) compat_ptr(a.addr); | |
640 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, | 636 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, |
641 | a.offset >> PAGE_SHIFT); | 637 | a.offset >> PAGE_SHIFT); |
642 | out: | ||
643 | return error; | ||
644 | } | 638 | } |
645 | 639 | ||
646 | asmlinkage long | 640 | asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) |
647 | sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) | ||
648 | { | 641 | { |
649 | struct mmap_arg_struct_emu31 a; | 642 | struct mmap_arg_struct_emu31 a; |
650 | int error = -EFAULT; | ||
651 | 643 | ||
652 | if (copy_from_user(&a, arg, sizeof(a))) | 644 | if (copy_from_user(&a, arg, sizeof(a))) |
653 | goto out; | 645 | return -EFAULT; |
654 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); | 646 | a.addr = (unsigned long) compat_ptr(a.addr); |
655 | out: | 647 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); |
656 | return error; | ||
657 | } | 648 | } |
658 | 649 | ||
659 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) | 650 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index faeaccc7d7d9..30de2d0e52bb 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1853,12 +1853,3 @@ sys32_execve_wrapper: | |||
1853 | llgtr %r3,%r3 # compat_uptr_t * | 1853 | llgtr %r3,%r3 # compat_uptr_t * |
1854 | llgtr %r4,%r4 # compat_uptr_t * | 1854 | llgtr %r4,%r4 # compat_uptr_t * |
1855 | jg sys32_execve # branch to system call | 1855 | jg sys32_execve # branch to system call |
1856 | |||
1857 | .globl compat_sys_recvmmsg_wrapper | ||
1858 | compat_sys_recvmmsg_wrapper: | ||
1859 | lgfr %r2,%r2 # int | ||
1860 | llgtr %r3,%r3 # struct compat_mmsghdr * | ||
1861 | llgfr %r4,%r4 # unsigned int | ||
1862 | llgfr %r5,%r5 # unsigned int | ||
1863 | llgtr %r6,%r6 # struct compat_timespec * | ||
1864 | jg compat_sys_recvmmsg | ||
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 5417eb57271a..00b6d1d292f2 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -153,8 +153,6 @@ void exit_thread(void) | |||
153 | 153 | ||
154 | void flush_thread(void) | 154 | void flush_thread(void) |
155 | { | 155 | { |
156 | clear_used_math(); | ||
157 | clear_tsk_thread_flag(current, TIF_USEDFPU); | ||
158 | } | 156 | } |
159 | 157 | ||
160 | void release_thread(struct task_struct *dead_task) | 158 | void release_thread(struct task_struct *dead_task) |
@@ -217,6 +215,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | |||
217 | p->thread.mm_segment = get_fs(); | 215 | p->thread.mm_segment = get_fs(); |
218 | /* Don't copy debug registers */ | 216 | /* Don't copy debug registers */ |
219 | memset(&p->thread.per_info, 0, sizeof(p->thread.per_info)); | 217 | memset(&p->thread.per_info, 0, sizeof(p->thread.per_info)); |
218 | clear_tsk_thread_flag(p, TIF_SINGLE_STEP); | ||
220 | /* Initialize per thread user and system timer values */ | 219 | /* Initialize per thread user and system timer values */ |
221 | ti = task_thread_info(p); | 220 | ti = task_thread_info(p); |
222 | ti->user_timer = 0; | 221 | ti->user_timer = 0; |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 13815d39f7dd..7cf464234419 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -65,6 +65,7 @@ FixPerRegisters(struct task_struct *task) | |||
65 | { | 65 | { |
66 | struct pt_regs *regs; | 66 | struct pt_regs *regs; |
67 | per_struct *per_info; | 67 | per_struct *per_info; |
68 | per_cr_words cr_words; | ||
68 | 69 | ||
69 | regs = task_pt_regs(task); | 70 | regs = task_pt_regs(task); |
70 | per_info = (per_struct *) &task->thread.per_info; | 71 | per_info = (per_struct *) &task->thread.per_info; |
@@ -98,6 +99,13 @@ FixPerRegisters(struct task_struct *task) | |||
98 | per_info->control_regs.bits.storage_alt_space_ctl = 1; | 99 | per_info->control_regs.bits.storage_alt_space_ctl = 1; |
99 | else | 100 | else |
100 | per_info->control_regs.bits.storage_alt_space_ctl = 0; | 101 | per_info->control_regs.bits.storage_alt_space_ctl = 0; |
102 | |||
103 | if (task == current) { | ||
104 | __ctl_store(cr_words, 9, 11); | ||
105 | if (memcmp(&cr_words, &per_info->control_regs.words, | ||
106 | sizeof(cr_words)) != 0) | ||
107 | __ctl_load(per_info->control_regs.words, 9, 11); | ||
108 | } | ||
101 | } | 109 | } |
102 | 110 | ||
103 | void user_enable_single_step(struct task_struct *task) | 111 | void user_enable_single_step(struct task_struct *task) |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 0663287fa1b3..8d8957b38ab3 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -87,7 +87,6 @@ unsigned long elf_hwcap = 0; | |||
87 | char elf_platform[ELF_PLATFORM_SIZE]; | 87 | char elf_platform[ELF_PLATFORM_SIZE]; |
88 | 88 | ||
89 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; | 89 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; |
90 | volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ | ||
91 | 90 | ||
92 | int __initdata memory_end_set; | 91 | int __initdata memory_end_set; |
93 | unsigned long __initdata memory_end; | 92 | unsigned long __initdata memory_end; |
@@ -124,12 +123,6 @@ void __cpuinit cpu_init(void) | |||
124 | */ | 123 | */ |
125 | get_cpu_id(&S390_lowcore.cpu_id); | 124 | get_cpu_id(&S390_lowcore.cpu_id); |
126 | 125 | ||
127 | /* | ||
128 | * Force FPU initialization: | ||
129 | */ | ||
130 | clear_thread_flag(TIF_USEDFPU); | ||
131 | clear_used_math(); | ||
132 | |||
133 | atomic_inc(&init_mm.mm_count); | 126 | atomic_inc(&init_mm.mm_count); |
134 | current->active_mm = &init_mm; | 127 | current->active_mm = &init_mm; |
135 | BUG_ON(current->mm); | 128 | BUG_ON(current->mm); |
@@ -855,7 +848,6 @@ setup_arch(char **cmdline_p) | |||
855 | setup_lowcore(); | 848 | setup_lowcore(); |
856 | 849 | ||
857 | cpu_init(); | 850 | cpu_init(); |
858 | __cpu_logical_map[0] = stap(); | ||
859 | s390_init_cpu_topology(); | 851 | s390_init_cpu_topology(); |
860 | 852 | ||
861 | /* | 853 | /* |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 6b4fef877f9d..1675c48b9145 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -500,18 +500,10 @@ void do_signal(struct pt_regs *regs) | |||
500 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 500 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
501 | 501 | ||
502 | /* | 502 | /* |
503 | * If we would have taken a single-step trap | ||
504 | * for a normal instruction, act like we took | ||
505 | * one for the handler setup. | ||
506 | */ | ||
507 | if (current->thread.per_info.single_step) | ||
508 | set_thread_flag(TIF_SINGLE_STEP); | ||
509 | |||
510 | /* | ||
511 | * Let tracing know that we've done the handler setup. | 503 | * Let tracing know that we've done the handler setup. |
512 | */ | 504 | */ |
513 | tracehook_signal_handler(signr, &info, &ka, regs, | 505 | tracehook_signal_handler(signr, &info, &ka, regs, |
514 | test_thread_flag(TIF_SINGLE_STEP)); | 506 | current->thread.per_info.single_step); |
515 | } | 507 | } |
516 | return; | 508 | return; |
517 | } | 509 | } |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 93e52039321b..76a6fdd46c45 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -52,6 +52,9 @@ | |||
52 | #include <asm/cpu.h> | 52 | #include <asm/cpu.h> |
53 | #include "entry.h" | 53 | #include "entry.h" |
54 | 54 | ||
55 | /* logical cpu to cpu address */ | ||
56 | int __cpu_logical_map[NR_CPUS]; | ||
57 | |||
55 | static struct task_struct *current_set[NR_CPUS]; | 58 | static struct task_struct *current_set[NR_CPUS]; |
56 | 59 | ||
57 | static u8 smp_cpu_type; | 60 | static u8 smp_cpu_type; |
@@ -717,6 +720,12 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
717 | { | 720 | { |
718 | } | 721 | } |
719 | 722 | ||
723 | void __init smp_setup_processor_id(void) | ||
724 | { | ||
725 | S390_lowcore.cpu_nr = 0; | ||
726 | __cpu_logical_map[0] = stap(); | ||
727 | } | ||
728 | |||
720 | /* | 729 | /* |
721 | * the frequency of the profiling timer can be changed | 730 | * the frequency of the profiling timer can be changed |
722 | * by writing a multiplier value into /proc/profile. | 731 | * by writing a multiplier value into /proc/profile. |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 4f292c936872..30eca070d426 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -340,4 +340,3 @@ SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper) | |||
340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) | 340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) |
341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */ | 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */ |
342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) | 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) |
343 | SYSCALL(sys_recvmmsg,sys_recvmmsg,compat_sys_recvmmsg_wrapper) | ||
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 3c72c9cf22b6..14ef6f05e432 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -114,7 +114,7 @@ static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core) | |||
114 | 114 | ||
115 | rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; | 115 | rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; |
116 | for_each_present_cpu(lcpu) { | 116 | for_each_present_cpu(lcpu) { |
117 | if (__cpu_logical_map[lcpu] == rcpu) { | 117 | if (cpu_logical_map(lcpu) == rcpu) { |
118 | cpu_set(lcpu, core->mask); | 118 | cpu_set(lcpu, core->mask); |
119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; | 119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; |
120 | } | 120 | } |