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/appldata/appldata_base.c34
-rw-r--r--arch/s390/appldata/appldata_mem.c2
-rw-r--r--arch/s390/defconfig63
-rw-r--r--arch/s390/include/asm/cpuid.h25
-rw-r--r--arch/s390/include/asm/cputime.h4
-rw-r--r--arch/s390/include/asm/kvm_host.h1
-rw-r--r--arch/s390/include/asm/lowcore.h12
-rw-r--r--arch/s390/include/asm/processor.h17
-rw-r--r--arch/s390/include/asm/ptrace.h2
-rw-r--r--arch/s390/include/asm/setup.h24
-rw-r--r--arch/s390/include/asm/thread_info.h3
-rw-r--r--arch/s390/include/asm/timer.h1
-rw-r--r--arch/s390/include/asm/timex.h5
-rw-r--r--arch/s390/include/asm/unistd.h4
-rw-r--r--arch/s390/kernel/asm-offsets.c2
-rw-r--r--arch/s390/kernel/compat_linux.c18
-rw-r--r--arch/s390/kernel/compat_wrapper.S18
-rw-r--r--arch/s390/kernel/early.c19
-rw-r--r--arch/s390/kernel/entry.S13
-rw-r--r--arch/s390/kernel/entry64.S13
-rw-r--r--arch/s390/kernel/head.S15
-rw-r--r--arch/s390/kernel/ipl.c1
-rw-r--r--arch/s390/kernel/nmi.c5
-rw-r--r--arch/s390/kernel/setup.c12
-rw-r--r--arch/s390/kernel/smp.c4
-rw-r--r--arch/s390/kernel/syscalls.S2
-rw-r--r--arch/s390/kernel/time.c79
-rw-r--r--arch/s390/kernel/vtime.c83
29 files changed, 336 insertions, 146 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index dcb667c4375a..2eca5fe0e75b 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -82,6 +82,7 @@ config S390
82 select USE_GENERIC_SMP_HELPERS if SMP 82 select USE_GENERIC_SMP_HELPERS if SMP
83 select HAVE_SYSCALL_WRAPPERS 83 select HAVE_SYSCALL_WRAPPERS
84 select HAVE_FUNCTION_TRACER 84 select HAVE_FUNCTION_TRACER
85 select HAVE_DEFAULT_NO_SPIN_MUTEXES
85 select HAVE_OPROFILE 86 select HAVE_OPROFILE
86 select HAVE_KPROBES 87 select HAVE_KPROBES
87 select HAVE_KRETPROBES 88 select HAVE_KRETPROBES
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 27b70d8a359c..1dfc7100c7ee 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -98,7 +98,7 @@ static DECLARE_WORK(appldata_work, appldata_work_fn);
98/* 98/*
99 * Ops list 99 * Ops list
100 */ 100 */
101static DEFINE_SPINLOCK(appldata_ops_lock); 101static DEFINE_MUTEX(appldata_ops_mutex);
102static LIST_HEAD(appldata_ops_list); 102static LIST_HEAD(appldata_ops_list);
103 103
104 104
@@ -129,14 +129,14 @@ static void appldata_work_fn(struct work_struct *work)
129 129
130 i = 0; 130 i = 0;
131 get_online_cpus(); 131 get_online_cpus();
132 spin_lock(&appldata_ops_lock); 132 mutex_lock(&appldata_ops_mutex);
133 list_for_each(lh, &appldata_ops_list) { 133 list_for_each(lh, &appldata_ops_list) {
134 ops = list_entry(lh, struct appldata_ops, list); 134 ops = list_entry(lh, struct appldata_ops, list);
135 if (ops->active == 1) { 135 if (ops->active == 1) {
136 ops->callback(ops->data); 136 ops->callback(ops->data);
137 } 137 }
138 } 138 }
139 spin_unlock(&appldata_ops_lock); 139 mutex_unlock(&appldata_ops_mutex);
140 put_online_cpus(); 140 put_online_cpus();
141} 141}
142 142
@@ -176,7 +176,7 @@ static void __appldata_mod_vtimer_wrap(void *p) {
176 struct vtimer_list *timer; 176 struct vtimer_list *timer;
177 u64 expires; 177 u64 expires;
178 } *args = p; 178 } *args = p;
179 mod_virt_timer(args->timer, args->expires); 179 mod_virt_timer_periodic(args->timer, args->expires);
180} 180}
181 181
182#define APPLDATA_ADD_TIMER 0 182#define APPLDATA_ADD_TIMER 0
@@ -338,7 +338,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
338 struct list_head *lh; 338 struct list_head *lh;
339 339
340 found = 0; 340 found = 0;
341 spin_lock(&appldata_ops_lock); 341 mutex_lock(&appldata_ops_mutex);
342 list_for_each(lh, &appldata_ops_list) { 342 list_for_each(lh, &appldata_ops_list) {
343 tmp_ops = list_entry(lh, struct appldata_ops, list); 343 tmp_ops = list_entry(lh, struct appldata_ops, list);
344 if (&tmp_ops->ctl_table[2] == ctl) { 344 if (&tmp_ops->ctl_table[2] == ctl) {
@@ -346,15 +346,15 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
346 } 346 }
347 } 347 }
348 if (!found) { 348 if (!found) {
349 spin_unlock(&appldata_ops_lock); 349 mutex_unlock(&appldata_ops_mutex);
350 return -ENODEV; 350 return -ENODEV;
351 } 351 }
352 ops = ctl->data; 352 ops = ctl->data;
353 if (!try_module_get(ops->owner)) { // protect this function 353 if (!try_module_get(ops->owner)) { // protect this function
354 spin_unlock(&appldata_ops_lock); 354 mutex_unlock(&appldata_ops_mutex);
355 return -ENODEV; 355 return -ENODEV;
356 } 356 }
357 spin_unlock(&appldata_ops_lock); 357 mutex_unlock(&appldata_ops_mutex);
358 358
359 if (!*lenp || *ppos) { 359 if (!*lenp || *ppos) {
360 *lenp = 0; 360 *lenp = 0;
@@ -378,11 +378,11 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
378 return -EFAULT; 378 return -EFAULT;
379 } 379 }
380 380
381 spin_lock(&appldata_ops_lock); 381 mutex_lock(&appldata_ops_mutex);
382 if ((buf[0] == '1') && (ops->active == 0)) { 382 if ((buf[0] == '1') && (ops->active == 0)) {
383 // protect work queue callback 383 // protect work queue callback
384 if (!try_module_get(ops->owner)) { 384 if (!try_module_get(ops->owner)) {
385 spin_unlock(&appldata_ops_lock); 385 mutex_unlock(&appldata_ops_mutex);
386 module_put(ops->owner); 386 module_put(ops->owner);
387 return -ENODEV; 387 return -ENODEV;
388 } 388 }
@@ -407,7 +407,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
407 "failed with rc=%d\n", ops->name, rc); 407 "failed with rc=%d\n", ops->name, rc);
408 module_put(ops->owner); 408 module_put(ops->owner);
409 } 409 }
410 spin_unlock(&appldata_ops_lock); 410 mutex_unlock(&appldata_ops_mutex);
411out: 411out:
412 *lenp = len; 412 *lenp = len;
413 *ppos += len; 413 *ppos += len;
@@ -433,9 +433,9 @@ int appldata_register_ops(struct appldata_ops *ops)
433 if (!ops->ctl_table) 433 if (!ops->ctl_table)
434 return -ENOMEM; 434 return -ENOMEM;
435 435
436 spin_lock(&appldata_ops_lock); 436 mutex_lock(&appldata_ops_mutex);
437 list_add(&ops->list, &appldata_ops_list); 437 list_add(&ops->list, &appldata_ops_list);
438 spin_unlock(&appldata_ops_lock); 438 mutex_unlock(&appldata_ops_mutex);
439 439
440 ops->ctl_table[0].procname = appldata_proc_name; 440 ops->ctl_table[0].procname = appldata_proc_name;
441 ops->ctl_table[0].maxlen = 0; 441 ops->ctl_table[0].maxlen = 0;
@@ -452,9 +452,9 @@ int appldata_register_ops(struct appldata_ops *ops)
452 goto out; 452 goto out;
453 return 0; 453 return 0;
454out: 454out:
455 spin_lock(&appldata_ops_lock); 455 mutex_lock(&appldata_ops_mutex);
456 list_del(&ops->list); 456 list_del(&ops->list);
457 spin_unlock(&appldata_ops_lock); 457 mutex_unlock(&appldata_ops_mutex);
458 kfree(ops->ctl_table); 458 kfree(ops->ctl_table);
459 return -ENOMEM; 459 return -ENOMEM;
460} 460}
@@ -466,9 +466,9 @@ out:
466 */ 466 */
467void appldata_unregister_ops(struct appldata_ops *ops) 467void appldata_unregister_ops(struct appldata_ops *ops)
468{ 468{
469 spin_lock(&appldata_ops_lock); 469 mutex_lock(&appldata_ops_mutex);
470 list_del(&ops->list); 470 list_del(&ops->list);
471 spin_unlock(&appldata_ops_lock); 471 mutex_unlock(&appldata_ops_mutex);
472 unregister_sysctl_table(ops->sysctl_header); 472 unregister_sysctl_table(ops->sysctl_header);
473 kfree(ops->ctl_table); 473 kfree(ops->ctl_table);
474} 474}
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index 3ed56b7d1b2f..4188cbe63a54 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -78,7 +78,7 @@ static void appldata_get_mem_data(void *data)
78{ 78{
79 /* 79 /*
80 * don't put large structures on the stack, we are 80 * don't put large structures on the stack, we are
81 * serialized through the appldata_ops_lock and can use static 81 * serialized through the appldata_ops_mutex and can use static
82 */ 82 */
83 static struct sysinfo val; 83 static struct sysinfo val;
84 unsigned long ev[NR_VM_EVENT_ITEMS]; 84 unsigned long ev[NR_VM_EVENT_ITEMS];
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 31e809c77790..d401d56c255f 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc4 3# Linux kernel version: 2.6.30-rc3
4# Wed Feb 11 10:07:16 2009 4# Thu Apr 23 09:29:52 2009
5# 5#
6CONFIG_SCHED_MC=y 6CONFIG_SCHED_MC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -22,6 +22,7 @@ CONFIG_NO_DMA=y
22CONFIG_GENERIC_LOCKBREAK=y 22CONFIG_GENERIC_LOCKBREAK=y
23CONFIG_PGSTE=y 23CONFIG_PGSTE=y
24CONFIG_VIRT_CPU_ACCOUNTING=y 24CONFIG_VIRT_CPU_ACCOUNTING=y
25CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
25CONFIG_S390=y 26CONFIG_S390=y
26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27 28
@@ -37,6 +38,7 @@ CONFIG_SWAP=y
37CONFIG_SYSVIPC=y 38CONFIG_SYSVIPC=y
38CONFIG_SYSVIPC_SYSCTL=y 39CONFIG_SYSVIPC_SYSCTL=y
39CONFIG_POSIX_MQUEUE=y 40CONFIG_POSIX_MQUEUE=y
41CONFIG_POSIX_MQUEUE_SYSCTL=y
40# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
41# CONFIG_TASKSTATS is not set 43# CONFIG_TASKSTATS is not set
42CONFIG_AUDIT=y 44CONFIG_AUDIT=y
@@ -77,21 +79,24 @@ CONFIG_IPC_NS=y
77# CONFIG_NET_NS is not set 79# CONFIG_NET_NS is not set
78CONFIG_BLK_DEV_INITRD=y 80CONFIG_BLK_DEV_INITRD=y
79CONFIG_INITRAMFS_SOURCE="" 81CONFIG_INITRAMFS_SOURCE=""
82CONFIG_RD_GZIP=y
83CONFIG_RD_BZIP2=y
84CONFIG_RD_LZMA=y
80# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 85# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
81CONFIG_SYSCTL=y 86CONFIG_SYSCTL=y
87CONFIG_ANON_INODES=y
82# CONFIG_EMBEDDED is not set 88# CONFIG_EMBEDDED is not set
83CONFIG_SYSCTL_SYSCALL=y 89CONFIG_SYSCTL_SYSCALL=y
84CONFIG_KALLSYMS=y 90CONFIG_KALLSYMS=y
85# CONFIG_KALLSYMS_ALL is not set 91# CONFIG_KALLSYMS_ALL is not set
86# CONFIG_KALLSYMS_EXTRA_PASS is not set 92# CONFIG_KALLSYMS_EXTRA_PASS is not set
93# CONFIG_STRIP_ASM_SYMS is not set
87CONFIG_HOTPLUG=y 94CONFIG_HOTPLUG=y
88CONFIG_PRINTK=y 95CONFIG_PRINTK=y
89CONFIG_BUG=y 96CONFIG_BUG=y
90CONFIG_ELF_CORE=y 97CONFIG_ELF_CORE=y
91# CONFIG_COMPAT_BRK is not set
92CONFIG_BASE_FULL=y 98CONFIG_BASE_FULL=y
93CONFIG_FUTEX=y 99CONFIG_FUTEX=y
94CONFIG_ANON_INODES=y
95CONFIG_EPOLL=y 100CONFIG_EPOLL=y
96CONFIG_SIGNALFD=y 101CONFIG_SIGNALFD=y
97CONFIG_TIMERFD=y 102CONFIG_TIMERFD=y
@@ -99,10 +104,12 @@ CONFIG_EVENTFD=y
99CONFIG_SHMEM=y 104CONFIG_SHMEM=y
100CONFIG_AIO=y 105CONFIG_AIO=y
101CONFIG_VM_EVENT_COUNTERS=y 106CONFIG_VM_EVENT_COUNTERS=y
107# CONFIG_COMPAT_BRK is not set
102CONFIG_SLAB=y 108CONFIG_SLAB=y
103# CONFIG_SLUB is not set 109# CONFIG_SLUB is not set
104# CONFIG_SLOB is not set 110# CONFIG_SLOB is not set
105# CONFIG_PROFILING is not set 111# CONFIG_PROFILING is not set
112# CONFIG_MARKERS is not set
106CONFIG_HAVE_OPROFILE=y 113CONFIG_HAVE_OPROFILE=y
107CONFIG_KPROBES=y 114CONFIG_KPROBES=y
108CONFIG_HAVE_SYSCALL_WRAPPERS=y 115CONFIG_HAVE_SYSCALL_WRAPPERS=y
@@ -111,6 +118,8 @@ CONFIG_HAVE_KPROBES=y
111CONFIG_HAVE_KRETPROBES=y 118CONFIG_HAVE_KRETPROBES=y
112CONFIG_HAVE_ARCH_TRACEHOOK=y 119CONFIG_HAVE_ARCH_TRACEHOOK=y
113CONFIG_USE_GENERIC_SMP_HELPERS=y 120CONFIG_USE_GENERIC_SMP_HELPERS=y
121CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES=y
122# CONFIG_SLOW_WORK is not set
114# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 123# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
115CONFIG_SLABINFO=y 124CONFIG_SLABINFO=y
116CONFIG_RT_MUTEXES=y 125CONFIG_RT_MUTEXES=y
@@ -124,7 +133,6 @@ CONFIG_MODVERSIONS=y
124CONFIG_INIT_ALL_POSSIBLE=y 133CONFIG_INIT_ALL_POSSIBLE=y
125CONFIG_STOP_MACHINE=y 134CONFIG_STOP_MACHINE=y
126CONFIG_BLOCK=y 135CONFIG_BLOCK=y
127# CONFIG_BLK_DEV_IO_TRACE is not set
128CONFIG_BLK_DEV_BSG=y 136CONFIG_BLK_DEV_BSG=y
129# CONFIG_BLK_DEV_INTEGRITY is not set 137# CONFIG_BLK_DEV_INTEGRITY is not set
130CONFIG_BLOCK_COMPAT=y 138CONFIG_BLOCK_COMPAT=y
@@ -211,11 +219,12 @@ CONFIG_ZONE_DMA_FLAG=1
211CONFIG_BOUNCE=y 219CONFIG_BOUNCE=y
212CONFIG_VIRT_TO_BUS=y 220CONFIG_VIRT_TO_BUS=y
213CONFIG_UNEVICTABLE_LRU=y 221CONFIG_UNEVICTABLE_LRU=y
222CONFIG_HAVE_MLOCK=y
223CONFIG_HAVE_MLOCKED_PAGE_BIT=y
214 224
215# 225#
216# I/O subsystem configuration 226# I/O subsystem configuration
217# 227#
218CONFIG_MACHCHK_WARNING=y
219CONFIG_QDIO=y 228CONFIG_QDIO=y
220CONFIG_CHSC_SCH=m 229CONFIG_CHSC_SCH=m
221 230
@@ -247,12 +256,12 @@ CONFIG_S390_HYPFS_FS=y
247CONFIG_KEXEC=y 256CONFIG_KEXEC=y
248# CONFIG_ZFCPDUMP is not set 257# CONFIG_ZFCPDUMP is not set
249CONFIG_S390_GUEST=y 258CONFIG_S390_GUEST=y
259CONFIG_SECCOMP=y
250CONFIG_NET=y 260CONFIG_NET=y
251 261
252# 262#
253# Networking options 263# Networking options
254# 264#
255CONFIG_COMPAT_NET_DEV_OPS=y
256CONFIG_PACKET=y 265CONFIG_PACKET=y
257# CONFIG_PACKET_MMAP is not set 266# CONFIG_PACKET_MMAP is not set
258CONFIG_UNIX=y 267CONFIG_UNIX=y
@@ -374,6 +383,7 @@ CONFIG_SCTP_HMAC_MD5=y
374# CONFIG_LAPB is not set 383# CONFIG_LAPB is not set
375# CONFIG_ECONET is not set 384# CONFIG_ECONET is not set
376# CONFIG_WAN_ROUTER is not set 385# CONFIG_WAN_ROUTER is not set
386# CONFIG_PHONET is not set
377CONFIG_NET_SCHED=y 387CONFIG_NET_SCHED=y
378 388
379# 389#
@@ -438,7 +448,6 @@ CONFIG_CAN_BCM=m
438CONFIG_CAN_VCAN=m 448CONFIG_CAN_VCAN=m
439# CONFIG_CAN_DEBUG_DEVICES is not set 449# CONFIG_CAN_DEBUG_DEVICES is not set
440# CONFIG_AF_RXRPC is not set 450# CONFIG_AF_RXRPC is not set
441# CONFIG_PHONET is not set
442# CONFIG_WIMAX is not set 451# CONFIG_WIMAX is not set
443# CONFIG_RFKILL is not set 452# CONFIG_RFKILL is not set
444# CONFIG_NET_9P is not set 453# CONFIG_NET_9P is not set
@@ -537,6 +546,7 @@ CONFIG_SCSI_FC_ATTRS=y
537CONFIG_SCSI_LOWLEVEL=y 546CONFIG_SCSI_LOWLEVEL=y
538# CONFIG_ISCSI_TCP is not set 547# CONFIG_ISCSI_TCP is not set
539# CONFIG_LIBFC is not set 548# CONFIG_LIBFC is not set
549# CONFIG_LIBFCOE is not set
540# CONFIG_SCSI_DEBUG is not set 550# CONFIG_SCSI_DEBUG is not set
541CONFIG_ZFCP=y 551CONFIG_ZFCP=y
542CONFIG_SCSI_DH=m 552CONFIG_SCSI_DH=m
@@ -544,6 +554,10 @@ CONFIG_SCSI_DH_RDAC=m
544CONFIG_SCSI_DH_HP_SW=m 554CONFIG_SCSI_DH_HP_SW=m
545CONFIG_SCSI_DH_EMC=m 555CONFIG_SCSI_DH_EMC=m
546CONFIG_SCSI_DH_ALUA=m 556CONFIG_SCSI_DH_ALUA=m
557CONFIG_SCSI_OSD_INITIATOR=m
558CONFIG_SCSI_OSD_ULD=m
559CONFIG_SCSI_OSD_DPRINT_SENSE=1
560# CONFIG_SCSI_OSD_DEBUG is not set
547CONFIG_MD=y 561CONFIG_MD=y
548CONFIG_BLK_DEV_MD=y 562CONFIG_BLK_DEV_MD=y
549CONFIG_MD_AUTODETECT=y 563CONFIG_MD_AUTODETECT=y
@@ -564,6 +578,7 @@ CONFIG_DM_MULTIPATH=m
564# CONFIG_DM_DELAY is not set 578# CONFIG_DM_DELAY is not set
565# CONFIG_DM_UEVENT is not set 579# CONFIG_DM_UEVENT is not set
566CONFIG_NETDEVICES=y 580CONFIG_NETDEVICES=y
581CONFIG_COMPAT_NET_DEV_OPS=y
567# CONFIG_IFB is not set 582# CONFIG_IFB is not set
568CONFIG_DUMMY=m 583CONFIG_DUMMY=m
569CONFIG_BONDING=m 584CONFIG_BONDING=m
@@ -667,6 +682,7 @@ CONFIG_S390_VMUR=m
667# CONFIG_MEMSTICK is not set 682# CONFIG_MEMSTICK is not set
668# CONFIG_NEW_LEDS is not set 683# CONFIG_NEW_LEDS is not set
669CONFIG_ACCESSIBILITY=y 684CONFIG_ACCESSIBILITY=y
685# CONFIG_AUXDISPLAY is not set
670# CONFIG_STAGING is not set 686# CONFIG_STAGING is not set
671 687
672# 688#
@@ -676,6 +692,7 @@ CONFIG_EXT2_FS=y
676# CONFIG_EXT2_FS_XATTR is not set 692# CONFIG_EXT2_FS_XATTR is not set
677# CONFIG_EXT2_FS_XIP is not set 693# CONFIG_EXT2_FS_XIP is not set
678CONFIG_EXT3_FS=y 694CONFIG_EXT3_FS=y
695# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
679CONFIG_EXT3_FS_XATTR=y 696CONFIG_EXT3_FS_XATTR=y
680# CONFIG_EXT3_FS_POSIX_ACL is not set 697# CONFIG_EXT3_FS_POSIX_ACL is not set
681# CONFIG_EXT3_FS_SECURITY is not set 698# CONFIG_EXT3_FS_SECURITY is not set
@@ -701,6 +718,11 @@ CONFIG_INOTIFY_USER=y
701CONFIG_GENERIC_ACL=y 718CONFIG_GENERIC_ACL=y
702 719
703# 720#
721# Caches
722#
723# CONFIG_FSCACHE is not set
724
725#
704# CD-ROM/DVD Filesystems 726# CD-ROM/DVD Filesystems
705# 727#
706# CONFIG_ISO9660_FS is not set 728# CONFIG_ISO9660_FS is not set
@@ -744,6 +766,8 @@ CONFIG_MISC_FILESYSTEMS=y
744# CONFIG_ROMFS_FS is not set 766# CONFIG_ROMFS_FS is not set
745# CONFIG_SYSV_FS is not set 767# CONFIG_SYSV_FS is not set
746# CONFIG_UFS_FS is not set 768# CONFIG_UFS_FS is not set
769# CONFIG_EXOFS_FS is not set
770# CONFIG_NILFS2_FS is not set
747CONFIG_NETWORK_FILESYSTEMS=y 771CONFIG_NETWORK_FILESYSTEMS=y
748CONFIG_NFS_FS=y 772CONFIG_NFS_FS=y
749CONFIG_NFS_V3=y 773CONFIG_NFS_V3=y
@@ -758,7 +782,6 @@ CONFIG_LOCKD_V4=y
758CONFIG_EXPORTFS=y 782CONFIG_EXPORTFS=y
759CONFIG_NFS_COMMON=y 783CONFIG_NFS_COMMON=y
760CONFIG_SUNRPC=y 784CONFIG_SUNRPC=y
761# CONFIG_SUNRPC_REGISTER_V4 is not set
762# CONFIG_RPCSEC_GSS_KRB5 is not set 785# CONFIG_RPCSEC_GSS_KRB5 is not set
763# CONFIG_RPCSEC_GSS_SPKM3 is not set 786# CONFIG_RPCSEC_GSS_SPKM3 is not set
764# CONFIG_SMB_FS is not set 787# CONFIG_SMB_FS is not set
@@ -806,6 +829,7 @@ CONFIG_MAGIC_SYSRQ=y
806CONFIG_DEBUG_FS=y 829CONFIG_DEBUG_FS=y
807# CONFIG_HEADERS_CHECK is not set 830# CONFIG_HEADERS_CHECK is not set
808CONFIG_DEBUG_KERNEL=y 831CONFIG_DEBUG_KERNEL=y
832# CONFIG_DETECT_HUNG_TASK is not set
809# CONFIG_SCHED_DEBUG is not set 833# CONFIG_SCHED_DEBUG is not set
810# CONFIG_SCHEDSTATS is not set 834# CONFIG_SCHEDSTATS is not set
811# CONFIG_TIMER_STATS is not set 835# CONFIG_TIMER_STATS is not set
@@ -830,7 +854,6 @@ CONFIG_DEBUG_MEMORY_INIT=y
830# CONFIG_DEBUG_LIST is not set 854# CONFIG_DEBUG_LIST is not set
831# CONFIG_DEBUG_SG is not set 855# CONFIG_DEBUG_SG is not set
832# CONFIG_DEBUG_NOTIFIERS is not set 856# CONFIG_DEBUG_NOTIFIERS is not set
833# CONFIG_FRAME_POINTER is not set
834# CONFIG_RCU_TORTURE_TEST is not set 857# CONFIG_RCU_TORTURE_TEST is not set
835# CONFIG_RCU_CPU_STALL_DETECTOR is not set 858# CONFIG_RCU_CPU_STALL_DETECTOR is not set
836# CONFIG_KPROBES_SANITY_TEST is not set 859# CONFIG_KPROBES_SANITY_TEST is not set
@@ -840,7 +863,9 @@ CONFIG_DEBUG_MEMORY_INIT=y
840# CONFIG_FAULT_INJECTION is not set 863# CONFIG_FAULT_INJECTION is not set
841# CONFIG_LATENCYTOP is not set 864# CONFIG_LATENCYTOP is not set
842CONFIG_SYSCTL_SYSCALL_CHECK=y 865CONFIG_SYSCTL_SYSCALL_CHECK=y
866# CONFIG_DEBUG_PAGEALLOC is not set
843CONFIG_HAVE_FUNCTION_TRACER=y 867CONFIG_HAVE_FUNCTION_TRACER=y
868CONFIG_TRACING_SUPPORT=y
844 869
845# 870#
846# Tracers 871# Tracers
@@ -850,14 +875,17 @@ CONFIG_HAVE_FUNCTION_TRACER=y
850# CONFIG_PREEMPT_TRACER is not set 875# CONFIG_PREEMPT_TRACER is not set
851# CONFIG_SCHED_TRACER is not set 876# CONFIG_SCHED_TRACER is not set
852# CONFIG_CONTEXT_SWITCH_TRACER is not set 877# CONFIG_CONTEXT_SWITCH_TRACER is not set
878# CONFIG_EVENT_TRACER is not set
853# CONFIG_BOOT_TRACER is not set 879# CONFIG_BOOT_TRACER is not set
854# CONFIG_TRACE_BRANCH_PROFILING is not set 880# CONFIG_TRACE_BRANCH_PROFILING is not set
855# CONFIG_STACK_TRACER is not set 881# CONFIG_STACK_TRACER is not set
856# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 882# CONFIG_KMEMTRACE is not set
883# CONFIG_WORKQUEUE_TRACER is not set
884# CONFIG_BLK_DEV_IO_TRACE is not set
885# CONFIG_DYNAMIC_DEBUG is not set
857CONFIG_SAMPLES=y 886CONFIG_SAMPLES=y
858# CONFIG_SAMPLE_KOBJECT is not set 887# CONFIG_SAMPLE_KOBJECT is not set
859# CONFIG_SAMPLE_KPROBES is not set 888# CONFIG_SAMPLE_KPROBES is not set
860# CONFIG_DEBUG_PAGEALLOC is not set
861 889
862# 890#
863# Security options 891# Security options
@@ -882,10 +910,12 @@ CONFIG_CRYPTO_HASH=m
882CONFIG_CRYPTO_HASH2=y 910CONFIG_CRYPTO_HASH2=y
883CONFIG_CRYPTO_RNG=m 911CONFIG_CRYPTO_RNG=m
884CONFIG_CRYPTO_RNG2=y 912CONFIG_CRYPTO_RNG2=y
913CONFIG_CRYPTO_PCOMP=y
885CONFIG_CRYPTO_MANAGER=y 914CONFIG_CRYPTO_MANAGER=y
886CONFIG_CRYPTO_MANAGER2=y 915CONFIG_CRYPTO_MANAGER2=y
887CONFIG_CRYPTO_GF128MUL=m 916CONFIG_CRYPTO_GF128MUL=m
888# CONFIG_CRYPTO_NULL is not set 917# CONFIG_CRYPTO_NULL is not set
918CONFIG_CRYPTO_WORKQUEUE=y
889# CONFIG_CRYPTO_CRYPTD is not set 919# CONFIG_CRYPTO_CRYPTD is not set
890CONFIG_CRYPTO_AUTHENC=m 920CONFIG_CRYPTO_AUTHENC=m
891# CONFIG_CRYPTO_TEST is not set 921# CONFIG_CRYPTO_TEST is not set
@@ -954,6 +984,7 @@ CONFIG_CRYPTO_SEED=m
954# Compression 984# Compression
955# 985#
956# CONFIG_CRYPTO_DEFLATE is not set 986# CONFIG_CRYPTO_DEFLATE is not set
987CONFIG_CRYPTO_ZLIB=m
957CONFIG_CRYPTO_LZO=m 988CONFIG_CRYPTO_LZO=m
958 989
959# 990#
@@ -969,6 +1000,7 @@ CONFIG_CRYPTO_SHA512_S390=m
969# CONFIG_CRYPTO_DES_S390 is not set 1000# CONFIG_CRYPTO_DES_S390 is not set
970# CONFIG_CRYPTO_AES_S390 is not set 1001# CONFIG_CRYPTO_AES_S390 is not set
971CONFIG_S390_PRNG=m 1002CONFIG_S390_PRNG=m
1003# CONFIG_BINARY_PRINTF is not set
972 1004
973# 1005#
974# Library routines 1006# Library routines
@@ -982,9 +1014,14 @@ CONFIG_CRC_T10DIF=y
982CONFIG_CRC32=m 1014CONFIG_CRC32=m
983CONFIG_CRC7=m 1015CONFIG_CRC7=m
984CONFIG_LIBCRC32C=m 1016CONFIG_LIBCRC32C=m
1017CONFIG_ZLIB_INFLATE=y
1018CONFIG_ZLIB_DEFLATE=m
985CONFIG_LZO_COMPRESS=m 1019CONFIG_LZO_COMPRESS=m
986CONFIG_LZO_DECOMPRESS=m 1020CONFIG_LZO_DECOMPRESS=m
987CONFIG_PLIST=y 1021CONFIG_DECOMPRESS_GZIP=y
1022CONFIG_DECOMPRESS_BZIP2=y
1023CONFIG_DECOMPRESS_LZMA=y
1024CONFIG_NLATTR=y
988CONFIG_HAVE_KVM=y 1025CONFIG_HAVE_KVM=y
989CONFIG_VIRTUALIZATION=y 1026CONFIG_VIRTUALIZATION=y
990CONFIG_KVM=m 1027CONFIG_KVM=m
diff --git a/arch/s390/include/asm/cpuid.h b/arch/s390/include/asm/cpuid.h
new file mode 100644
index 000000000000..07836a2e5222
--- /dev/null
+++ b/arch/s390/include/asm/cpuid.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright IBM Corp. 2000,2009
3 * Author(s): Hartmut Penner <hp@de.ibm.com>,
4 * Martin Schwidefsky <schwidefsky@de.ibm.com>
5 * Christian Ehrhardt <ehrhardt@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_CPUID_H_
9#define _ASM_S390_CPUID_H_
10
11/*
12 * CPU type and hardware bug flags. Kept separately for each CPU.
13 * Members of this structure are referenced in head.S, so think twice
14 * before touching them. [mj]
15 */
16
17typedef struct
18{
19 unsigned int version : 8;
20 unsigned int ident : 24;
21 unsigned int machine : 16;
22 unsigned int unused : 16;
23} __attribute__ ((packed)) cpuid_t;
24
25#endif /* _ASM_S390_CPUID_H_ */
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 95b0f7db3c69..941384fbd39c 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -174,4 +174,8 @@ cputime64_to_clock_t(cputime64_t cputime)
174 return __div(cputime, 4096000000ULL / USER_HZ); 174 return __div(cputime, 4096000000ULL / USER_HZ);
175} 175}
176 176
177cputime64_t s390_get_idle_time(int cpu);
178
179#define arch_idle_time(cpu) s390_get_idle_time(cpu)
180
177#endif /* _S390_CPUTIME_H */ 181#endif /* _S390_CPUTIME_H */
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index c6e674f5fca9..54ea39f96ecd 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -15,6 +15,7 @@
15#define ASM_KVM_HOST_H 15#define ASM_KVM_HOST_H
16#include <linux/kvm_host.h> 16#include <linux/kvm_host.h>
17#include <asm/debug.h> 17#include <asm/debug.h>
18#include <asm/cpuid.h>
18 19
19#define KVM_MAX_VCPUS 64 20#define KVM_MAX_VCPUS 64
20#define KVM_MEMORY_SLOTS 32 21#define KVM_MEMORY_SLOTS 32
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index b349f1c7fdfa..3aeca492b147 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -66,6 +66,7 @@
66#define __LC_USER_EXEC_ASCE 0x02ac 66#define __LC_USER_EXEC_ASCE 0x02ac
67#define __LC_CPUID 0x02b0 67#define __LC_CPUID 0x02b0
68#define __LC_INT_CLOCK 0x02c8 68#define __LC_INT_CLOCK 0x02c8
69#define __LC_MACHINE_FLAGS 0x02d8
69#define __LC_IRB 0x0300 70#define __LC_IRB 0x0300
70#define __LC_PFAULT_INTPARM 0x0080 71#define __LC_PFAULT_INTPARM 0x0080
71#define __LC_CPU_TIMER_SAVE_AREA 0x00d8 72#define __LC_CPU_TIMER_SAVE_AREA 0x00d8
@@ -110,6 +111,7 @@
110#define __LC_CPUID 0x0320 111#define __LC_CPUID 0x0320
111#define __LC_INT_CLOCK 0x0340 112#define __LC_INT_CLOCK 0x0340
112#define __LC_VDSO_PER_CPU 0x0350 113#define __LC_VDSO_PER_CPU 0x0350
114#define __LC_MACHINE_FLAGS 0x0358
113#define __LC_IRB 0x0380 115#define __LC_IRB 0x0380
114#define __LC_PASTE 0x03c0 116#define __LC_PASTE 0x03c0
115#define __LC_PFAULT_INTPARM 0x11b8 117#define __LC_PFAULT_INTPARM 0x11b8
@@ -127,9 +129,9 @@
127 129
128#ifndef __ASSEMBLY__ 130#ifndef __ASSEMBLY__
129 131
130#include <asm/processor.h> 132#include <asm/cpuid.h>
133#include <asm/ptrace.h>
131#include <linux/types.h> 134#include <linux/types.h>
132#include <asm/sigp.h>
133 135
134void restart_int_handler(void); 136void restart_int_handler(void);
135void ext_int_handler(void); 137void ext_int_handler(void);
@@ -277,7 +279,8 @@ struct _lowcore
277 __u32 ext_call_fast; /* 0x02c4 */ 279 __u32 ext_call_fast; /* 0x02c4 */
278 __u64 int_clock; /* 0x02c8 */ 280 __u64 int_clock; /* 0x02c8 */
279 __u64 clock_comparator; /* 0x02d0 */ 281 __u64 clock_comparator; /* 0x02d0 */
280 __u8 pad_0x02d8[0x0300-0x02d8]; /* 0x02d8 */ 282 __u32 machine_flags; /* 0x02d8 */
283 __u8 pad_0x02dc[0x0300-0x02dc]; /* 0x02dc */
281 284
282 /* Interrupt response block */ 285 /* Interrupt response block */
283 __u8 irb[64]; /* 0x0300 */ 286 __u8 irb[64]; /* 0x0300 */
@@ -381,7 +384,8 @@ struct _lowcore
381 __u64 int_clock; /* 0x0340 */ 384 __u64 int_clock; /* 0x0340 */
382 __u64 clock_comparator; /* 0x0348 */ 385 __u64 clock_comparator; /* 0x0348 */
383 __u64 vdso_per_cpu_data; /* 0x0350 */ 386 __u64 vdso_per_cpu_data; /* 0x0350 */
384 __u8 pad_0x0358[0x0380-0x0358]; /* 0x0358 */ 387 __u64 machine_flags; /* 0x0358 */
388 __u8 pad_0x0360[0x0380-0x0360]; /* 0x0360 */
385 389
386 /* Interrupt response block. */ 390 /* Interrupt response block. */
387 __u8 irb[64]; /* 0x0380 */ 391 __u8 irb[64]; /* 0x0380 */
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 61862b3ac794..c139fa7b8e89 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -14,7 +14,10 @@
14#define __ASM_S390_PROCESSOR_H 14#define __ASM_S390_PROCESSOR_H
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <asm/cpuid.h>
18#include <asm/page.h>
17#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/setup.h>
18 21
19#ifdef __KERNEL__ 22#ifdef __KERNEL__
20/* 23/*
@@ -23,20 +26,6 @@
23 */ 26 */
24#define current_text_addr() ({ void *pc; asm("basr %0,0" : "=a" (pc)); pc; }) 27#define current_text_addr() ({ void *pc; asm("basr %0,0" : "=a" (pc)); pc; })
25 28
26/*
27 * CPU type and hardware bug flags. Kept separately for each CPU.
28 * Members of this structure are referenced in head.S, so think twice
29 * before touching them. [mj]
30 */
31
32typedef struct
33{
34 unsigned int version : 8;
35 unsigned int ident : 24;
36 unsigned int machine : 16;
37 unsigned int unused : 16;
38} __attribute__ ((packed)) cpuid_t;
39
40static inline void get_cpu_id(cpuid_t *ptr) 29static inline void get_cpu_id(cpuid_t *ptr)
41{ 30{
42 asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); 31 asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr));
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index f1b051630c50..539263fc9ab9 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -313,8 +313,6 @@ typedef struct
313 313
314 314
315#ifdef __KERNEL__ 315#ifdef __KERNEL__
316#include <asm/setup.h>
317#include <asm/page.h>
318 316
319/* 317/*
320 * The pt_regs struct defines the way the registers are stored on 318 * The pt_regs struct defines the way the registers are stored on
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index e8bd6ac22c99..38b0fc221ed7 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -14,6 +14,7 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <asm/lowcore.h>
17#include <asm/types.h> 18#include <asm/types.h>
18 19
19#define PARMAREA 0x10400 20#define PARMAREA 0x10400
@@ -63,7 +64,6 @@ extern unsigned int s390_noexec;
63/* 64/*
64 * Machine features detected in head.S 65 * Machine features detected in head.S
65 */ 66 */
66extern unsigned long machine_flags;
67 67
68#define MACHINE_FLAG_VM (1UL << 0) 68#define MACHINE_FLAG_VM (1UL << 0)
69#define MACHINE_FLAG_IEEE (1UL << 1) 69#define MACHINE_FLAG_IEEE (1UL << 1)
@@ -77,28 +77,28 @@ extern unsigned long machine_flags;
77#define MACHINE_FLAG_HPAGE (1UL << 10) 77#define MACHINE_FLAG_HPAGE (1UL << 10)
78#define MACHINE_FLAG_PFMF (1UL << 11) 78#define MACHINE_FLAG_PFMF (1UL << 11)
79 79
80#define MACHINE_IS_VM (machine_flags & MACHINE_FLAG_VM) 80#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
81#define MACHINE_IS_KVM (machine_flags & MACHINE_FLAG_KVM) 81#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
82#define MACHINE_HAS_DIAG9C (machine_flags & MACHINE_FLAG_DIAG9C) 82#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
83 83
84#ifndef __s390x__ 84#ifndef __s390x__
85#define MACHINE_HAS_IEEE (machine_flags & MACHINE_FLAG_IEEE) 85#define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
86#define MACHINE_HAS_CSP (machine_flags & MACHINE_FLAG_CSP) 86#define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
87#define MACHINE_HAS_IDTE (0) 87#define MACHINE_HAS_IDTE (0)
88#define MACHINE_HAS_DIAG44 (1) 88#define MACHINE_HAS_DIAG44 (1)
89#define MACHINE_HAS_MVPG (machine_flags & MACHINE_FLAG_MVPG) 89#define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
90#define MACHINE_HAS_MVCOS (0) 90#define MACHINE_HAS_MVCOS (0)
91#define MACHINE_HAS_HPAGE (0) 91#define MACHINE_HAS_HPAGE (0)
92#define MACHINE_HAS_PFMF (0) 92#define MACHINE_HAS_PFMF (0)
93#else /* __s390x__ */ 93#else /* __s390x__ */
94#define MACHINE_HAS_IEEE (1) 94#define MACHINE_HAS_IEEE (1)
95#define MACHINE_HAS_CSP (1) 95#define MACHINE_HAS_CSP (1)
96#define MACHINE_HAS_IDTE (machine_flags & MACHINE_FLAG_IDTE) 96#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
97#define MACHINE_HAS_DIAG44 (machine_flags & MACHINE_FLAG_DIAG44) 97#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
98#define MACHINE_HAS_MVPG (1) 98#define MACHINE_HAS_MVPG (1)
99#define MACHINE_HAS_MVCOS (machine_flags & MACHINE_FLAG_MVCOS) 99#define MACHINE_HAS_MVCOS (S390_lowcore.machine_flags & MACHINE_FLAG_MVCOS)
100#define MACHINE_HAS_HPAGE (machine_flags & MACHINE_FLAG_HPAGE) 100#define MACHINE_HAS_HPAGE (S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE)
101#define MACHINE_HAS_PFMF (machine_flags & MACHINE_FLAG_PFMF) 101#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
102#endif /* __s390x__ */ 102#endif /* __s390x__ */
103 103
104#define ZFCPDUMP_HSA_SIZE (32UL<<20) 104#define ZFCPDUMP_HSA_SIZE (32UL<<20)
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index c544aa524535..461f2abd2e6f 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -31,8 +31,9 @@
31#define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER) 31#define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER)
32 32
33#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
34#include <asm/processor.h>
35#include <asm/lowcore.h> 34#include <asm/lowcore.h>
35#include <asm/page.h>
36#include <asm/processor.h>
36 37
37/* 38/*
38 * low level task data that entry.S needs immediate access to 39 * low level task data that entry.S needs immediate access to
diff --git a/arch/s390/include/asm/timer.h b/arch/s390/include/asm/timer.h
index e4bcab739c19..814243cafdfe 100644
--- a/arch/s390/include/asm/timer.h
+++ b/arch/s390/include/asm/timer.h
@@ -41,6 +41,7 @@ extern void init_virt_timer(struct vtimer_list *timer);
41extern void add_virt_timer(void *new); 41extern void add_virt_timer(void *new);
42extern void add_virt_timer_periodic(void *new); 42extern void add_virt_timer_periodic(void *new);
43extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires); 43extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires);
44extern int mod_virt_timer_periodic(struct vtimer_list *timer, __u64 expires);
44extern int del_virt_timer(struct vtimer_list *timer); 45extern int del_virt_timer(struct vtimer_list *timer);
45 46
46extern void init_cpu_vtimer(void); 47extern void init_cpu_vtimer(void);
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index d744c3d62de5..cc21e3e20fd7 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -11,6 +11,9 @@
11#ifndef _ASM_S390_TIMEX_H 11#ifndef _ASM_S390_TIMEX_H
12#define _ASM_S390_TIMEX_H 12#define _ASM_S390_TIMEX_H
13 13
14/* The value of the TOD clock for 1.1.1970. */
15#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
16
14/* Inline functions for clock register access. */ 17/* Inline functions for clock register access. */
15static inline int set_clock(__u64 time) 18static inline int set_clock(__u64 time)
16{ 19{
@@ -85,4 +88,6 @@ int get_sync_clock(unsigned long long *clock);
85void init_cpu_timer(void); 88void init_cpu_timer(void);
86unsigned long long monotonic_clock(void); 89unsigned long long monotonic_clock(void);
87 90
91extern u64 sched_clock_base_cc;
92
88#endif 93#endif
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
index c8ad350d1444..f0f19e6ace6c 100644
--- a/arch/s390/include/asm/unistd.h
+++ b/arch/s390/include/asm/unistd.h
@@ -265,7 +265,9 @@
265#define __NR_pipe2 325 265#define __NR_pipe2 325
266#define __NR_dup3 326 266#define __NR_dup3 326
267#define __NR_epoll_create1 327 267#define __NR_epoll_create1 327
268#define NR_syscalls 328 268#define __NR_preadv 328
269#define __NR_pwritev 329
270#define NR_syscalls 330
269 271
270/* 272/*
271 * There are some system calls that are not present on 64 bit, some 273 * There are some system calls that are not present on 64 bit, some
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index 67a60016babb..fa9905ce7d0b 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -27,6 +27,8 @@ int main(void)
27 DEFINE(__TI_flags, offsetof(struct thread_info, flags)); 27 DEFINE(__TI_flags, offsetof(struct thread_info, flags));
28 DEFINE(__TI_cpu, offsetof(struct thread_info, cpu)); 28 DEFINE(__TI_cpu, offsetof(struct thread_info, cpu));
29 DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count)); 29 DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count));
30 DEFINE(__TI_user_timer, offsetof(struct thread_info, user_timer));
31 DEFINE(__TI_system_timer, offsetof(struct thread_info, system_timer));
30 BLANK(); 32 BLANK();
31 DEFINE(__PT_ARGS, offsetof(struct pt_regs, args)); 33 DEFINE(__PT_ARGS, offsetof(struct pt_regs, args));
32 DEFINE(__PT_PSW, offsetof(struct pt_regs, psw)); 34 DEFINE(__PT_PSW, offsetof(struct pt_regs, psw));
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 6cc87d8c8682..002c70d3cb75 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -702,20 +702,12 @@ asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename,
702 struct stat64_emu31 __user* statbuf, int flag) 702 struct stat64_emu31 __user* statbuf, int flag)
703{ 703{
704 struct kstat stat; 704 struct kstat stat;
705 int error = -EINVAL; 705 int error;
706
707 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
708 goto out;
709
710 if (flag & AT_SYMLINK_NOFOLLOW)
711 error = vfs_lstat_fd(dfd, filename, &stat);
712 else
713 error = vfs_stat_fd(dfd, filename, &stat);
714 706
715 if (!error) 707 error = vfs_fstatat(dfd, filename, &stat, flag);
716 error = cp_stat64(statbuf, &stat); 708 if (error)
717out: 709 return error;
718 return error; 710 return cp_stat64(statbuf, &stat);
719} 711}
720 712
721/* 713/*
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 87cf5a79a351..fb38af6316bb 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1805,3 +1805,21 @@ compat_sys_keyctl_wrapper:
1805 llgfr %r5,%r5 # u32 1805 llgfr %r5,%r5 # u32
1806 llgfr %r6,%r6 # u32 1806 llgfr %r6,%r6 # u32
1807 jg compat_sys_keyctl # branch to system call 1807 jg compat_sys_keyctl # branch to system call
1808
1809 .globl compat_sys_preadv_wrapper
1810compat_sys_preadv_wrapper:
1811 llgfr %r2,%r2 # unsigned long
1812 llgtr %r3,%r3 # compat_iovec *
1813 llgfr %r4,%r4 # unsigned long
1814 llgfr %r5,%r5 # u32
1815 llgfr %r6,%r6 # u32
1816 jg compat_sys_preadv # branch to system call
1817
1818 .globl compat_sys_pwritev_wrapper
1819compat_sys_pwritev_wrapper:
1820 llgfr %r2,%r2 # unsigned long
1821 llgtr %r3,%r3 # compat_iovec *
1822 llgfr %r4,%r4 # unsigned long
1823 llgfr %r5,%r5 # u32
1824 llgfr %r6,%r6 # u32
1825 jg compat_sys_pwritev # branch to system call
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 4d221c81c849..cf09948faad6 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -34,8 +34,25 @@
34 34
35char kernel_nss_name[NSS_NAME_SIZE + 1]; 35char kernel_nss_name[NSS_NAME_SIZE + 1];
36 36
37static unsigned long machine_flags;
38
37static void __init setup_boot_command_line(void); 39static void __init setup_boot_command_line(void);
38 40
41/*
42 * Get the TOD clock running.
43 */
44static void __init reset_tod_clock(void)
45{
46 u64 time;
47
48 if (store_clock(&time) == 0)
49 return;
50 /* TOD clock not running. Set the clock to Unix Epoch. */
51 if (set_clock(TOD_UNIX_EPOCH) != 0 || store_clock(&time) != 0)
52 disabled_wait(0);
53
54 sched_clock_base_cc = TOD_UNIX_EPOCH;
55}
39 56
40#ifdef CONFIG_SHARED_KERNEL 57#ifdef CONFIG_SHARED_KERNEL
41int __init savesys_ipl_nss(char *cmd, const int cmdlen); 58int __init savesys_ipl_nss(char *cmd, const int cmdlen);
@@ -370,6 +387,7 @@ static void __init setup_boot_command_line(void)
370 */ 387 */
371void __init startup_init(void) 388void __init startup_init(void)
372{ 389{
390 reset_tod_clock();
373 ipl_save_parameters(); 391 ipl_save_parameters();
374 rescue_initrd(); 392 rescue_initrd();
375 clear_bss_section(); 393 clear_bss_section();
@@ -391,5 +409,6 @@ void __init startup_init(void)
391 setup_hpage(); 409 setup_hpage();
392 sclp_facilities_detect(); 410 sclp_facilities_detect();
393 detect_memory_layout(memory_chunk); 411 detect_memory_layout(memory_chunk);
412 S390_lowcore.machine_flags = machine_flags;
394 lockdep_on(); 413 lockdep_on();
395} 414}
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 1268aa2991bf..f3e275934213 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -837,16 +837,29 @@ mcck_return:
837 __CPUINIT 837 __CPUINIT
838 .globl restart_int_handler 838 .globl restart_int_handler
839restart_int_handler: 839restart_int_handler:
840 basr %r1,0
841restart_base:
842 spt restart_vtime-restart_base(%r1)
843 stck __LC_LAST_UPDATE_CLOCK
844 mvc __LC_LAST_UPDATE_TIMER(8),restart_vtime-restart_base(%r1)
845 mvc __LC_EXIT_TIMER(8),restart_vtime-restart_base(%r1)
840 l %r15,__LC_SAVE_AREA+60 # load ksp 846 l %r15,__LC_SAVE_AREA+60 # load ksp
841 lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs 847 lctl %c0,%c15,__LC_CREGS_SAVE_AREA # get new ctl regs
842 lam %a0,%a15,__LC_AREGS_SAVE_AREA 848 lam %a0,%a15,__LC_AREGS_SAVE_AREA
843 lm %r6,%r15,__SF_GPRS(%r15) # load registers from clone 849 lm %r6,%r15,__SF_GPRS(%r15) # load registers from clone
850 l %r1,__LC_THREAD_INFO
851 mvc __LC_USER_TIMER(8),__TI_user_timer(%r1)
852 mvc __LC_SYSTEM_TIMER(8),__TI_system_timer(%r1)
853 xc __LC_STEAL_TIMER(8),__LC_STEAL_TIMER
844 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on 854 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
845 basr %r14,0 855 basr %r14,0
846 l %r14,restart_addr-.(%r14) 856 l %r14,restart_addr-.(%r14)
847 br %r14 # branch to start_secondary 857 br %r14 # branch to start_secondary
848restart_addr: 858restart_addr:
849 .long start_secondary 859 .long start_secondary
860 .align 8
861restart_vtime:
862 .long 0x7fffffff,0xffffffff
850 .previous 863 .previous
851#else 864#else
852/* 865/*
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index c6fbde13971a..84a105838e03 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -831,14 +831,27 @@ mcck_return:
831 __CPUINIT 831 __CPUINIT
832 .globl restart_int_handler 832 .globl restart_int_handler
833restart_int_handler: 833restart_int_handler:
834 basr %r1,0
835restart_base:
836 spt restart_vtime-restart_base(%r1)
837 stck __LC_LAST_UPDATE_CLOCK
838 mvc __LC_LAST_UPDATE_TIMER(8),restart_vtime-restart_base(%r1)
839 mvc __LC_EXIT_TIMER(8),restart_vtime-restart_base(%r1)
834 lg %r15,__LC_SAVE_AREA+120 # load ksp 840 lg %r15,__LC_SAVE_AREA+120 # load ksp
835 lghi %r10,__LC_CREGS_SAVE_AREA 841 lghi %r10,__LC_CREGS_SAVE_AREA
836 lctlg %c0,%c15,0(%r10) # get new ctl regs 842 lctlg %c0,%c15,0(%r10) # get new ctl regs
837 lghi %r10,__LC_AREGS_SAVE_AREA 843 lghi %r10,__LC_AREGS_SAVE_AREA
838 lam %a0,%a15,0(%r10) 844 lam %a0,%a15,0(%r10)
839 lmg %r6,%r15,__SF_GPRS(%r15) # load registers from clone 845 lmg %r6,%r15,__SF_GPRS(%r15) # load registers from clone
846 lg %r1,__LC_THREAD_INFO
847 mvc __LC_USER_TIMER(8),__TI_user_timer(%r1)
848 mvc __LC_SYSTEM_TIMER(8),__TI_system_timer(%r1)
849 xc __LC_STEAL_TIMER(8),__LC_STEAL_TIMER
840 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on 850 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
841 jg start_secondary 851 jg start_secondary
852 .align 8
853restart_vtime:
854 .long 0x7fffffff,0xffffffff
842 .previous 855 .previous
843#else 856#else
844/* 857/*
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 1046c2c9f8d1..bba14494ee00 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -471,7 +471,12 @@ startup:basr %r13,0 # get base
471.LPG0: 471.LPG0:
472 xc 0x200(256),0x200 # partially clear lowcore 472 xc 0x200(256),0x200 # partially clear lowcore
473 xc 0x300(256),0x300 473 xc 0x300(256),0x300
474 474 l %r1,5f-.LPG0(%r13)
475 stck 0(%r1)
476 spt 6f-.LPG0(%r13)
477 mvc __LC_LAST_UPDATE_CLOCK(8),0(%r1)
478 mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13)
479 mvc __LC_EXIT_TIMER(8),5f-.LPG0(%r13)
475#ifndef CONFIG_MARCH_G5 480#ifndef CONFIG_MARCH_G5
476 # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10} 481 # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10}
477 stidp __LC_CPUID # store cpuid 482 stidp __LC_CPUID # store cpuid
@@ -496,9 +501,13 @@ startup:basr %r13,0 # get base
496 brct %r0,0b 501 brct %r0,0b
497#endif 502#endif
498 503
499 l %r13,0f-.LPG0(%r13) 504 l %r13,4f-.LPG0(%r13)
500 b 0(%r13) 505 b 0(%r13)
5010: .long startup_continue 506 .align 4
5074: .long startup_continue
5085: .long sched_clock_base_cc
509 .align 8
5106: .long 0x7fffffff,0xffffffff
502 511
503# 512#
504# params at 10400 (setup.h) 513# params at 10400 (setup.h)
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 6f3711a0eaaa..b8bf4b140065 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -23,6 +23,7 @@
23#include <asm/ebcdic.h> 23#include <asm/ebcdic.h>
24#include <asm/reset.h> 24#include <asm/reset.h>
25#include <asm/sclp.h> 25#include <asm/sclp.h>
26#include <asm/sigp.h>
26#include <asm/checksum.h> 27#include <asm/checksum.h>
27 28
28#define IPL_PARM_BLOCK_VERSION 0 29#define IPL_PARM_BLOCK_VERSION 0
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
index 4bfdc421d7e9..28cf196ba775 100644
--- a/arch/s390/kernel/nmi.c
+++ b/arch/s390/kernel/nmi.c
@@ -10,6 +10,7 @@
10 10
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/hardirq.h>
13#include <linux/time.h> 14#include <linux/time.h>
14#include <linux/module.h> 15#include <linux/module.h>
15#include <asm/lowcore.h> 16#include <asm/lowcore.h>
@@ -253,7 +254,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
253 struct mci *mci; 254 struct mci *mci;
254 int umode; 255 int umode;
255 256
256 lockdep_off(); 257 nmi_enter();
257 s390_idle_check(); 258 s390_idle_check();
258 259
259 mci = (struct mci *) &S390_lowcore.mcck_interruption_code; 260 mci = (struct mci *) &S390_lowcore.mcck_interruption_code;
@@ -363,7 +364,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
363 mcck->warning = 1; 364 mcck->warning = 1;
364 set_thread_flag(TIF_MCCK_PENDING); 365 set_thread_flag(TIF_MCCK_PENDING);
365 } 366 }
366 lockdep_on(); 367 nmi_exit();
367} 368}
368 369
369static int __init machine_check_init(void) 370static int __init machine_check_init(void)
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 06201b93cbbf..7402b6a39ead 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -82,9 +82,6 @@ EXPORT_SYMBOL(console_devno);
82unsigned int console_irq = -1; 82unsigned int console_irq = -1;
83EXPORT_SYMBOL(console_irq); 83EXPORT_SYMBOL(console_irq);
84 84
85unsigned long machine_flags;
86EXPORT_SYMBOL(machine_flags);
87
88unsigned long elf_hwcap = 0; 85unsigned long elf_hwcap = 0;
89char elf_platform[ELF_PLATFORM_SIZE]; 86char elf_platform[ELF_PLATFORM_SIZE];
90 87
@@ -426,6 +423,7 @@ setup_lowcore(void)
426 __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0) + PAGE_SIZE; 423 __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0) + PAGE_SIZE;
427 lc->current_task = (unsigned long) init_thread_union.thread_info.task; 424 lc->current_task = (unsigned long) init_thread_union.thread_info.task;
428 lc->thread_info = (unsigned long) &init_thread_union; 425 lc->thread_info = (unsigned long) &init_thread_union;
426 lc->machine_flags = S390_lowcore.machine_flags;
429#ifndef CONFIG_64BIT 427#ifndef CONFIG_64BIT
430 if (MACHINE_HAS_IEEE) { 428 if (MACHINE_HAS_IEEE) {
431 lc->extended_save_area_addr = (__u32) 429 lc->extended_save_area_addr = (__u32)
@@ -436,6 +434,14 @@ setup_lowcore(void)
436#else 434#else
437 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0]; 435 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
438#endif 436#endif
437 lc->sync_enter_timer = S390_lowcore.sync_enter_timer;
438 lc->async_enter_timer = S390_lowcore.async_enter_timer;
439 lc->exit_timer = S390_lowcore.exit_timer;
440 lc->user_timer = S390_lowcore.user_timer;
441 lc->system_timer = S390_lowcore.system_timer;
442 lc->steal_timer = S390_lowcore.steal_timer;
443 lc->last_update_timer = S390_lowcore.last_update_timer;
444 lc->last_update_clock = S390_lowcore.last_update_clock;
439 set_prefix((u32)(unsigned long) lc); 445 set_prefix((u32)(unsigned long) lc);
440 lowcore_ptr[0] = lc; 446 lowcore_ptr[0] = lc;
441} 447}
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 006ed5016eb4..a985a3ba4401 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -571,6 +571,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
571 cpu_lowcore->current_task = (unsigned long) idle; 571 cpu_lowcore->current_task = (unsigned long) idle;
572 cpu_lowcore->cpu_nr = cpu; 572 cpu_lowcore->cpu_nr = cpu;
573 cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; 573 cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce;
574 cpu_lowcore->machine_flags = S390_lowcore.machine_flags;
574 eieio(); 575 eieio();
575 576
576 while (signal_processor(cpu, sigp_restart) == sigp_busy) 577 while (signal_processor(cpu, sigp_restart) == sigp_busy)
@@ -590,7 +591,8 @@ static int __init setup_possible_cpus(char *s)
590 int pcpus, cpu; 591 int pcpus, cpu;
591 592
592 pcpus = simple_strtoul(s, NULL, 0); 593 pcpus = simple_strtoul(s, NULL, 0);
593 for (cpu = 0; cpu < pcpus && cpu < nr_cpu_ids; cpu++) 594 init_cpu_possible(cpumask_of(0));
595 for (cpu = 1; cpu < pcpus && cpu < nr_cpu_ids; cpu++)
594 set_cpu_possible(cpu, true); 596 set_cpu_possible(cpu, true);
595 return 0; 597 return 0;
596} 598}
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index fe5b25a988ab..2c7739fe70b1 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -336,3 +336,5 @@ SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper)
336SYSCALL(sys_pipe2,sys_pipe2,sys_pipe2_wrapper) /* 325 */ 336SYSCALL(sys_pipe2,sys_pipe2,sys_pipe2_wrapper) /* 325 */
337SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper) 337SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper)
338SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper) 338SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper)
339SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper)
340SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper)
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index f72d41068dc2..ef596d020573 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -52,9 +52,6 @@
52#define USECS_PER_JIFFY ((unsigned long) 1000000/HZ) 52#define USECS_PER_JIFFY ((unsigned long) 1000000/HZ)
53#define CLK_TICKS_PER_JIFFY ((unsigned long) USECS_PER_JIFFY << 12) 53#define CLK_TICKS_PER_JIFFY ((unsigned long) USECS_PER_JIFFY << 12)
54 54
55/* The value of the TOD clock for 1.1.1970. */
56#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
57
58/* 55/*
59 * Create a small time difference between the timer interrupts 56 * Create a small time difference between the timer interrupts
60 * on the different cpus to avoid lock contention. 57 * on the different cpus to avoid lock contention.
@@ -63,9 +60,10 @@
63 60
64#define TICK_SIZE tick 61#define TICK_SIZE tick
65 62
63u64 sched_clock_base_cc = -1; /* Force to data section. */
64
66static ext_int_info_t ext_int_info_cc; 65static ext_int_info_t ext_int_info_cc;
67static ext_int_info_t ext_int_etr_cc; 66static ext_int_info_t ext_int_etr_cc;
68static u64 sched_clock_base_cc;
69 67
70static DEFINE_PER_CPU(struct clock_event_device, comparators); 68static DEFINE_PER_CPU(struct clock_event_device, comparators);
71 69
@@ -195,25 +193,15 @@ static void timing_alert_interrupt(__u16 code)
195static void etr_reset(void); 193static void etr_reset(void);
196static void stp_reset(void); 194static void stp_reset(void);
197 195
198/* 196unsigned long read_persistent_clock(void)
199 * Get the TOD clock running.
200 */
201static u64 __init reset_tod_clock(void)
202{ 197{
203 u64 time; 198 struct timespec ts;
204
205 etr_reset();
206 stp_reset();
207 if (store_clock(&time) == 0)
208 return time;
209 /* TOD clock not running. Set the clock to Unix Epoch. */
210 if (set_clock(TOD_UNIX_EPOCH) != 0 || store_clock(&time) != 0)
211 panic("TOD clock not operational.");
212 199
213 return TOD_UNIX_EPOCH; 200 tod_to_timeval(get_clock() - TOD_UNIX_EPOCH, &ts);
201 return ts.tv_sec;
214} 202}
215 203
216static cycle_t read_tod_clock(void) 204static cycle_t read_tod_clock(struct clocksource *cs)
217{ 205{
218 return get_clock(); 206 return get_clock();
219} 207}
@@ -265,12 +253,13 @@ void update_vsyscall_tz(void)
265 */ 253 */
266void __init time_init(void) 254void __init time_init(void)
267{ 255{
268 sched_clock_base_cc = reset_tod_clock(); 256 struct timespec ts;
257 unsigned long flags;
258 cycle_t now;
269 259
270 /* set xtime */ 260 /* Reset time synchronization interfaces. */
271 tod_to_timeval(sched_clock_base_cc - TOD_UNIX_EPOCH, &xtime); 261 etr_reset();
272 set_normalized_timespec(&wall_to_monotonic, 262 stp_reset();
273 -xtime.tv_sec, -xtime.tv_nsec);
274 263
275 /* request the clock comparator external interrupt */ 264 /* request the clock comparator external interrupt */
276 if (register_early_external_interrupt(0x1004, 265 if (register_early_external_interrupt(0x1004,
@@ -278,17 +267,38 @@ void __init time_init(void)
278 &ext_int_info_cc) != 0) 267 &ext_int_info_cc) != 0)
279 panic("Couldn't request external interrupt 0x1004"); 268 panic("Couldn't request external interrupt 0x1004");
280 269
281 if (clocksource_register(&clocksource_tod) != 0)
282 panic("Could not register TOD clock source");
283
284 /* request the timing alert external interrupt */ 270 /* request the timing alert external interrupt */
285 if (register_early_external_interrupt(0x1406, 271 if (register_early_external_interrupt(0x1406,
286 timing_alert_interrupt, 272 timing_alert_interrupt,
287 &ext_int_etr_cc) != 0) 273 &ext_int_etr_cc) != 0)
288 panic("Couldn't request external interrupt 0x1406"); 274 panic("Couldn't request external interrupt 0x1406");
289 275
276 if (clocksource_register(&clocksource_tod) != 0)
277 panic("Could not register TOD clock source");
278
279 /*
280 * The TOD clock is an accurate clock. The xtime should be
281 * initialized in a way that the difference between TOD and
282 * xtime is reasonably small. Too bad that timekeeping_init
283 * sets xtime.tv_nsec to zero. In addition the clock source
284 * change from the jiffies clock source to the TOD clock
285 * source add another error of up to 1/HZ second. The same
286 * function sets wall_to_monotonic to a value that is too
287 * small for /proc/uptime to be accurate.
288 * Reset xtime and wall_to_monotonic to sane values.
289 */
290 write_seqlock_irqsave(&xtime_lock, flags);
291 now = get_clock();
292 tod_to_timeval(now - TOD_UNIX_EPOCH, &xtime);
293 clocksource_tod.cycle_last = now;
294 clocksource_tod.raw_time = xtime;
295 tod_to_timeval(sched_clock_base_cc - TOD_UNIX_EPOCH, &ts);
296 set_normalized_timespec(&wall_to_monotonic, -ts.tv_sec, -ts.tv_nsec);
297 write_sequnlock_irqrestore(&xtime_lock, flags);
298
290 /* Enable TOD clock interrupts on the boot cpu. */ 299 /* Enable TOD clock interrupts on the boot cpu. */
291 init_cpu_timer(); 300 init_cpu_timer();
301
292 /* Enable cpu timer interrupts on the boot cpu. */ 302 /* Enable cpu timer interrupts on the boot cpu. */
293 vtime_init(); 303 vtime_init();
294} 304}
@@ -1423,6 +1433,7 @@ static void *stp_page;
1423static void stp_work_fn(struct work_struct *work); 1433static void stp_work_fn(struct work_struct *work);
1424static DEFINE_MUTEX(stp_work_mutex); 1434static DEFINE_MUTEX(stp_work_mutex);
1425static DECLARE_WORK(stp_work, stp_work_fn); 1435static DECLARE_WORK(stp_work, stp_work_fn);
1436static struct timer_list stp_timer;
1426 1437
1427static int __init early_parse_stp(char *p) 1438static int __init early_parse_stp(char *p)
1428{ 1439{
@@ -1454,10 +1465,16 @@ static void __init stp_reset(void)
1454 } 1465 }
1455} 1466}
1456 1467
1468static void stp_timeout(unsigned long dummy)
1469{
1470 queue_work(time_sync_wq, &stp_work);
1471}
1472
1457static int __init stp_init(void) 1473static int __init stp_init(void)
1458{ 1474{
1459 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags)) 1475 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags))
1460 return 0; 1476 return 0;
1477 setup_timer(&stp_timer, stp_timeout, 0UL);
1461 time_init_wq(); 1478 time_init_wq();
1462 if (!stp_online) 1479 if (!stp_online)
1463 return 0; 1480 return 0;
@@ -1565,6 +1582,7 @@ static void stp_work_fn(struct work_struct *work)
1565 1582
1566 if (!stp_online) { 1583 if (!stp_online) {
1567 chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000); 1584 chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000);
1585 del_timer_sync(&stp_timer);
1568 goto out_unlock; 1586 goto out_unlock;
1569 } 1587 }
1570 1588
@@ -1586,6 +1604,13 @@ static void stp_work_fn(struct work_struct *work)
1586 stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map); 1604 stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map);
1587 put_online_cpus(); 1605 put_online_cpus();
1588 1606
1607 if (!check_sync_clock())
1608 /*
1609 * There is a usable clock but the synchonization failed.
1610 * Retry after a second.
1611 */
1612 mod_timer(&stp_timer, jiffies + HZ);
1613
1589out_unlock: 1614out_unlock:
1590 mutex_unlock(&stp_work_mutex); 1615 mutex_unlock(&stp_work_mutex);
1591} 1616}
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index ecf0304e61c1..c87f59bd8246 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -134,6 +134,8 @@ void vtime_start_cpu(void)
134 /* Account time spent with enabled wait psw loaded as idle time. */ 134 /* Account time spent with enabled wait psw loaded as idle time. */
135 idle_time = S390_lowcore.int_clock - idle->idle_enter; 135 idle_time = S390_lowcore.int_clock - idle->idle_enter;
136 account_idle_time(idle_time); 136 account_idle_time(idle_time);
137 S390_lowcore.steal_timer +=
138 idle->idle_enter - S390_lowcore.last_update_clock;
137 S390_lowcore.last_update_clock = S390_lowcore.int_clock; 139 S390_lowcore.last_update_clock = S390_lowcore.int_clock;
138 140
139 /* Account system time spent going idle. */ 141 /* Account system time spent going idle. */
@@ -238,6 +240,22 @@ void vtime_stop_cpu(void)
238 } 240 }
239} 241}
240 242
243cputime64_t s390_get_idle_time(int cpu)
244{
245 struct s390_idle_data *idle;
246 unsigned long long now, idle_time, idle_enter;
247
248 idle = &per_cpu(s390_idle, cpu);
249 spin_lock(&idle->lock);
250 now = get_clock();
251 idle_time = 0;
252 idle_enter = idle->idle_enter;
253 if (idle_enter != 0ULL && idle_enter < now)
254 idle_time = now - idle_enter;
255 spin_unlock(&idle->lock);
256 return idle_time;
257}
258
241/* 259/*
242 * Sorted add to a list. List is linear searched until first bigger 260 * Sorted add to a list. List is linear searched until first bigger
243 * element is found. 261 * element is found.
@@ -425,17 +443,7 @@ void add_virt_timer_periodic(void *new)
425} 443}
426EXPORT_SYMBOL(add_virt_timer_periodic); 444EXPORT_SYMBOL(add_virt_timer_periodic);
427 445
428/* 446int __mod_vtimer(struct vtimer_list *timer, __u64 expires, int periodic)
429 * If we change a pending timer the function must be called on the CPU
430 * where the timer is running on, e.g. by smp_call_function_single()
431 *
432 * The original mod_timer adds the timer if it is not pending. For
433 * compatibility we do the same. The timer will be added on the current
434 * CPU as a oneshot timer.
435 *
436 * returns whether it has modified a pending timer (1) or not (0)
437 */
438int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
439{ 447{
440 struct vtimer_queue *vq; 448 struct vtimer_queue *vq;
441 unsigned long flags; 449 unsigned long flags;
@@ -444,39 +452,35 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
444 BUG_ON(!timer->function); 452 BUG_ON(!timer->function);
445 BUG_ON(!expires || expires > VTIMER_MAX_SLICE); 453 BUG_ON(!expires || expires > VTIMER_MAX_SLICE);
446 454
447 /*
448 * This is a common optimization triggered by the
449 * networking code - if the timer is re-modified
450 * to be the same thing then just return:
451 */
452 if (timer->expires == expires && vtimer_pending(timer)) 455 if (timer->expires == expires && vtimer_pending(timer))
453 return 1; 456 return 1;
454 457
455 cpu = get_cpu(); 458 cpu = get_cpu();
456 vq = &per_cpu(virt_cpu_timer, cpu); 459 vq = &per_cpu(virt_cpu_timer, cpu);
457 460
458 /* check if we run on the right CPU */
459 BUG_ON(timer->cpu != cpu);
460
461 /* disable interrupts before test if timer is pending */ 461 /* disable interrupts before test if timer is pending */
462 spin_lock_irqsave(&vq->lock, flags); 462 spin_lock_irqsave(&vq->lock, flags);
463 463
464 /* if timer isn't pending add it on the current CPU */ 464 /* if timer isn't pending add it on the current CPU */
465 if (!vtimer_pending(timer)) { 465 if (!vtimer_pending(timer)) {
466 spin_unlock_irqrestore(&vq->lock, flags); 466 spin_unlock_irqrestore(&vq->lock, flags);
467 /* we do not activate an interval timer with mod_virt_timer */ 467
468 timer->interval = 0; 468 if (periodic)
469 timer->interval = expires;
470 else
471 timer->interval = 0;
469 timer->expires = expires; 472 timer->expires = expires;
470 timer->cpu = cpu; 473 timer->cpu = cpu;
471 internal_add_vtimer(timer); 474 internal_add_vtimer(timer);
472 return 0; 475 return 0;
473 } 476 }
474 477
478 /* check if we run on the right CPU */
479 BUG_ON(timer->cpu != cpu);
480
475 list_del_init(&timer->entry); 481 list_del_init(&timer->entry);
476 timer->expires = expires; 482 timer->expires = expires;
477 483 if (periodic)
478 /* also change the interval if we have an interval timer */
479 if (timer->interval)
480 timer->interval = expires; 484 timer->interval = expires;
481 485
482 /* the timer can't expire anymore so we can release the lock */ 486 /* the timer can't expire anymore so we can release the lock */
@@ -484,9 +488,32 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
484 internal_add_vtimer(timer); 488 internal_add_vtimer(timer);
485 return 1; 489 return 1;
486} 490}
491
492/*
493 * If we change a pending timer the function must be called on the CPU
494 * where the timer is running on.
495 *
496 * returns whether it has modified a pending timer (1) or not (0)
497 */
498int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
499{
500 return __mod_vtimer(timer, expires, 0);
501}
487EXPORT_SYMBOL(mod_virt_timer); 502EXPORT_SYMBOL(mod_virt_timer);
488 503
489/* 504/*
505 * If we change a pending timer the function must be called on the CPU
506 * where the timer is running on.
507 *
508 * returns whether it has modified a pending timer (1) or not (0)
509 */
510int mod_virt_timer_periodic(struct vtimer_list *timer, __u64 expires)
511{
512 return __mod_vtimer(timer, expires, 1);
513}
514EXPORT_SYMBOL(mod_virt_timer_periodic);
515
516/*
490 * delete a virtual timer 517 * delete a virtual timer
491 * 518 *
492 * returns whether the deleted timer was pending (1) or not (0) 519 * returns whether the deleted timer was pending (1) or not (0)
@@ -516,16 +543,8 @@ EXPORT_SYMBOL(del_virt_timer);
516 */ 543 */
517void init_cpu_vtimer(void) 544void init_cpu_vtimer(void)
518{ 545{
519 struct thread_info *ti = current_thread_info();
520 struct vtimer_queue *vq; 546 struct vtimer_queue *vq;
521 547
522 S390_lowcore.user_timer = ti->user_timer;
523 S390_lowcore.system_timer = ti->system_timer;
524
525 /* kick the virtual timer */
526 asm volatile ("STCK %0" : "=m" (S390_lowcore.last_update_clock));
527 asm volatile ("STPT %0" : "=m" (S390_lowcore.last_update_timer));
528
529 /* initialize per cpu vtimer structure */ 548 /* initialize per cpu vtimer structure */
530 vq = &__get_cpu_var(virt_cpu_timer); 549 vq = &__get_cpu_var(virt_cpu_timer);
531 INIT_LIST_HEAD(&vq->list); 550 INIT_LIST_HEAD(&vq->list);