aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/Kconfig1
-rw-r--r--arch/s390/kernel/kprobes.c6
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/s390/kernel/setup.c4
-rw-r--r--arch/s390/kernel/smp.c36
-rw-r--r--arch/s390/kernel/time.c35
-rw-r--r--arch/s390/kernel/topology.c14
-rw-r--r--arch/s390/kvm/interrupt.c32
-rw-r--r--arch/s390/kvm/kvm-s390.c21
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/kvm/sigp.c20
-rw-r--r--arch/s390/mm/hugetlbpage.c8
-rw-r--r--arch/s390/mm/init.c32
13 files changed, 104 insertions, 109 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index eb530b4128ba..2ed88122be93 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -565,6 +565,7 @@ bool "s390 guest support (EXPERIMENTAL)"
565 depends on 64BIT && EXPERIMENTAL 565 depends on 64BIT && EXPERIMENTAL
566 select VIRTIO 566 select VIRTIO
567 select VIRTIO_RING 567 select VIRTIO_RING
568 select VIRTIO_CONSOLE
568 help 569 help
569 Select this option if you want to run the kernel under s390 linux 570 Select this option if you want to run the kernel under s390 linux
570endmenu 571endmenu
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 288ad490a6dd..4f82e5b5f879 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -270,7 +270,6 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
270 __ctl_store(kcb->kprobe_saved_ctl, 9, 11); 270 __ctl_store(kcb->kprobe_saved_ctl, 9, 11);
271} 271}
272 272
273/* Called with kretprobe_lock held */
274void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, 273void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
275 struct pt_regs *regs) 274 struct pt_regs *regs)
276{ 275{
@@ -377,8 +376,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
377 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; 376 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
378 377
379 INIT_HLIST_HEAD(&empty_rp); 378 INIT_HLIST_HEAD(&empty_rp);
380 spin_lock_irqsave(&kretprobe_lock, flags); 379 kretprobe_hash_lock(current, &head, &flags);
381 head = kretprobe_inst_table_head(current);
382 380
383 /* 381 /*
384 * It is possible to have multiple instances associated with a given 382 * It is possible to have multiple instances associated with a given
@@ -417,7 +415,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
417 regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; 415 regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE;
418 416
419 reset_current_kprobe(); 417 reset_current_kprobe();
420 spin_unlock_irqrestore(&kretprobe_lock, flags); 418 kretprobe_hash_unlock(current, &flags);
421 preempt_enable_no_resched(); 419 preempt_enable_no_resched();
422 420
423 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 421 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 85defd01d293..9839767d0842 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -142,7 +142,7 @@ static void default_idle(void)
142void cpu_idle(void) 142void cpu_idle(void)
143{ 143{
144 for (;;) { 144 for (;;) {
145 tick_nohz_stop_sched_tick(); 145 tick_nohz_stop_sched_tick(1);
146 while (!need_resched()) 146 while (!need_resched())
147 default_idle(); 147 default_idle();
148 tick_nohz_restart_sched_tick(); 148 tick_nohz_restart_sched_tick();
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b358e18273b0..62122bad1e33 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -54,6 +54,7 @@
54#include <asm/sections.h> 54#include <asm/sections.h>
55#include <asm/ebcdic.h> 55#include <asm/ebcdic.h>
56#include <asm/compat.h> 56#include <asm/compat.h>
57#include <asm/kvm_virtio.h>
57 58
58long psw_kernel_bits = (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | 59long psw_kernel_bits = (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY |
59 PSW_MASK_MCHECK | PSW_DEFAULT_KEY); 60 PSW_MASK_MCHECK | PSW_DEFAULT_KEY);
@@ -766,7 +767,8 @@ setup_arch(char **cmdline_p)
766 printk("We are running under VM (64 bit mode)\n"); 767 printk("We are running under VM (64 bit mode)\n");
767 else if (MACHINE_IS_KVM) { 768 else if (MACHINE_IS_KVM) {
768 printk("We are running under KVM (64 bit mode)\n"); 769 printk("We are running under KVM (64 bit mode)\n");
769 add_preferred_console("ttyS", 1, NULL); 770 add_preferred_console("hvc", 0, NULL);
771 s390_virtio_console_init();
770 } else 772 } else
771 printk("We are running native (64 bit mode)\n"); 773 printk("We are running native (64 bit mode)\n");
772#endif /* CONFIG_64BIT */ 774#endif /* CONFIG_64BIT */
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index b6781030cfbd..b795b3e24afd 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -864,7 +864,8 @@ int setup_profiling_timer(unsigned int multiplier)
864} 864}
865 865
866#ifdef CONFIG_HOTPLUG_CPU 866#ifdef CONFIG_HOTPLUG_CPU
867static ssize_t cpu_configure_show(struct sys_device *dev, char *buf) 867static ssize_t cpu_configure_show(struct sys_device *dev,
868 struct sysdev_attribute *attr, char *buf)
868{ 869{
869 ssize_t count; 870 ssize_t count;
870 871
@@ -874,8 +875,9 @@ static ssize_t cpu_configure_show(struct sys_device *dev, char *buf)
874 return count; 875 return count;
875} 876}
876 877
877static ssize_t cpu_configure_store(struct sys_device *dev, const char *buf, 878static ssize_t cpu_configure_store(struct sys_device *dev,
878 size_t count) 879 struct sysdev_attribute *attr,
880 const char *buf, size_t count)
879{ 881{
880 int cpu = dev->id; 882 int cpu = dev->id;
881 int val, rc; 883 int val, rc;
@@ -922,7 +924,8 @@ out:
922static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); 924static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
923#endif /* CONFIG_HOTPLUG_CPU */ 925#endif /* CONFIG_HOTPLUG_CPU */
924 926
925static ssize_t cpu_polarization_show(struct sys_device *dev, char *buf) 927static ssize_t cpu_polarization_show(struct sys_device *dev,
928 struct sysdev_attribute *attr, char *buf)
926{ 929{
927 int cpu = dev->id; 930 int cpu = dev->id;
928 ssize_t count; 931 ssize_t count;
@@ -950,7 +953,8 @@ static ssize_t cpu_polarization_show(struct sys_device *dev, char *buf)
950} 953}
951static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL); 954static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL);
952 955
953static ssize_t show_cpu_address(struct sys_device *dev, char *buf) 956static ssize_t show_cpu_address(struct sys_device *dev,
957 struct sysdev_attribute *attr, char *buf)
954{ 958{
955 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]); 959 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]);
956} 960}
@@ -970,7 +974,8 @@ static struct attribute_group cpu_common_attr_group = {
970 .attrs = cpu_common_attrs, 974 .attrs = cpu_common_attrs,
971}; 975};
972 976
973static ssize_t show_capability(struct sys_device *dev, char *buf) 977static ssize_t show_capability(struct sys_device *dev,
978 struct sysdev_attribute *attr, char *buf)
974{ 979{
975 unsigned int capability; 980 unsigned int capability;
976 int rc; 981 int rc;
@@ -982,7 +987,8 @@ static ssize_t show_capability(struct sys_device *dev, char *buf)
982} 987}
983static SYSDEV_ATTR(capability, 0444, show_capability, NULL); 988static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
984 989
985static ssize_t show_idle_count(struct sys_device *dev, char *buf) 990static ssize_t show_idle_count(struct sys_device *dev,
991 struct sysdev_attribute *attr, char *buf)
986{ 992{
987 struct s390_idle_data *idle; 993 struct s390_idle_data *idle;
988 unsigned long long idle_count; 994 unsigned long long idle_count;
@@ -995,7 +1001,8 @@ static ssize_t show_idle_count(struct sys_device *dev, char *buf)
995} 1001}
996static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 1002static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
997 1003
998static ssize_t show_idle_time(struct sys_device *dev, char *buf) 1004static ssize_t show_idle_time(struct sys_device *dev,
1005 struct sysdev_attribute *attr, char *buf)
999{ 1006{
1000 struct s390_idle_data *idle; 1007 struct s390_idle_data *idle;
1001 unsigned long long new_time; 1008 unsigned long long new_time;
@@ -1112,7 +1119,9 @@ out:
1112 return rc; 1119 return rc;
1113} 1120}
1114 1121
1115static ssize_t __ref rescan_store(struct sys_device *dev, const char *buf, 1122static ssize_t __ref rescan_store(struct sys_device *dev,
1123 struct sysdev_attribute *attr,
1124 const char *buf,
1116 size_t count) 1125 size_t count)
1117{ 1126{
1118 int rc; 1127 int rc;
@@ -1123,7 +1132,9 @@ static ssize_t __ref rescan_store(struct sys_device *dev, const char *buf,
1123static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store); 1132static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store);
1124#endif /* CONFIG_HOTPLUG_CPU */ 1133#endif /* CONFIG_HOTPLUG_CPU */
1125 1134
1126static ssize_t dispatching_show(struct sys_device *dev, char *buf) 1135static ssize_t dispatching_show(struct sys_device *dev,
1136 struct sysdev_attribute *attr,
1137 char *buf)
1127{ 1138{
1128 ssize_t count; 1139 ssize_t count;
1129 1140
@@ -1133,8 +1144,9 @@ static ssize_t dispatching_show(struct sys_device *dev, char *buf)
1133 return count; 1144 return count;
1134} 1145}
1135 1146
1136static ssize_t dispatching_store(struct sys_device *dev, const char *buf, 1147static ssize_t dispatching_store(struct sys_device *dev,
1137 size_t count) 1148 struct sysdev_attribute *attr,
1149 const char *buf, size_t count)
1138{ 1150{
1139 int val, rc; 1151 int val, rc;
1140 char delim; 1152 char delim;
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index f2cede3947b2..ab70d9bd9261 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -1100,7 +1100,9 @@ static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev)
1100 return etr_port1_online ? &etr_port1 : NULL; 1100 return etr_port1_online ? &etr_port1 : NULL;
1101} 1101}
1102 1102
1103static ssize_t etr_online_show(struct sys_device *dev, char *buf) 1103static ssize_t etr_online_show(struct sys_device *dev,
1104 struct sysdev_attribute *attr,
1105 char *buf)
1104{ 1106{
1105 unsigned int online; 1107 unsigned int online;
1106 1108
@@ -1109,7 +1111,8 @@ static ssize_t etr_online_show(struct sys_device *dev, char *buf)
1109} 1111}
1110 1112
1111static ssize_t etr_online_store(struct sys_device *dev, 1113static ssize_t etr_online_store(struct sys_device *dev,
1112 const char *buf, size_t count) 1114 struct sysdev_attribute *attr,
1115 const char *buf, size_t count)
1113{ 1116{
1114 unsigned int value; 1117 unsigned int value;
1115 1118
@@ -1136,7 +1139,9 @@ static ssize_t etr_online_store(struct sys_device *dev,
1136 1139
1137static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store); 1140static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store);
1138 1141
1139static ssize_t etr_stepping_control_show(struct sys_device *dev, char *buf) 1142static ssize_t etr_stepping_control_show(struct sys_device *dev,
1143 struct sysdev_attribute *attr,
1144 char *buf)
1140{ 1145{
1141 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ? 1146 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ?
1142 etr_eacr.e0 : etr_eacr.e1); 1147 etr_eacr.e0 : etr_eacr.e1);
@@ -1144,7 +1149,8 @@ static ssize_t etr_stepping_control_show(struct sys_device *dev, char *buf)
1144 1149
1145static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL); 1150static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL);
1146 1151
1147static ssize_t etr_mode_code_show(struct sys_device *dev, char *buf) 1152static ssize_t etr_mode_code_show(struct sys_device *dev,
1153 struct sysdev_attribute *attr, char *buf)
1148{ 1154{
1149 if (!etr_port0_online && !etr_port1_online) 1155 if (!etr_port0_online && !etr_port1_online)
1150 /* Status word is not uptodate if both ports are offline. */ 1156 /* Status word is not uptodate if both ports are offline. */
@@ -1155,7 +1161,8 @@ static ssize_t etr_mode_code_show(struct sys_device *dev, char *buf)
1155 1161
1156static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL); 1162static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL);
1157 1163
1158static ssize_t etr_untuned_show(struct sys_device *dev, char *buf) 1164static ssize_t etr_untuned_show(struct sys_device *dev,
1165 struct sysdev_attribute *attr, char *buf)
1159{ 1166{
1160 struct etr_aib *aib = etr_aib_from_dev(dev); 1167 struct etr_aib *aib = etr_aib_from_dev(dev);
1161 1168
@@ -1166,7 +1173,8 @@ static ssize_t etr_untuned_show(struct sys_device *dev, char *buf)
1166 1173
1167static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL); 1174static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL);
1168 1175
1169static ssize_t etr_network_id_show(struct sys_device *dev, char *buf) 1176static ssize_t etr_network_id_show(struct sys_device *dev,
1177 struct sysdev_attribute *attr, char *buf)
1170{ 1178{
1171 struct etr_aib *aib = etr_aib_from_dev(dev); 1179 struct etr_aib *aib = etr_aib_from_dev(dev);
1172 1180
@@ -1177,7 +1185,8 @@ static ssize_t etr_network_id_show(struct sys_device *dev, char *buf)
1177 1185
1178static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL); 1186static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL);
1179 1187
1180static ssize_t etr_id_show(struct sys_device *dev, char *buf) 1188static ssize_t etr_id_show(struct sys_device *dev,
1189 struct sysdev_attribute *attr, char *buf)
1181{ 1190{
1182 struct etr_aib *aib = etr_aib_from_dev(dev); 1191 struct etr_aib *aib = etr_aib_from_dev(dev);
1183 1192
@@ -1188,7 +1197,8 @@ static ssize_t etr_id_show(struct sys_device *dev, char *buf)
1188 1197
1189static SYSDEV_ATTR(id, 0400, etr_id_show, NULL); 1198static SYSDEV_ATTR(id, 0400, etr_id_show, NULL);
1190 1199
1191static ssize_t etr_port_number_show(struct sys_device *dev, char *buf) 1200static ssize_t etr_port_number_show(struct sys_device *dev,
1201 struct sysdev_attribute *attr, char *buf)
1192{ 1202{
1193 struct etr_aib *aib = etr_aib_from_dev(dev); 1203 struct etr_aib *aib = etr_aib_from_dev(dev);
1194 1204
@@ -1199,7 +1209,8 @@ static ssize_t etr_port_number_show(struct sys_device *dev, char *buf)
1199 1209
1200static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL); 1210static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL);
1201 1211
1202static ssize_t etr_coupled_show(struct sys_device *dev, char *buf) 1212static ssize_t etr_coupled_show(struct sys_device *dev,
1213 struct sysdev_attribute *attr, char *buf)
1203{ 1214{
1204 struct etr_aib *aib = etr_aib_from_dev(dev); 1215 struct etr_aib *aib = etr_aib_from_dev(dev);
1205 1216
@@ -1210,7 +1221,8 @@ static ssize_t etr_coupled_show(struct sys_device *dev, char *buf)
1210 1221
1211static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL); 1222static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL);
1212 1223
1213static ssize_t etr_local_time_show(struct sys_device *dev, char *buf) 1224static ssize_t etr_local_time_show(struct sys_device *dev,
1225 struct sysdev_attribute *attr, char *buf)
1214{ 1226{
1215 struct etr_aib *aib = etr_aib_from_dev(dev); 1227 struct etr_aib *aib = etr_aib_from_dev(dev);
1216 1228
@@ -1221,7 +1233,8 @@ static ssize_t etr_local_time_show(struct sys_device *dev, char *buf)
1221 1233
1222static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL); 1234static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL);
1223 1235
1224static ssize_t etr_utc_offset_show(struct sys_device *dev, char *buf) 1236static ssize_t etr_utc_offset_show(struct sys_device *dev,
1237 struct sysdev_attribute *attr, char *buf)
1225{ 1238{
1226 struct etr_aib *aib = etr_aib_from_dev(dev); 1239 struct etr_aib *aib = etr_aib_from_dev(dev);
1227 1240
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 212d618b0095..632b13e10053 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -9,7 +9,6 @@
9#include <linux/device.h> 9#include <linux/device.h>
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/kthread.h>
13#include <linux/workqueue.h> 12#include <linux/workqueue.h>
14#include <linux/cpu.h> 13#include <linux/cpu.h>
15#include <linux/smp.h> 14#include <linux/smp.h>
@@ -230,20 +229,9 @@ void arch_update_cpu_topology(void)
230 } 229 }
231} 230}
232 231
233static int topology_kthread(void *data)
234{
235 arch_reinit_sched_domains();
236 return 0;
237}
238
239static void topology_work_fn(struct work_struct *work) 232static void topology_work_fn(struct work_struct *work)
240{ 233{
241 /* We can't call arch_reinit_sched_domains() from a multi-threaded 234 arch_reinit_sched_domains();
242 * workqueue context since it may deadlock in case of cpu hotplug.
243 * So we have to create a kernel thread in order to call
244 * arch_reinit_sched_domains().
245 */
246 kthread_run(topology_kthread, NULL, "topology_update");
247} 235}
248 236
249void topology_schedule_update(void) 237void topology_schedule_update(void)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 84a7fed4cd4e..11230b0db957 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -31,7 +31,7 @@ static int psw_interrupts_disabled(struct kvm_vcpu *vcpu)
31} 31}
32 32
33static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu, 33static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
34 struct interrupt_info *inti) 34 struct kvm_s390_interrupt_info *inti)
35{ 35{
36 switch (inti->type) { 36 switch (inti->type) {
37 case KVM_S390_INT_EMERGENCY: 37 case KVM_S390_INT_EMERGENCY:
@@ -91,7 +91,7 @@ static void __set_cpuflag(struct kvm_vcpu *vcpu, u32 flag)
91} 91}
92 92
93static void __set_intercept_indicator(struct kvm_vcpu *vcpu, 93static void __set_intercept_indicator(struct kvm_vcpu *vcpu,
94 struct interrupt_info *inti) 94 struct kvm_s390_interrupt_info *inti)
95{ 95{
96 switch (inti->type) { 96 switch (inti->type) {
97 case KVM_S390_INT_EMERGENCY: 97 case KVM_S390_INT_EMERGENCY:
@@ -111,7 +111,7 @@ static void __set_intercept_indicator(struct kvm_vcpu *vcpu,
111} 111}
112 112
113static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, 113static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
114 struct interrupt_info *inti) 114 struct kvm_s390_interrupt_info *inti)
115{ 115{
116 const unsigned short table[] = { 2, 4, 4, 6 }; 116 const unsigned short table[] = { 2, 4, 4, 6 };
117 int rc, exception = 0; 117 int rc, exception = 0;
@@ -290,9 +290,9 @@ static int __try_deliver_ckc_interrupt(struct kvm_vcpu *vcpu)
290 290
291int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu) 291int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu)
292{ 292{
293 struct local_interrupt *li = &vcpu->arch.local_int; 293 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
294 struct float_interrupt *fi = vcpu->arch.local_int.float_int; 294 struct kvm_s390_float_interrupt *fi = vcpu->arch.local_int.float_int;
295 struct interrupt_info *inti; 295 struct kvm_s390_interrupt_info *inti;
296 int rc = 0; 296 int rc = 0;
297 297
298 if (atomic_read(&li->active)) { 298 if (atomic_read(&li->active)) {
@@ -408,9 +408,9 @@ void kvm_s390_idle_wakeup(unsigned long data)
408 408
409void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu) 409void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
410{ 410{
411 struct local_interrupt *li = &vcpu->arch.local_int; 411 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
412 struct float_interrupt *fi = vcpu->arch.local_int.float_int; 412 struct kvm_s390_float_interrupt *fi = vcpu->arch.local_int.float_int;
413 struct interrupt_info *n, *inti = NULL; 413 struct kvm_s390_interrupt_info *n, *inti = NULL;
414 int deliver; 414 int deliver;
415 415
416 __reset_intercept_indicators(vcpu); 416 __reset_intercept_indicators(vcpu);
@@ -465,8 +465,8 @@ void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
465 465
466int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code) 466int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code)
467{ 467{
468 struct local_interrupt *li = &vcpu->arch.local_int; 468 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
469 struct interrupt_info *inti; 469 struct kvm_s390_interrupt_info *inti;
470 470
471 inti = kzalloc(sizeof(*inti), GFP_KERNEL); 471 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
472 if (!inti) 472 if (!inti)
@@ -487,9 +487,9 @@ int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code)
487int kvm_s390_inject_vm(struct kvm *kvm, 487int kvm_s390_inject_vm(struct kvm *kvm,
488 struct kvm_s390_interrupt *s390int) 488 struct kvm_s390_interrupt *s390int)
489{ 489{
490 struct local_interrupt *li; 490 struct kvm_s390_local_interrupt *li;
491 struct float_interrupt *fi; 491 struct kvm_s390_float_interrupt *fi;
492 struct interrupt_info *inti; 492 struct kvm_s390_interrupt_info *inti;
493 int sigcpu; 493 int sigcpu;
494 494
495 inti = kzalloc(sizeof(*inti), GFP_KERNEL); 495 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
@@ -544,8 +544,8 @@ int kvm_s390_inject_vm(struct kvm *kvm,
544int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, 544int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
545 struct kvm_s390_interrupt *s390int) 545 struct kvm_s390_interrupt *s390int)
546{ 546{
547 struct local_interrupt *li; 547 struct kvm_s390_local_interrupt *li;
548 struct interrupt_info *inti; 548 struct kvm_s390_interrupt_info *inti;
549 549
550 inti = kzalloc(sizeof(*inti), GFP_KERNEL); 550 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
551 if (!inti) 551 if (!inti)
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 6558b09ff579..1782cbcd2829 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -79,10 +79,6 @@ void kvm_arch_hardware_disable(void *garbage)
79{ 79{
80} 80}
81 81
82void decache_vcpus_on_cpu(int cpu)
83{
84}
85
86int kvm_arch_hardware_setup(void) 82int kvm_arch_hardware_setup(void)
87{ 83{
88 return 0; 84 return 0;
@@ -198,6 +194,7 @@ out_nokvm:
198void kvm_arch_destroy_vm(struct kvm *kvm) 194void kvm_arch_destroy_vm(struct kvm *kvm)
199{ 195{
200 debug_unregister(kvm->arch.dbf); 196 debug_unregister(kvm->arch.dbf);
197 kvm_free_physmem(kvm);
201 free_page((unsigned long)(kvm->arch.sca)); 198 free_page((unsigned long)(kvm->arch.sca));
202 kfree(kvm); 199 kfree(kvm);
203 module_put(THIS_MODULE); 200 module_put(THIS_MODULE);
@@ -250,11 +247,16 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
250 vcpu->arch.sie_block->gbea = 1; 247 vcpu->arch.sie_block->gbea = 1;
251} 248}
252 249
250/* The current code can have up to 256 pages for virtio */
251#define VIRTIODESCSPACE (256ul * 4096ul)
252
253int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) 253int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
254{ 254{
255 atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH); 255 atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH);
256 vcpu->arch.sie_block->gmslm = 0xffffffffffUL; 256 vcpu->arch.sie_block->gmslm = vcpu->kvm->arch.guest_memsize +
257 vcpu->arch.sie_block->gmsor = 0x000000000000; 257 vcpu->kvm->arch.guest_origin +
258 VIRTIODESCSPACE - 1ul;
259 vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin;
258 vcpu->arch.sie_block->ecb = 2; 260 vcpu->arch.sie_block->ecb = 2;
259 vcpu->arch.sie_block->eca = 0xC1002001U; 261 vcpu->arch.sie_block->eca = 0xC1002001U;
260 setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, 262 setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup,
@@ -273,7 +275,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
273 if (!vcpu) 275 if (!vcpu)
274 goto out_nomem; 276 goto out_nomem;
275 277
276 vcpu->arch.sie_block = (struct sie_block *) get_zeroed_page(GFP_KERNEL); 278 vcpu->arch.sie_block = (struct kvm_s390_sie_block *)
279 get_zeroed_page(GFP_KERNEL);
277 280
278 if (!vcpu->arch.sie_block) 281 if (!vcpu->arch.sie_block)
279 goto out_free_cpu; 282 goto out_free_cpu;
@@ -672,6 +675,10 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
672 return 0; 675 return 0;
673} 676}
674 677
678void kvm_arch_flush_shadow(struct kvm *kvm)
679{
680}
681
675gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) 682gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn)
676{ 683{
677 return gfn; 684 return gfn;
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index c02286c6a931..2e2d2ffb6a07 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -199,7 +199,7 @@ out:
199 199
200static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem) 200static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem)
201{ 201{
202 struct float_interrupt *fi = &vcpu->kvm->arch.float_int; 202 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
203 int cpus = 0; 203 int cpus = 0;
204 int n; 204 int n;
205 205
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 0a236acfb5f6..5a556114eaa5 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -45,7 +45,7 @@
45 45
46static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, u64 *reg) 46static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, u64 *reg)
47{ 47{
48 struct float_interrupt *fi = &vcpu->kvm->arch.float_int; 48 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
49 int rc; 49 int rc;
50 50
51 if (cpu_addr >= KVM_MAX_VCPUS) 51 if (cpu_addr >= KVM_MAX_VCPUS)
@@ -71,9 +71,9 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, u64 *reg)
71 71
72static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) 72static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr)
73{ 73{
74 struct float_interrupt *fi = &vcpu->kvm->arch.float_int; 74 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
75 struct local_interrupt *li; 75 struct kvm_s390_local_interrupt *li;
76 struct interrupt_info *inti; 76 struct kvm_s390_interrupt_info *inti;
77 int rc; 77 int rc;
78 78
79 if (cpu_addr >= KVM_MAX_VCPUS) 79 if (cpu_addr >= KVM_MAX_VCPUS)
@@ -108,9 +108,9 @@ unlock:
108 108
109static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int store) 109static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int store)
110{ 110{
111 struct float_interrupt *fi = &vcpu->kvm->arch.float_int; 111 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
112 struct local_interrupt *li; 112 struct kvm_s390_local_interrupt *li;
113 struct interrupt_info *inti; 113 struct kvm_s390_interrupt_info *inti;
114 int rc; 114 int rc;
115 115
116 if (cpu_addr >= KVM_MAX_VCPUS) 116 if (cpu_addr >= KVM_MAX_VCPUS)
@@ -169,9 +169,9 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
169static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, 169static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
170 u64 *reg) 170 u64 *reg)
171{ 171{
172 struct float_interrupt *fi = &vcpu->kvm->arch.float_int; 172 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
173 struct local_interrupt *li; 173 struct kvm_s390_local_interrupt *li;
174 struct interrupt_info *inti; 174 struct kvm_s390_interrupt_info *inti;
175 int rc; 175 int rc;
176 u8 tmp; 176 u8 tmp;
177 177
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index f4b6124fdb75..f28c43d2f61d 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -72,7 +72,8 @@ void arch_release_hugepage(struct page *page)
72 page[1].index = 0; 72 page[1].index = 0;
73} 73}
74 74
75pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 75pte_t *huge_pte_alloc(struct mm_struct *mm,
76 unsigned long addr, unsigned long sz)
76{ 77{
77 pgd_t *pgdp; 78 pgd_t *pgdp;
78 pud_t *pudp; 79 pud_t *pudp;
@@ -119,6 +120,11 @@ int pmd_huge(pmd_t pmd)
119 return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE); 120 return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
120} 121}
121 122
123int pud_huge(pud_t pud)
124{
125 return 0;
126}
127
122struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, 128struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
123 pmd_t *pmdp, int write) 129 pmd_t *pmdp, int write)
124{ 130{
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 388cc7420055..4993b0f594eb 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -42,38 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); 42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
43char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); 43char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
44 44
45void show_mem(void)
46{
47 unsigned long i, total = 0, reserved = 0;
48 unsigned long shared = 0, cached = 0;
49 unsigned long flags;
50 struct page *page;
51 pg_data_t *pgdat;
52
53 printk("Mem-info:\n");
54 show_free_areas();
55 for_each_online_pgdat(pgdat) {
56 pgdat_resize_lock(pgdat, &flags);
57 for (i = 0; i < pgdat->node_spanned_pages; i++) {
58 if (!pfn_valid(pgdat->node_start_pfn + i))
59 continue;
60 page = pfn_to_page(pgdat->node_start_pfn + i);
61 total++;
62 if (PageReserved(page))
63 reserved++;
64 else if (PageSwapCache(page))
65 cached++;
66 else if (page_count(page))
67 shared += page_count(page) - 1;
68 }
69 pgdat_resize_unlock(pgdat, &flags);
70 }
71 printk("%ld pages of RAM\n", total);
72 printk("%ld reserved pages\n", reserved);
73 printk("%ld pages shared\n", shared);
74 printk("%ld pages swap cached\n", cached);
75}
76
77/* 45/*
78 * paging_init() sets up the page tables 46 * paging_init() sets up the page tables
79 */ 47 */