diff options
Diffstat (limited to 'arch/s390')
28 files changed, 124 insertions, 211 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 43c0acad7160..16c673096a22 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -95,6 +95,34 @@ config S390 | |||
95 | select HAVE_ARCH_TRACEHOOK | 95 | select HAVE_ARCH_TRACEHOOK |
96 | select INIT_ALL_POSSIBLE | 96 | select INIT_ALL_POSSIBLE |
97 | select HAVE_PERF_EVENTS | 97 | select HAVE_PERF_EVENTS |
98 | select ARCH_INLINE_SPIN_TRYLOCK | ||
99 | select ARCH_INLINE_SPIN_TRYLOCK_BH | ||
100 | select ARCH_INLINE_SPIN_LOCK | ||
101 | select ARCH_INLINE_SPIN_LOCK_BH | ||
102 | select ARCH_INLINE_SPIN_LOCK_IRQ | ||
103 | select ARCH_INLINE_SPIN_LOCK_IRQSAVE | ||
104 | select ARCH_INLINE_SPIN_UNLOCK | ||
105 | select ARCH_INLINE_SPIN_UNLOCK_BH | ||
106 | select ARCH_INLINE_SPIN_UNLOCK_IRQ | ||
107 | select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE | ||
108 | select ARCH_INLINE_READ_TRYLOCK | ||
109 | select ARCH_INLINE_READ_LOCK | ||
110 | select ARCH_INLINE_READ_LOCK_BH | ||
111 | select ARCH_INLINE_READ_LOCK_IRQ | ||
112 | select ARCH_INLINE_READ_LOCK_IRQSAVE | ||
113 | select ARCH_INLINE_READ_UNLOCK | ||
114 | select ARCH_INLINE_READ_UNLOCK_BH | ||
115 | select ARCH_INLINE_READ_UNLOCK_IRQ | ||
116 | select ARCH_INLINE_READ_UNLOCK_IRQRESTORE | ||
117 | select ARCH_INLINE_WRITE_TRYLOCK | ||
118 | select ARCH_INLINE_WRITE_LOCK | ||
119 | select ARCH_INLINE_WRITE_LOCK_BH | ||
120 | select ARCH_INLINE_WRITE_LOCK_IRQ | ||
121 | select ARCH_INLINE_WRITE_LOCK_IRQSAVE | ||
122 | select ARCH_INLINE_WRITE_UNLOCK | ||
123 | select ARCH_INLINE_WRITE_UNLOCK_BH | ||
124 | select ARCH_INLINE_WRITE_UNLOCK_IRQ | ||
125 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE | ||
98 | 126 | ||
99 | config SCHED_OMIT_FRAME_POINTER | 127 | config SCHED_OMIT_FRAME_POINTER |
100 | bool | 128 | bool |
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index b55fd7ed1c31..495589950dc7 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = { | |||
61 | { | 61 | { |
62 | .procname = "timer", | 62 | .procname = "timer", |
63 | .mode = S_IRUGO | S_IWUSR, | 63 | .mode = S_IRUGO | S_IWUSR, |
64 | .proc_handler = &appldata_timer_handler, | 64 | .proc_handler = appldata_timer_handler, |
65 | }, | 65 | }, |
66 | { | 66 | { |
67 | .procname = "interval", | 67 | .procname = "interval", |
68 | .mode = S_IRUGO | S_IWUSR, | 68 | .mode = S_IRUGO | S_IWUSR, |
69 | .proc_handler = &appldata_interval_handler, | 69 | .proc_handler = appldata_interval_handler, |
70 | }, | 70 | }, |
71 | { }, | 71 | { }, |
72 | }; | 72 | }; |
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c index fa741f84c5b9..4ce7fa95880f 100644 --- a/arch/s390/appldata/appldata_net_sum.c +++ b/arch/s390/appldata/appldata_net_sum.c | |||
@@ -83,8 +83,9 @@ static void appldata_get_net_sum_data(void *data) | |||
83 | rx_dropped = 0; | 83 | rx_dropped = 0; |
84 | tx_dropped = 0; | 84 | tx_dropped = 0; |
85 | collisions = 0; | 85 | collisions = 0; |
86 | read_lock(&dev_base_lock); | 86 | |
87 | for_each_netdev(&init_net, dev) { | 87 | rcu_read_lock(); |
88 | for_each_netdev_rcu(&init_net, dev) { | ||
88 | const struct net_device_stats *stats = dev_get_stats(dev); | 89 | const struct net_device_stats *stats = dev_get_stats(dev); |
89 | 90 | ||
90 | rx_packets += stats->rx_packets; | 91 | rx_packets += stats->rx_packets; |
@@ -98,7 +99,8 @@ static void appldata_get_net_sum_data(void *data) | |||
98 | collisions += stats->collisions; | 99 | collisions += stats->collisions; |
99 | i++; | 100 | i++; |
100 | } | 101 | } |
101 | read_unlock(&dev_base_lock); | 102 | rcu_read_unlock(); |
103 | |||
102 | net_data->nr_interfaces = i; | 104 | net_data->nr_interfaces = i; |
103 | net_data->rx_packets = rx_packets; | 105 | net_data->rx_packets = rx_packets; |
104 | net_data->tx_packets = tx_packets; | 106 | net_data->tx_packets = tx_packets; |
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c index 704dd396257b..77df726180ba 100644 --- a/arch/s390/hypfs/hypfs_diag.c +++ b/arch/s390/hypfs/hypfs_diag.c | |||
@@ -438,7 +438,7 @@ static int diag204_probe(void) | |||
438 | } | 438 | } |
439 | if (diag204((unsigned long)SUBC_STIB6 | | 439 | if (diag204((unsigned long)SUBC_STIB6 | |
440 | (unsigned long)INFO_EXT, pages, buf) >= 0) { | 440 | (unsigned long)INFO_EXT, pages, buf) >= 0) { |
441 | diag204_store_sc = SUBC_STIB7; | 441 | diag204_store_sc = SUBC_STIB6; |
442 | diag204_info_type = INFO_EXT; | 442 | diag204_info_type = INFO_EXT; |
443 | goto out; | 443 | goto out; |
444 | } | 444 | } |
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h index 7efd0abe8887..efb74fd5156e 100644 --- a/arch/s390/include/asm/bug.h +++ b/arch/s390/include/asm/bug.h | |||
@@ -49,7 +49,7 @@ | |||
49 | 49 | ||
50 | #define BUG() do { \ | 50 | #define BUG() do { \ |
51 | __EMIT_BUG(0); \ | 51 | __EMIT_BUG(0); \ |
52 | for (;;); \ | 52 | unreachable(); \ |
53 | } while (0) | 53 | } while (0) |
54 | 54 | ||
55 | #define WARN_ON(x) ({ \ | 55 | #define WARN_ON(x) ({ \ |
diff --git a/arch/s390/include/asm/cacheflush.h b/arch/s390/include/asm/cacheflush.h index 49d5af916d01..405cc97c6249 100644 --- a/arch/s390/include/asm/cacheflush.h +++ b/arch/s390/include/asm/cacheflush.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define flush_cache_dup_mm(mm) do { } while (0) | 10 | #define flush_cache_dup_mm(mm) do { } while (0) |
11 | #define flush_cache_range(vma, start, end) do { } while (0) | 11 | #define flush_cache_range(vma, start, end) do { } while (0) |
12 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) | 12 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) |
13 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | ||
13 | #define flush_dcache_page(page) do { } while (0) | 14 | #define flush_dcache_page(page) do { } while (0) |
14 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 15 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
15 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 16 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 24b1244aadb9..258ba88b7b50 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -78,7 +78,7 @@ cputime64_to_jiffies64(cputime64_t cputime) | |||
78 | static inline unsigned int | 78 | static inline unsigned int |
79 | cputime_to_msecs(const cputime_t cputime) | 79 | cputime_to_msecs(const cputime_t cputime) |
80 | { | 80 | { |
81 | return __div(cputime, 4096000); | 81 | return cputime_div(cputime, 4096000); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline cputime_t | 84 | static inline cputime_t |
@@ -160,7 +160,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value) | |||
160 | static inline clock_t | 160 | static inline clock_t |
161 | cputime_to_clock_t(cputime_t cputime) | 161 | cputime_to_clock_t(cputime_t cputime) |
162 | { | 162 | { |
163 | return __div(cputime, 4096000000ULL / USER_HZ); | 163 | return cputime_div(cputime, 4096000000ULL / USER_HZ); |
164 | } | 164 | } |
165 | 165 | ||
166 | static inline cputime_t | 166 | static inline cputime_t |
@@ -175,7 +175,7 @@ clock_t_to_cputime(unsigned long x) | |||
175 | static inline clock_t | 175 | static inline clock_t |
176 | cputime64_to_clock_t(cputime64_t cputime) | 176 | cputime64_to_clock_t(cputime64_t cputime) |
177 | { | 177 | { |
178 | return __div(cputime, 4096000000ULL / USER_HZ); | 178 | return cputime_div(cputime, 4096000000ULL / USER_HZ); |
179 | } | 179 | } |
180 | 180 | ||
181 | struct s390_idle_data { | 181 | struct s390_idle_data { |
@@ -183,6 +183,7 @@ struct s390_idle_data { | |||
183 | unsigned long long idle_count; | 183 | unsigned long long idle_count; |
184 | unsigned long long idle_enter; | 184 | unsigned long long idle_enter; |
185 | unsigned long long idle_time; | 185 | unsigned long long idle_time; |
186 | int nohz_delay; | ||
186 | }; | 187 | }; |
187 | 188 | ||
188 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); | 189 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); |
@@ -198,4 +199,11 @@ static inline void s390_idle_check(void) | |||
198 | vtime_start_cpu(); | 199 | vtime_start_cpu(); |
199 | } | 200 | } |
200 | 201 | ||
202 | static inline int s390_nohz_delay(int cpu) | ||
203 | { | ||
204 | return per_cpu(s390_idle, cpu).nohz_delay != 0; | ||
205 | } | ||
206 | |||
207 | #define arch_needs_cpu(cpu) s390_nohz_delay(cpu) | ||
208 | |||
201 | #endif /* _S390_CPUTIME_H */ | 209 | #endif /* _S390_CPUTIME_H */ |
diff --git a/arch/s390/include/asm/kvm.h b/arch/s390/include/asm/kvm.h index 3dfcaeb5d7f4..82b32a100c7d 100644 --- a/arch/s390/include/asm/kvm.h +++ b/arch/s390/include/asm/kvm.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #ifndef __LINUX_KVM_S390_H | 1 | #ifndef __LINUX_KVM_S390_H |
2 | #define __LINUX_KVM_S390_H | 2 | #define __LINUX_KVM_S390_H |
3 | |||
4 | /* | 3 | /* |
5 | * asm-s390/kvm.h - KVM s390 specific structures and definitions | 4 | * asm-s390/kvm.h - KVM s390 specific structures and definitions |
6 | * | 5 | * |
@@ -15,6 +14,8 @@ | |||
15 | */ | 14 | */ |
16 | #include <linux/types.h> | 15 | #include <linux/types.h> |
17 | 16 | ||
17 | #define __KVM_S390 | ||
18 | |||
18 | /* for KVM_GET_REGS and KVM_SET_REGS */ | 19 | /* for KVM_GET_REGS and KVM_SET_REGS */ |
19 | struct kvm_regs { | 20 | struct kvm_regs { |
20 | /* general purpose regs for s390 */ | 21 | /* general purpose regs for s390 */ |
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h index e42df89a0b85..fdff1e995c73 100644 --- a/arch/s390/include/asm/socket.h +++ b/arch/s390/include/asm/socket.h | |||
@@ -68,4 +68,6 @@ | |||
68 | #define SO_PROTOCOL 38 | 68 | #define SO_PROTOCOL 38 |
69 | #define SO_DOMAIN 39 | 69 | #define SO_DOMAIN 39 |
70 | 70 | ||
71 | #define SO_RXQ_OVFL 40 | ||
72 | |||
71 | #endif /* _ASM_SOCKET_H */ | 73 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h index 41ce6861174e..c9af0d19c7ab 100644 --- a/arch/s390/include/asm/spinlock.h +++ b/arch/s390/include/asm/spinlock.h | |||
@@ -191,33 +191,4 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
191 | #define _raw_read_relax(lock) cpu_relax() | 191 | #define _raw_read_relax(lock) cpu_relax() |
192 | #define _raw_write_relax(lock) cpu_relax() | 192 | #define _raw_write_relax(lock) cpu_relax() |
193 | 193 | ||
194 | #define __always_inline__spin_lock | ||
195 | #define __always_inline__read_lock | ||
196 | #define __always_inline__write_lock | ||
197 | #define __always_inline__spin_lock_bh | ||
198 | #define __always_inline__read_lock_bh | ||
199 | #define __always_inline__write_lock_bh | ||
200 | #define __always_inline__spin_lock_irq | ||
201 | #define __always_inline__read_lock_irq | ||
202 | #define __always_inline__write_lock_irq | ||
203 | #define __always_inline__spin_lock_irqsave | ||
204 | #define __always_inline__read_lock_irqsave | ||
205 | #define __always_inline__write_lock_irqsave | ||
206 | #define __always_inline__spin_trylock | ||
207 | #define __always_inline__read_trylock | ||
208 | #define __always_inline__write_trylock | ||
209 | #define __always_inline__spin_trylock_bh | ||
210 | #define __always_inline__spin_unlock | ||
211 | #define __always_inline__read_unlock | ||
212 | #define __always_inline__write_unlock | ||
213 | #define __always_inline__spin_unlock_bh | ||
214 | #define __always_inline__read_unlock_bh | ||
215 | #define __always_inline__write_unlock_bh | ||
216 | #define __always_inline__spin_unlock_irq | ||
217 | #define __always_inline__read_unlock_irq | ||
218 | #define __always_inline__write_unlock_irq | ||
219 | #define __always_inline__spin_unlock_irqrestore | ||
220 | #define __always_inline__read_unlock_irqrestore | ||
221 | #define __always_inline__write_unlock_irqrestore | ||
222 | |||
223 | #endif /* __ASM_SPINLOCK_H */ | 194 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 0debcec23a39..fda1a8123f9b 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd, | |||
527 | return ret; | 527 | return ret; |
528 | } | 528 | } |
529 | 529 | ||
530 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
531 | struct __sysctl_args32 { | ||
532 | u32 name; | ||
533 | int nlen; | ||
534 | u32 oldval; | ||
535 | u32 oldlenp; | ||
536 | u32 newval; | ||
537 | u32 newlen; | ||
538 | u32 __unused[4]; | ||
539 | }; | ||
540 | |||
541 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | ||
542 | { | ||
543 | struct __sysctl_args32 tmp; | ||
544 | int error; | ||
545 | size_t oldlen; | ||
546 | size_t __user *oldlenp = NULL; | ||
547 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
548 | |||
549 | if (copy_from_user(&tmp, args, sizeof(tmp))) | ||
550 | return -EFAULT; | ||
551 | |||
552 | if (tmp.oldval && tmp.oldlenp) { | ||
553 | /* Duh, this is ugly and might not work if sysctl_args | ||
554 | is in read-only memory, but do_sysctl does indirectly | ||
555 | a lot of uaccess in both directions and we'd have to | ||
556 | basically copy the whole sysctl.c here, and | ||
557 | glibc's __sysctl uses rw memory for the structure | ||
558 | anyway. */ | ||
559 | if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) || | ||
560 | put_user(oldlen, (size_t __user *)addr)) | ||
561 | return -EFAULT; | ||
562 | oldlenp = (size_t __user *)addr; | ||
563 | } | ||
564 | |||
565 | lock_kernel(); | ||
566 | error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval), | ||
567 | oldlenp, compat_ptr(tmp.newval), tmp.newlen); | ||
568 | unlock_kernel(); | ||
569 | if (oldlenp) { | ||
570 | if (!error) { | ||
571 | if (get_user(oldlen, (size_t __user *)addr) || | ||
572 | put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) | ||
573 | error = -EFAULT; | ||
574 | } | ||
575 | if (copy_to_user(args->__unused, tmp.__unused, | ||
576 | sizeof(tmp.__unused))) | ||
577 | error = -EFAULT; | ||
578 | } | ||
579 | return error; | ||
580 | } | ||
581 | #endif | ||
582 | |||
583 | struct stat64_emu31 { | 530 | struct stat64_emu31 { |
584 | unsigned long long st_dev; | 531 | unsigned long long st_dev; |
585 | unsigned int __pad1; | 532 | unsigned int __pad1; |
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index c07f9ca05ade..45e9092b3aad 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -162,7 +162,6 @@ struct ucontext32 { | |||
162 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 162 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
163 | }; | 163 | }; |
164 | 164 | ||
165 | struct __sysctl_args32; | ||
166 | struct stat64_emu31; | 165 | struct stat64_emu31; |
167 | struct mmap_arg_struct_emu31; | 166 | struct mmap_arg_struct_emu31; |
168 | struct fadvise64_64_args; | 167 | struct fadvise64_64_args; |
@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, | |||
212 | size_t count); | 211 | size_t count); |
213 | long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, | 212 | long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, |
214 | s32 count); | 213 | s32 count); |
215 | long sys32_sysctl(struct __sysctl_args32 __user *args); | ||
216 | long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); | 214 | long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); |
217 | long sys32_lstat64(char __user * filename, | 215 | long sys32_lstat64(char __user * filename, |
218 | struct stat64_emu31 __user * statbuf); | 216 | struct stat64_emu31 __user * statbuf); |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index cbd9901dc0f8..30de2d0e52bb 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper: | |||
689 | llgfr %r2,%r2 # unsigned int | 689 | llgfr %r2,%r2 # unsigned int |
690 | jg sys_fdatasync # branch to system call | 690 | jg sys_fdatasync # branch to system call |
691 | 691 | ||
692 | #sys32_sysctl_wrapper # tbd | ||
693 | |||
694 | .globl sys32_mlock_wrapper | 692 | .globl sys32_mlock_wrapper |
695 | sys32_mlock_wrapper: | 693 | sys32_mlock_wrapper: |
696 | llgfr %r2,%r2 # unsigned long | 694 | llgfr %r2,%r2 # unsigned long |
@@ -1087,8 +1085,8 @@ sys32_stime_wrapper: | |||
1087 | 1085 | ||
1088 | .globl sys32_sysctl_wrapper | 1086 | .globl sys32_sysctl_wrapper |
1089 | sys32_sysctl_wrapper: | 1087 | sys32_sysctl_wrapper: |
1090 | llgtr %r2,%r2 # struct __sysctl_args32 * | 1088 | llgtr %r2,%r2 # struct compat_sysctl_args * |
1091 | jg sys32_sysctl | 1089 | jg compat_sys_sysctl |
1092 | 1090 | ||
1093 | .globl sys32_fstat64_wrapper | 1091 | .globl sys32_fstat64_wrapper |
1094 | sys32_fstat64_wrapper: | 1092 | sys32_fstat64_wrapper: |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 20f282c911c2..071c81f179ef 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write, | |||
893 | 893 | ||
894 | static struct ctl_table s390dbf_table[] = { | 894 | static struct ctl_table s390dbf_table[] = { |
895 | { | 895 | { |
896 | .ctl_name = CTL_S390DBF_STOPPABLE, | ||
897 | .procname = "debug_stoppable", | 896 | .procname = "debug_stoppable", |
898 | .data = &debug_stoppable, | 897 | .data = &debug_stoppable, |
899 | .maxlen = sizeof(int), | 898 | .maxlen = sizeof(int), |
900 | .mode = S_IRUGO | S_IWUSR, | 899 | .mode = S_IRUGO | S_IWUSR, |
901 | .proc_handler = &proc_dointvec, | 900 | .proc_handler = proc_dointvec, |
902 | .strategy = &sysctl_intvec, | ||
903 | }, | 901 | }, |
904 | { | 902 | { |
905 | .ctl_name = CTL_S390DBF_ACTIVE, | ||
906 | .procname = "debug_active", | 903 | .procname = "debug_active", |
907 | .data = &debug_active, | 904 | .data = &debug_active, |
908 | .maxlen = sizeof(int), | 905 | .maxlen = sizeof(int), |
909 | .mode = S_IRUGO | S_IWUSR, | 906 | .mode = S_IRUGO | S_IWUSR, |
910 | .proc_handler = &s390dbf_procactive, | 907 | .proc_handler = s390dbf_procactive, |
911 | .strategy = &sysctl_intvec, | ||
912 | }, | 908 | }, |
913 | { .ctl_name = 0 } | 909 | { } |
914 | }; | 910 | }; |
915 | 911 | ||
916 | static struct ctl_table s390dbf_dir_table[] = { | 912 | static struct ctl_table s390dbf_dir_table[] = { |
917 | { | 913 | { |
918 | .ctl_name = CTL_S390DBF, | ||
919 | .procname = "s390dbf", | 914 | .procname = "s390dbf", |
920 | .maxlen = 0, | 915 | .maxlen = 0, |
921 | .mode = S_IRUGO | S_IXUGO, | 916 | .mode = S_IRUGO | S_IXUGO, |
922 | .child = s390dbf_table, | 917 | .child = s390dbf_table, |
923 | }, | 918 | }, |
924 | { .ctl_name = 0 } | 919 | { } |
925 | }; | 920 | }; |
926 | 921 | ||
927 | static struct ctl_table_header *s390dbf_sysctl_header; | 922 | static struct ctl_table_header *s390dbf_sysctl_header; |
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index bf8b4ae7ff2d..e49e9e0c69fd 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -55,6 +55,7 @@ static void __init reset_tod_clock(void) | |||
55 | disabled_wait(0); | 55 | disabled_wait(0); |
56 | 56 | ||
57 | sched_clock_base_cc = TOD_UNIX_EPOCH; | 57 | sched_clock_base_cc = TOD_UNIX_EPOCH; |
58 | S390_lowcore.last_update_clock = sched_clock_base_cc; | ||
58 | } | 59 | } |
59 | 60 | ||
60 | #ifdef CONFIG_SHARED_KERNEL | 61 | #ifdef CONFIG_SHARED_KERNEL |
@@ -167,6 +168,14 @@ static noinline __init void create_kernel_nss(void) | |||
167 | return; | 168 | return; |
168 | } | 169 | } |
169 | 170 | ||
171 | /* re-initialize cputime accounting. */ | ||
172 | sched_clock_base_cc = get_clock(); | ||
173 | S390_lowcore.last_update_clock = sched_clock_base_cc; | ||
174 | S390_lowcore.last_update_timer = 0x7fffffffffffffffULL; | ||
175 | S390_lowcore.user_timer = 0; | ||
176 | S390_lowcore.system_timer = 0; | ||
177 | asm volatile("SPT 0(%0)" : : "a" (&S390_lowcore.last_update_timer)); | ||
178 | |||
170 | /* re-setup boot command line with new ipl vm parms */ | 179 | /* re-setup boot command line with new ipl vm parms */ |
171 | ipl_update_parameters(); | 180 | ipl_update_parameters(); |
172 | setup_boot_command_line(); | 181 | setup_boot_command_line(); |
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index f43d2ee54464..48215d15762b 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
@@ -565,10 +565,10 @@ pgm_svcper: | |||
565 | lh %r7,0x8a # get svc number from lowcore | 565 | lh %r7,0x8a # get svc number from lowcore |
566 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct | 566 | l %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
567 | TRACE_IRQS_OFF | 567 | TRACE_IRQS_OFF |
568 | l %r1,__TI_task(%r9) | 568 | l %r8,__TI_task(%r9) |
569 | mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID | 569 | mvc __THREAD_per+__PER_atmid(2,%r8),__LC_PER_ATMID |
570 | mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS | 570 | mvc __THREAD_per+__PER_address(4,%r8),__LC_PER_ADDRESS |
571 | mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID | 571 | mvc __THREAD_per+__PER_access_id(1,%r8),__LC_PER_ACCESS_ID |
572 | oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP | 572 | oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP |
573 | TRACE_IRQS_ON | 573 | TRACE_IRQS_ON |
574 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | 574 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index a6f7b20df616..9aff1d449b6e 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
@@ -543,10 +543,10 @@ pgm_svcper: | |||
543 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER | 543 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
544 | llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore | 544 | llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore |
545 | lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct | 545 | lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct |
546 | lg %r1,__TI_task(%r9) | 546 | lg %r8,__TI_task(%r9) |
547 | mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID | 547 | mvc __THREAD_per+__PER_atmid(2,%r8),__LC_PER_ATMID |
548 | mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS | 548 | mvc __THREAD_per+__PER_address(8,%r8),__LC_PER_ADDRESS |
549 | mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID | 549 | mvc __THREAD_per+__PER_access_id(1,%r8),__LC_PER_ACCESS_ID |
550 | oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP | 550 | oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP |
551 | TRACE_IRQS_ON | 551 | TRACE_IRQS_ON |
552 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | 552 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts |
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index f5fe34dd821b..5a82bc68193e 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c | |||
@@ -203,73 +203,10 @@ out: | |||
203 | 203 | ||
204 | #ifdef CONFIG_FTRACE_SYSCALLS | 204 | #ifdef CONFIG_FTRACE_SYSCALLS |
205 | 205 | ||
206 | extern unsigned long __start_syscalls_metadata[]; | ||
207 | extern unsigned long __stop_syscalls_metadata[]; | ||
208 | extern unsigned int sys_call_table[]; | 206 | extern unsigned int sys_call_table[]; |
209 | 207 | ||
210 | static struct syscall_metadata **syscalls_metadata; | 208 | unsigned long __init arch_syscall_addr(int nr) |
211 | |||
212 | struct syscall_metadata *syscall_nr_to_meta(int nr) | ||
213 | { | ||
214 | if (!syscalls_metadata || nr >= NR_syscalls || nr < 0) | ||
215 | return NULL; | ||
216 | |||
217 | return syscalls_metadata[nr]; | ||
218 | } | ||
219 | |||
220 | int syscall_name_to_nr(char *name) | ||
221 | { | ||
222 | int i; | ||
223 | |||
224 | if (!syscalls_metadata) | ||
225 | return -1; | ||
226 | for (i = 0; i < NR_syscalls; i++) | ||
227 | if (syscalls_metadata[i]) | ||
228 | if (!strcmp(syscalls_metadata[i]->name, name)) | ||
229 | return i; | ||
230 | return -1; | ||
231 | } | ||
232 | |||
233 | void set_syscall_enter_id(int num, int id) | ||
234 | { | ||
235 | syscalls_metadata[num]->enter_id = id; | ||
236 | } | ||
237 | |||
238 | void set_syscall_exit_id(int num, int id) | ||
239 | { | 209 | { |
240 | syscalls_metadata[num]->exit_id = id; | 210 | return (unsigned long)sys_call_table[nr]; |
241 | } | ||
242 | |||
243 | static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | ||
244 | { | ||
245 | struct syscall_metadata *start; | ||
246 | struct syscall_metadata *stop; | ||
247 | char str[KSYM_SYMBOL_LEN]; | ||
248 | |||
249 | start = (struct syscall_metadata *)__start_syscalls_metadata; | ||
250 | stop = (struct syscall_metadata *)__stop_syscalls_metadata; | ||
251 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); | ||
252 | |||
253 | for ( ; start < stop; start++) { | ||
254 | if (start->name && !strcmp(start->name + 3, str + 3)) | ||
255 | return start; | ||
256 | } | ||
257 | return NULL; | ||
258 | } | ||
259 | |||
260 | static int __init arch_init_ftrace_syscalls(void) | ||
261 | { | ||
262 | struct syscall_metadata *meta; | ||
263 | int i; | ||
264 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * NR_syscalls, | ||
265 | GFP_KERNEL); | ||
266 | if (!syscalls_metadata) | ||
267 | return -ENOMEM; | ||
268 | for (i = 0; i < NR_syscalls; i++) { | ||
269 | meta = find_syscall_meta((unsigned long)sys_call_table[i]); | ||
270 | syscalls_metadata[i] = meta; | ||
271 | } | ||
272 | return 0; | ||
273 | } | 211 | } |
274 | arch_initcall(arch_init_ftrace_syscalls); | ||
275 | #endif | 212 | #endif |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index ee57a42e6e93..4890ac6d7faa 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -1595,10 +1595,9 @@ static void stop_run(struct shutdown_trigger *trigger) | |||
1595 | { | 1595 | { |
1596 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) | 1596 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) |
1597 | disabled_wait((unsigned long) __builtin_return_address(0)); | 1597 | disabled_wait((unsigned long) __builtin_return_address(0)); |
1598 | else { | 1598 | while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) |
1599 | signal_processor(smp_processor_id(), sigp_stop); | 1599 | cpu_relax(); |
1600 | for (;;); | 1600 | for (;;); |
1601 | } | ||
1602 | } | 1601 | } |
1603 | 1602 | ||
1604 | static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR, | 1603 | static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR, |
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 802c8ab247f3..0729f36c2fe3 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -31,9 +31,9 @@ void __cpuinit print_cpu_info(void) | |||
31 | 31 | ||
32 | static int show_cpuinfo(struct seq_file *m, void *v) | 32 | static int show_cpuinfo(struct seq_file *m, void *v) |
33 | { | 33 | { |
34 | static const char *hwcap_str[9] = { | 34 | static const char *hwcap_str[10] = { |
35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | 35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
36 | "edat", "etf3eh" | 36 | "edat", "etf3eh", "highgprs" |
37 | }; | 37 | }; |
38 | struct _lowcore *lc; | 38 | struct _lowcore *lc; |
39 | unsigned long n = (unsigned long) v - 1; | 39 | unsigned long n = (unsigned long) v - 1; |
@@ -48,7 +48,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
48 | num_online_cpus(), loops_per_jiffy/(500000/HZ), | 48 | num_online_cpus(), loops_per_jiffy/(500000/HZ), |
49 | (loops_per_jiffy/(5000/HZ))%100); | 49 | (loops_per_jiffy/(5000/HZ))%100); |
50 | seq_puts(m, "features\t: "); | 50 | seq_puts(m, "features\t: "); |
51 | for (i = 0; i < 9; i++) | 51 | for (i = 0; i < 10; i++) |
52 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | 52 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
53 | seq_printf(m, "%s ", hwcap_str[i]); | 53 | seq_printf(m, "%s ", hwcap_str[i]); |
54 | seq_puts(m, "\n"); | 54 | seq_puts(m, "\n"); |
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c index 0de305b598ce..59618bcd99b7 100644 --- a/arch/s390/kernel/s390_ext.c +++ b/arch/s390/kernel/s390_ext.c | |||
@@ -126,6 +126,8 @@ void __irq_entry do_extint(struct pt_regs *regs, unsigned short code) | |||
126 | /* Serve timer interrupts first. */ | 126 | /* Serve timer interrupts first. */ |
127 | clock_comparator_work(); | 127 | clock_comparator_work(); |
128 | kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; | 128 | kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; |
129 | if (code != 0x1004) | ||
130 | __get_cpu_var(s390_idle).nohz_delay = 1; | ||
129 | index = ext_hash(code); | 131 | index = ext_hash(code); |
130 | for (p = ext_int_hash[index]; p; p = p->next) { | 132 | for (p = ext_int_hash[index]; p; p = p->next) { |
131 | if (likely(p->code == code)) | 133 | if (likely(p->code == code)) |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index c932caa5e850..93e52039321b 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -76,7 +76,6 @@ static int cpu_stopped(int cpu) | |||
76 | __u32 status; | 76 | __u32 status; |
77 | 77 | ||
78 | switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { | 78 | switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { |
79 | case sigp_order_code_accepted: | ||
80 | case sigp_status_stored: | 79 | case sigp_status_stored: |
81 | /* Check for stopped and check stop state */ | 80 | /* Check for stopped and check stop state */ |
82 | if (status & 0x50) | 81 | if (status & 0x50) |
@@ -638,6 +637,8 @@ void __cpu_die(unsigned int cpu) | |||
638 | /* Wait until target cpu is down */ | 637 | /* Wait until target cpu is down */ |
639 | while (!cpu_stopped(cpu)) | 638 | while (!cpu_stopped(cpu)) |
640 | cpu_relax(); | 639 | cpu_relax(); |
640 | while (signal_processor_p(0, cpu, sigp_set_prefix) == sigp_busy) | ||
641 | udelay(10); | ||
641 | smp_free_lowcore(cpu); | 642 | smp_free_lowcore(cpu); |
642 | pr_info("Processor %d stopped\n", cpu); | 643 | pr_info("Processor %d stopped\n", cpu); |
643 | } | 644 | } |
@@ -645,8 +646,8 @@ void __cpu_die(unsigned int cpu) | |||
645 | void cpu_die(void) | 646 | void cpu_die(void) |
646 | { | 647 | { |
647 | idle_task_exit(); | 648 | idle_task_exit(); |
648 | signal_processor(smp_processor_id(), sigp_stop); | 649 | while (signal_processor(smp_processor_id(), sigp_stop) == sigp_busy) |
649 | BUG(); | 650 | cpu_relax(); |
650 | for (;;); | 651 | for (;;); |
651 | } | 652 | } |
652 | 653 | ||
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S index 7c8653e27db6..0c26cc1898ec 100644 --- a/arch/s390/kernel/swsusp_asm64.S +++ b/arch/s390/kernel/swsusp_asm64.S | |||
@@ -199,6 +199,7 @@ pgm_check_entry: | |||
199 | brc 2,4b /* busy, try again */ | 199 | brc 2,4b /* busy, try again */ |
200 | 5: | 200 | 5: |
201 | sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ | 201 | sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ |
202 | brc 2,5b /* busy, try again */ | ||
202 | 6: j 6b | 203 | 6: j 6b |
203 | 204 | ||
204 | restart_suspend: | 205 | restart_suspend: |
@@ -206,6 +207,7 @@ restart_suspend: | |||
206 | llgh %r2,0(%r1) | 207 | llgh %r2,0(%r1) |
207 | 7: | 208 | 7: |
208 | sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ | 209 | sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ |
210 | brc 8,7b /* accepted, status 0, still running */ | ||
209 | brc 2,7b /* busy, try again */ | 211 | brc 2,7b /* busy, try again */ |
210 | tmll %r9,0x40 /* Test if resume CPU is stopped */ | 212 | tmll %r9,0x40 /* Test if resume CPU is stopped */ |
211 | jz 7b | 213 | jz 7b |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 34162a0b2caa..68e1ecf5ebab 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -214,7 +214,8 @@ struct clocksource * __init clocksource_default_clock(void) | |||
214 | return &clocksource_tod; | 214 | return &clocksource_tod; |
215 | } | 215 | } |
216 | 216 | ||
217 | void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) | 217 | void update_vsyscall(struct timespec *wall_time, struct clocksource *clock, |
218 | u32 mult) | ||
218 | { | 219 | { |
219 | if (clock != &clocksource_tod) | 220 | if (clock != &clocksource_tod) |
220 | return; | 221 | return; |
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index c41bb0d416e1..b59a812a010e 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
@@ -167,6 +167,8 @@ void vtime_stop_cpu(void) | |||
167 | /* Wait for external, I/O or machine check interrupt. */ | 167 | /* Wait for external, I/O or machine check interrupt. */ |
168 | psw.mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT; | 168 | psw.mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT; |
169 | 169 | ||
170 | idle->nohz_delay = 0; | ||
171 | |||
170 | /* Check if the CPU timer needs to be reprogrammed. */ | 172 | /* Check if the CPU timer needs to be reprogrammed. */ |
171 | if (vq->do_spt) { | 173 | if (vq->do_spt) { |
172 | __u64 vmax = VTIMER_MAX_SLICE; | 174 | __u64 vmax = VTIMER_MAX_SLICE; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 07ced89740d7..f8bcaefd7d34 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -74,9 +74,10 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
74 | static unsigned long long *facilities; | 74 | static unsigned long long *facilities; |
75 | 75 | ||
76 | /* Section: not file related */ | 76 | /* Section: not file related */ |
77 | void kvm_arch_hardware_enable(void *garbage) | 77 | int kvm_arch_hardware_enable(void *garbage) |
78 | { | 78 | { |
79 | /* every s390 is virtualization enabled ;-) */ | 79 | /* every s390 is virtualization enabled ;-) */ |
80 | return 0; | ||
80 | } | 81 | } |
81 | 82 | ||
82 | void kvm_arch_hardware_disable(void *garbage) | 83 | void kvm_arch_hardware_disable(void *garbage) |
@@ -116,10 +117,16 @@ long kvm_arch_dev_ioctl(struct file *filp, | |||
116 | 117 | ||
117 | int kvm_dev_ioctl_check_extension(long ext) | 118 | int kvm_dev_ioctl_check_extension(long ext) |
118 | { | 119 | { |
120 | int r; | ||
121 | |||
119 | switch (ext) { | 122 | switch (ext) { |
123 | case KVM_CAP_S390_PSW: | ||
124 | r = 1; | ||
125 | break; | ||
120 | default: | 126 | default: |
121 | return 0; | 127 | r = 0; |
122 | } | 128 | } |
129 | return r; | ||
123 | } | 130 | } |
124 | 131 | ||
125 | /* Section: vm related */ | 132 | /* Section: vm related */ |
@@ -150,7 +157,7 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
150 | break; | 157 | break; |
151 | } | 158 | } |
152 | default: | 159 | default: |
153 | r = -EINVAL; | 160 | r = -ENOTTY; |
154 | } | 161 | } |
155 | 162 | ||
156 | return r; | 163 | return r; |
@@ -419,8 +426,10 @@ static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw) | |||
419 | vcpu_load(vcpu); | 426 | vcpu_load(vcpu); |
420 | if (atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_RUNNING) | 427 | if (atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_RUNNING) |
421 | rc = -EBUSY; | 428 | rc = -EBUSY; |
422 | else | 429 | else { |
423 | vcpu->arch.sie_block->gpsw = psw; | 430 | vcpu->run->psw_mask = psw.mask; |
431 | vcpu->run->psw_addr = psw.addr; | ||
432 | } | ||
424 | vcpu_put(vcpu); | 433 | vcpu_put(vcpu); |
425 | return rc; | 434 | return rc; |
426 | } | 435 | } |
@@ -508,9 +517,6 @@ rerun_vcpu: | |||
508 | 517 | ||
509 | switch (kvm_run->exit_reason) { | 518 | switch (kvm_run->exit_reason) { |
510 | case KVM_EXIT_S390_SIEIC: | 519 | case KVM_EXIT_S390_SIEIC: |
511 | vcpu->arch.sie_block->gpsw.mask = kvm_run->s390_sieic.mask; | ||
512 | vcpu->arch.sie_block->gpsw.addr = kvm_run->s390_sieic.addr; | ||
513 | break; | ||
514 | case KVM_EXIT_UNKNOWN: | 520 | case KVM_EXIT_UNKNOWN: |
515 | case KVM_EXIT_INTR: | 521 | case KVM_EXIT_INTR: |
516 | case KVM_EXIT_S390_RESET: | 522 | case KVM_EXIT_S390_RESET: |
@@ -519,6 +525,9 @@ rerun_vcpu: | |||
519 | BUG(); | 525 | BUG(); |
520 | } | 526 | } |
521 | 527 | ||
528 | vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask; | ||
529 | vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr; | ||
530 | |||
522 | might_fault(); | 531 | might_fault(); |
523 | 532 | ||
524 | do { | 533 | do { |
@@ -538,8 +547,6 @@ rerun_vcpu: | |||
538 | /* intercept cannot be handled in-kernel, prepare kvm-run */ | 547 | /* intercept cannot be handled in-kernel, prepare kvm-run */ |
539 | kvm_run->exit_reason = KVM_EXIT_S390_SIEIC; | 548 | kvm_run->exit_reason = KVM_EXIT_S390_SIEIC; |
540 | kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode; | 549 | kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode; |
541 | kvm_run->s390_sieic.mask = vcpu->arch.sie_block->gpsw.mask; | ||
542 | kvm_run->s390_sieic.addr = vcpu->arch.sie_block->gpsw.addr; | ||
543 | kvm_run->s390_sieic.ipa = vcpu->arch.sie_block->ipa; | 550 | kvm_run->s390_sieic.ipa = vcpu->arch.sie_block->ipa; |
544 | kvm_run->s390_sieic.ipb = vcpu->arch.sie_block->ipb; | 551 | kvm_run->s390_sieic.ipb = vcpu->arch.sie_block->ipb; |
545 | rc = 0; | 552 | rc = 0; |
@@ -551,6 +558,9 @@ rerun_vcpu: | |||
551 | rc = 0; | 558 | rc = 0; |
552 | } | 559 | } |
553 | 560 | ||
561 | kvm_run->psw_mask = vcpu->arch.sie_block->gpsw.mask; | ||
562 | kvm_run->psw_addr = vcpu->arch.sie_block->gpsw.addr; | ||
563 | |||
554 | if (vcpu->sigset_active) | 564 | if (vcpu->sigset_active) |
555 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | 565 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); |
556 | 566 | ||
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 40c8c6748cfe..15ee1111de58 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c | |||
@@ -188,9 +188,9 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
188 | 188 | ||
189 | /* make sure that the new value is valid memory */ | 189 | /* make sure that the new value is valid memory */ |
190 | address = address & 0x7fffe000u; | 190 | address = address & 0x7fffe000u; |
191 | if ((copy_from_guest(vcpu, &tmp, | 191 | if ((copy_from_user(&tmp, (void __user *) |
192 | (u64) (address + vcpu->arch.sie_block->gmsor) , 1)) || | 192 | (address + vcpu->arch.sie_block->gmsor) , 1)) || |
193 | (copy_from_guest(vcpu, &tmp, (u64) (address + | 193 | (copy_from_user(&tmp, (void __user *)(address + |
194 | vcpu->arch.sie_block->gmsor + PAGE_SIZE), 1))) { | 194 | vcpu->arch.sie_block->gmsor + PAGE_SIZE), 1))) { |
195 | *reg |= SIGP_STAT_INVALID_PARAMETER; | 195 | *reg |= SIGP_STAT_INVALID_PARAMETER; |
196 | return 1; /* invalid parameter */ | 196 | return 1; /* invalid parameter */ |
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index b201135cc18c..ff58779bf7e9 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c | |||
@@ -343,30 +343,29 @@ static struct ctl_table cmm_table[] = { | |||
343 | { | 343 | { |
344 | .procname = "cmm_pages", | 344 | .procname = "cmm_pages", |
345 | .mode = 0644, | 345 | .mode = 0644, |
346 | .proc_handler = &cmm_pages_handler, | 346 | .proc_handler = cmm_pages_handler, |
347 | }, | 347 | }, |
348 | { | 348 | { |
349 | .procname = "cmm_timed_pages", | 349 | .procname = "cmm_timed_pages", |
350 | .mode = 0644, | 350 | .mode = 0644, |
351 | .proc_handler = &cmm_pages_handler, | 351 | .proc_handler = cmm_pages_handler, |
352 | }, | 352 | }, |
353 | { | 353 | { |
354 | .procname = "cmm_timeout", | 354 | .procname = "cmm_timeout", |
355 | .mode = 0644, | 355 | .mode = 0644, |
356 | .proc_handler = &cmm_timeout_handler, | 356 | .proc_handler = cmm_timeout_handler, |
357 | }, | 357 | }, |
358 | { .ctl_name = 0 } | 358 | { } |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static struct ctl_table cmm_dir_table[] = { | 361 | static struct ctl_table cmm_dir_table[] = { |
362 | { | 362 | { |
363 | .ctl_name = CTL_VM, | ||
364 | .procname = "vm", | 363 | .procname = "vm", |
365 | .maxlen = 0, | 364 | .maxlen = 0, |
366 | .mode = 0555, | 365 | .mode = 0555, |
367 | .child = cmm_table, | 366 | .child = cmm_table, |
368 | }, | 367 | }, |
369 | { .ctl_name = 0 } | 368 | { } |
370 | }; | 369 | }; |
371 | #endif | 370 | #endif |
372 | 371 | ||