diff options
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/compat_wrapper.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/ipl.c | 135 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 19 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 3 | ||||
-rw-r--r-- | arch/s390/kernel/vdso32/clock_gettime.S | 10 | ||||
-rw-r--r-- | arch/s390/kernel/vdso64/clock_gettime.S | 10 |
6 files changed, 123 insertions, 57 deletions
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c index 45cdb37aa6f8..faf6caa510dc 100644 --- a/arch/s390/kernel/compat_wrapper.c +++ b/arch/s390/kernel/compat_wrapper.c | |||
@@ -214,3 +214,6 @@ COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, fla | |||
214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); | 214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); |
215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); | 215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); |
216 | COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags); | 216 | COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags); |
217 | COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs) | ||
218 | COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags) | ||
219 | COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags) | ||
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 633ca7504536..39badb9ca0b3 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -455,22 +455,6 @@ DEFINE_IPL_ATTR_RO(ipl_fcp, bootprog, "%lld\n", (unsigned long long) | |||
455 | DEFINE_IPL_ATTR_RO(ipl_fcp, br_lba, "%lld\n", (unsigned long long) | 455 | DEFINE_IPL_ATTR_RO(ipl_fcp, br_lba, "%lld\n", (unsigned long long) |
456 | IPL_PARMBLOCK_START->ipl_info.fcp.br_lba); | 456 | IPL_PARMBLOCK_START->ipl_info.fcp.br_lba); |
457 | 457 | ||
458 | static struct attribute *ipl_fcp_attrs[] = { | ||
459 | &sys_ipl_type_attr.attr, | ||
460 | &sys_ipl_device_attr.attr, | ||
461 | &sys_ipl_fcp_wwpn_attr.attr, | ||
462 | &sys_ipl_fcp_lun_attr.attr, | ||
463 | &sys_ipl_fcp_bootprog_attr.attr, | ||
464 | &sys_ipl_fcp_br_lba_attr.attr, | ||
465 | NULL, | ||
466 | }; | ||
467 | |||
468 | static struct attribute_group ipl_fcp_attr_group = { | ||
469 | .attrs = ipl_fcp_attrs, | ||
470 | }; | ||
471 | |||
472 | /* CCW ipl device attributes */ | ||
473 | |||
474 | static ssize_t ipl_ccw_loadparm_show(struct kobject *kobj, | 458 | static ssize_t ipl_ccw_loadparm_show(struct kobject *kobj, |
475 | struct kobj_attribute *attr, char *page) | 459 | struct kobj_attribute *attr, char *page) |
476 | { | 460 | { |
@@ -487,6 +471,23 @@ static ssize_t ipl_ccw_loadparm_show(struct kobject *kobj, | |||
487 | static struct kobj_attribute sys_ipl_ccw_loadparm_attr = | 471 | static struct kobj_attribute sys_ipl_ccw_loadparm_attr = |
488 | __ATTR(loadparm, 0444, ipl_ccw_loadparm_show, NULL); | 472 | __ATTR(loadparm, 0444, ipl_ccw_loadparm_show, NULL); |
489 | 473 | ||
474 | static struct attribute *ipl_fcp_attrs[] = { | ||
475 | &sys_ipl_type_attr.attr, | ||
476 | &sys_ipl_device_attr.attr, | ||
477 | &sys_ipl_fcp_wwpn_attr.attr, | ||
478 | &sys_ipl_fcp_lun_attr.attr, | ||
479 | &sys_ipl_fcp_bootprog_attr.attr, | ||
480 | &sys_ipl_fcp_br_lba_attr.attr, | ||
481 | &sys_ipl_ccw_loadparm_attr.attr, | ||
482 | NULL, | ||
483 | }; | ||
484 | |||
485 | static struct attribute_group ipl_fcp_attr_group = { | ||
486 | .attrs = ipl_fcp_attrs, | ||
487 | }; | ||
488 | |||
489 | /* CCW ipl device attributes */ | ||
490 | |||
490 | static struct attribute *ipl_ccw_attrs_vm[] = { | 491 | static struct attribute *ipl_ccw_attrs_vm[] = { |
491 | &sys_ipl_type_attr.attr, | 492 | &sys_ipl_type_attr.attr, |
492 | &sys_ipl_device_attr.attr, | 493 | &sys_ipl_device_attr.attr, |
@@ -765,28 +766,10 @@ DEFINE_IPL_ATTR_RW(reipl_fcp, br_lba, "%lld\n", "%lld\n", | |||
765 | DEFINE_IPL_ATTR_RW(reipl_fcp, device, "0.0.%04llx\n", "0.0.%llx\n", | 766 | DEFINE_IPL_ATTR_RW(reipl_fcp, device, "0.0.%04llx\n", "0.0.%llx\n", |
766 | reipl_block_fcp->ipl_info.fcp.devno); | 767 | reipl_block_fcp->ipl_info.fcp.devno); |
767 | 768 | ||
768 | static struct attribute *reipl_fcp_attrs[] = { | ||
769 | &sys_reipl_fcp_device_attr.attr, | ||
770 | &sys_reipl_fcp_wwpn_attr.attr, | ||
771 | &sys_reipl_fcp_lun_attr.attr, | ||
772 | &sys_reipl_fcp_bootprog_attr.attr, | ||
773 | &sys_reipl_fcp_br_lba_attr.attr, | ||
774 | NULL, | ||
775 | }; | ||
776 | |||
777 | static struct attribute_group reipl_fcp_attr_group = { | ||
778 | .attrs = reipl_fcp_attrs, | ||
779 | }; | ||
780 | |||
781 | /* CCW reipl device attributes */ | ||
782 | |||
783 | DEFINE_IPL_ATTR_RW(reipl_ccw, device, "0.0.%04llx\n", "0.0.%llx\n", | ||
784 | reipl_block_ccw->ipl_info.ccw.devno); | ||
785 | |||
786 | static void reipl_get_ascii_loadparm(char *loadparm, | 769 | static void reipl_get_ascii_loadparm(char *loadparm, |
787 | struct ipl_parameter_block *ibp) | 770 | struct ipl_parameter_block *ibp) |
788 | { | 771 | { |
789 | memcpy(loadparm, ibp->ipl_info.ccw.load_parm, LOADPARM_LEN); | 772 | memcpy(loadparm, ibp->hdr.loadparm, LOADPARM_LEN); |
790 | EBCASC(loadparm, LOADPARM_LEN); | 773 | EBCASC(loadparm, LOADPARM_LEN); |
791 | loadparm[LOADPARM_LEN] = 0; | 774 | loadparm[LOADPARM_LEN] = 0; |
792 | strim(loadparm); | 775 | strim(loadparm); |
@@ -821,13 +804,50 @@ static ssize_t reipl_generic_loadparm_store(struct ipl_parameter_block *ipb, | |||
821 | return -EINVAL; | 804 | return -EINVAL; |
822 | } | 805 | } |
823 | /* initialize loadparm with blanks */ | 806 | /* initialize loadparm with blanks */ |
824 | memset(ipb->ipl_info.ccw.load_parm, ' ', LOADPARM_LEN); | 807 | memset(ipb->hdr.loadparm, ' ', LOADPARM_LEN); |
825 | /* copy and convert to ebcdic */ | 808 | /* copy and convert to ebcdic */ |
826 | memcpy(ipb->ipl_info.ccw.load_parm, buf, lp_len); | 809 | memcpy(ipb->hdr.loadparm, buf, lp_len); |
827 | ASCEBC(ipb->ipl_info.ccw.load_parm, LOADPARM_LEN); | 810 | ASCEBC(ipb->hdr.loadparm, LOADPARM_LEN); |
828 | return len; | 811 | return len; |
829 | } | 812 | } |
830 | 813 | ||
814 | /* FCP wrapper */ | ||
815 | static ssize_t reipl_fcp_loadparm_show(struct kobject *kobj, | ||
816 | struct kobj_attribute *attr, char *page) | ||
817 | { | ||
818 | return reipl_generic_loadparm_show(reipl_block_fcp, page); | ||
819 | } | ||
820 | |||
821 | static ssize_t reipl_fcp_loadparm_store(struct kobject *kobj, | ||
822 | struct kobj_attribute *attr, | ||
823 | const char *buf, size_t len) | ||
824 | { | ||
825 | return reipl_generic_loadparm_store(reipl_block_fcp, buf, len); | ||
826 | } | ||
827 | |||
828 | static struct kobj_attribute sys_reipl_fcp_loadparm_attr = | ||
829 | __ATTR(loadparm, S_IRUGO | S_IWUSR, reipl_fcp_loadparm_show, | ||
830 | reipl_fcp_loadparm_store); | ||
831 | |||
832 | static struct attribute *reipl_fcp_attrs[] = { | ||
833 | &sys_reipl_fcp_device_attr.attr, | ||
834 | &sys_reipl_fcp_wwpn_attr.attr, | ||
835 | &sys_reipl_fcp_lun_attr.attr, | ||
836 | &sys_reipl_fcp_bootprog_attr.attr, | ||
837 | &sys_reipl_fcp_br_lba_attr.attr, | ||
838 | &sys_reipl_fcp_loadparm_attr.attr, | ||
839 | NULL, | ||
840 | }; | ||
841 | |||
842 | static struct attribute_group reipl_fcp_attr_group = { | ||
843 | .attrs = reipl_fcp_attrs, | ||
844 | }; | ||
845 | |||
846 | /* CCW reipl device attributes */ | ||
847 | |||
848 | DEFINE_IPL_ATTR_RW(reipl_ccw, device, "0.0.%04llx\n", "0.0.%llx\n", | ||
849 | reipl_block_ccw->ipl_info.ccw.devno); | ||
850 | |||
831 | /* NSS wrapper */ | 851 | /* NSS wrapper */ |
832 | static ssize_t reipl_nss_loadparm_show(struct kobject *kobj, | 852 | static ssize_t reipl_nss_loadparm_show(struct kobject *kobj, |
833 | struct kobj_attribute *attr, char *page) | 853 | struct kobj_attribute *attr, char *page) |
@@ -1125,11 +1145,10 @@ static void reipl_block_ccw_fill_parms(struct ipl_parameter_block *ipb) | |||
1125 | /* LOADPARM */ | 1145 | /* LOADPARM */ |
1126 | /* check if read scp info worked and set loadparm */ | 1146 | /* check if read scp info worked and set loadparm */ |
1127 | if (sclp_ipl_info.is_valid) | 1147 | if (sclp_ipl_info.is_valid) |
1128 | memcpy(ipb->ipl_info.ccw.load_parm, | 1148 | memcpy(ipb->hdr.loadparm, &sclp_ipl_info.loadparm, LOADPARM_LEN); |
1129 | &sclp_ipl_info.loadparm, LOADPARM_LEN); | ||
1130 | else | 1149 | else |
1131 | /* read scp info failed: set empty loadparm (EBCDIC blanks) */ | 1150 | /* read scp info failed: set empty loadparm (EBCDIC blanks) */ |
1132 | memset(ipb->ipl_info.ccw.load_parm, 0x40, LOADPARM_LEN); | 1151 | memset(ipb->hdr.loadparm, 0x40, LOADPARM_LEN); |
1133 | ipb->hdr.flags = DIAG308_FLAGS_LP_VALID; | 1152 | ipb->hdr.flags = DIAG308_FLAGS_LP_VALID; |
1134 | 1153 | ||
1135 | /* VM PARM */ | 1154 | /* VM PARM */ |
@@ -1251,9 +1270,16 @@ static int __init reipl_fcp_init(void) | |||
1251 | return rc; | 1270 | return rc; |
1252 | } | 1271 | } |
1253 | 1272 | ||
1254 | if (ipl_info.type == IPL_TYPE_FCP) | 1273 | if (ipl_info.type == IPL_TYPE_FCP) { |
1255 | memcpy(reipl_block_fcp, IPL_PARMBLOCK_START, PAGE_SIZE); | 1274 | memcpy(reipl_block_fcp, IPL_PARMBLOCK_START, PAGE_SIZE); |
1256 | else { | 1275 | /* |
1276 | * Fix loadparm: There are systems where the (SCSI) LOADPARM | ||
1277 | * is invalid in the SCSI IPL parameter block, so take it | ||
1278 | * always from sclp_ipl_info. | ||
1279 | */ | ||
1280 | memcpy(reipl_block_fcp->hdr.loadparm, sclp_ipl_info.loadparm, | ||
1281 | LOADPARM_LEN); | ||
1282 | } else { | ||
1257 | reipl_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN; | 1283 | reipl_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN; |
1258 | reipl_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION; | 1284 | reipl_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION; |
1259 | reipl_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN; | 1285 | reipl_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN; |
@@ -1864,7 +1890,23 @@ static void __init shutdown_actions_init(void) | |||
1864 | 1890 | ||
1865 | static int __init s390_ipl_init(void) | 1891 | static int __init s390_ipl_init(void) |
1866 | { | 1892 | { |
1893 | char str[8] = {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}; | ||
1894 | |||
1867 | sclp_get_ipl_info(&sclp_ipl_info); | 1895 | sclp_get_ipl_info(&sclp_ipl_info); |
1896 | /* | ||
1897 | * Fix loadparm: There are systems where the (SCSI) LOADPARM | ||
1898 | * returned by read SCP info is invalid (contains EBCDIC blanks) | ||
1899 | * when the system has been booted via diag308. In that case we use | ||
1900 | * the value from diag308, if available. | ||
1901 | * | ||
1902 | * There are also systems where diag308 store does not work in | ||
1903 | * case the system is booted from HMC. Fortunately in this case | ||
1904 | * READ SCP info provides the correct value. | ||
1905 | */ | ||
1906 | if (memcmp(sclp_ipl_info.loadparm, str, sizeof(str)) == 0 && | ||
1907 | diag308_set_works) | ||
1908 | memcpy(sclp_ipl_info.loadparm, ipl_block.hdr.loadparm, | ||
1909 | LOADPARM_LEN); | ||
1868 | shutdown_actions_init(); | 1910 | shutdown_actions_init(); |
1869 | shutdown_triggers_init(); | 1911 | shutdown_triggers_init(); |
1870 | return 0; | 1912 | return 0; |
@@ -2060,6 +2102,13 @@ void s390_reset_system(void (*func)(void *), void *data) | |||
2060 | S390_lowcore.program_new_psw.addr = | 2102 | S390_lowcore.program_new_psw.addr = |
2061 | PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; | 2103 | PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; |
2062 | 2104 | ||
2105 | /* | ||
2106 | * Clear subchannel ID and number to signal new kernel that no CCW or | ||
2107 | * SCSI IPL has been done (for kexec and kdump) | ||
2108 | */ | ||
2109 | S390_lowcore.subchannel_id = 0; | ||
2110 | S390_lowcore.subchannel_nr = 0; | ||
2111 | |||
2063 | /* Store status at absolute zero */ | 2112 | /* Store status at absolute zero */ |
2064 | store_status(); | 2113 | store_status(); |
2065 | 2114 | ||
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index ae1d5be7dd88..82bc113e8c1d 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/stddef.h> | 24 | #include <linux/stddef.h> |
25 | #include <linux/unistd.h> | 25 | #include <linux/unistd.h> |
26 | #include <linux/ptrace.h> | 26 | #include <linux/ptrace.h> |
27 | #include <linux/random.h> | ||
27 | #include <linux/user.h> | 28 | #include <linux/user.h> |
28 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
@@ -61,6 +62,7 @@ | |||
61 | #include <asm/diag.h> | 62 | #include <asm/diag.h> |
62 | #include <asm/os_info.h> | 63 | #include <asm/os_info.h> |
63 | #include <asm/sclp.h> | 64 | #include <asm/sclp.h> |
65 | #include <asm/sysinfo.h> | ||
64 | #include "entry.h" | 66 | #include "entry.h" |
65 | 67 | ||
66 | /* | 68 | /* |
@@ -766,6 +768,7 @@ static void __init setup_hwcaps(void) | |||
766 | #endif | 768 | #endif |
767 | 769 | ||
768 | get_cpu_id(&cpu_id); | 770 | get_cpu_id(&cpu_id); |
771 | add_device_randomness(&cpu_id, sizeof(cpu_id)); | ||
769 | switch (cpu_id.machine) { | 772 | switch (cpu_id.machine) { |
770 | case 0x9672: | 773 | case 0x9672: |
771 | #if !defined(CONFIG_64BIT) | 774 | #if !defined(CONFIG_64BIT) |
@@ -804,6 +807,19 @@ static void __init setup_hwcaps(void) | |||
804 | } | 807 | } |
805 | 808 | ||
806 | /* | 809 | /* |
810 | * Add system information as device randomness | ||
811 | */ | ||
812 | static void __init setup_randomness(void) | ||
813 | { | ||
814 | struct sysinfo_3_2_2 *vmms; | ||
815 | |||
816 | vmms = (struct sysinfo_3_2_2 *) alloc_page(GFP_KERNEL); | ||
817 | if (vmms && stsi(vmms, 3, 2, 2) == 0 && vmms->count) | ||
818 | add_device_randomness(&vmms, vmms->count); | ||
819 | free_page((unsigned long) vmms); | ||
820 | } | ||
821 | |||
822 | /* | ||
807 | * Setup function called from init/main.c just after the banner | 823 | * Setup function called from init/main.c just after the banner |
808 | * was printed. | 824 | * was printed. |
809 | */ | 825 | */ |
@@ -901,6 +917,9 @@ void __init setup_arch(char **cmdline_p) | |||
901 | 917 | ||
902 | /* Setup zfcpdump support */ | 918 | /* Setup zfcpdump support */ |
903 | setup_zfcpdump(); | 919 | setup_zfcpdump(); |
920 | |||
921 | /* Add system specific data to the random pool */ | ||
922 | setup_randomness(); | ||
904 | } | 923 | } |
905 | 924 | ||
906 | #ifdef CONFIG_32BIT | 925 | #ifdef CONFIG_32BIT |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index fe5cdf29a001..6fe886ac2db5 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -356,3 +356,6 @@ SYSCALL(sys_finit_module,sys_finit_module,compat_sys_finit_module) | |||
356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ | 356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ |
357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) | 357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) |
358 | SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2) | 358 | SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2) |
359 | SYSCALL(sys_seccomp,sys_seccomp,compat_sys_seccomp) | ||
360 | SYSCALL(sys_getrandom,sys_getrandom,compat_sys_getrandom) | ||
361 | SYSCALL(sys_memfd_create,sys_memfd_create,compat_sys_memfd_create) /* 350 */ | ||
diff --git a/arch/s390/kernel/vdso32/clock_gettime.S b/arch/s390/kernel/vdso32/clock_gettime.S index 65fc3979c2f1..7cf18f8d4cb4 100644 --- a/arch/s390/kernel/vdso32/clock_gettime.S +++ b/arch/s390/kernel/vdso32/clock_gettime.S | |||
@@ -22,13 +22,11 @@ __kernel_clock_gettime: | |||
22 | basr %r5,0 | 22 | basr %r5,0 |
23 | 0: al %r5,21f-0b(%r5) /* get &_vdso_data */ | 23 | 0: al %r5,21f-0b(%r5) /* get &_vdso_data */ |
24 | chi %r2,__CLOCK_REALTIME | 24 | chi %r2,__CLOCK_REALTIME |
25 | je 10f | 25 | je 11f |
26 | chi %r2,__CLOCK_MONOTONIC | 26 | chi %r2,__CLOCK_MONOTONIC |
27 | jne 19f | 27 | jne 19f |
28 | 28 | ||
29 | /* CLOCK_MONOTONIC */ | 29 | /* CLOCK_MONOTONIC */ |
30 | ltr %r3,%r3 | ||
31 | jz 9f /* tp == NULL */ | ||
32 | 1: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */ | 30 | 1: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */ |
33 | tml %r4,0x0001 /* pending update ? loop */ | 31 | tml %r4,0x0001 /* pending update ? loop */ |
34 | jnz 1b | 32 | jnz 1b |
@@ -67,12 +65,10 @@ __kernel_clock_gettime: | |||
67 | j 6b | 65 | j 6b |
68 | 8: st %r2,0(%r3) /* store tp->tv_sec */ | 66 | 8: st %r2,0(%r3) /* store tp->tv_sec */ |
69 | st %r1,4(%r3) /* store tp->tv_nsec */ | 67 | st %r1,4(%r3) /* store tp->tv_nsec */ |
70 | 9: lhi %r2,0 | 68 | lhi %r2,0 |
71 | br %r14 | 69 | br %r14 |
72 | 70 | ||
73 | /* CLOCK_REALTIME */ | 71 | /* CLOCK_REALTIME */ |
74 | 10: ltr %r3,%r3 /* tp == NULL */ | ||
75 | jz 18f | ||
76 | 11: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */ | 72 | 11: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */ |
77 | tml %r4,0x0001 /* pending update ? loop */ | 73 | tml %r4,0x0001 /* pending update ? loop */ |
78 | jnz 11b | 74 | jnz 11b |
@@ -111,7 +107,7 @@ __kernel_clock_gettime: | |||
111 | j 15b | 107 | j 15b |
112 | 17: st %r2,0(%r3) /* store tp->tv_sec */ | 108 | 17: st %r2,0(%r3) /* store tp->tv_sec */ |
113 | st %r1,4(%r3) /* store tp->tv_nsec */ | 109 | st %r1,4(%r3) /* store tp->tv_nsec */ |
114 | 18: lhi %r2,0 | 110 | lhi %r2,0 |
115 | br %r14 | 111 | br %r14 |
116 | 112 | ||
117 | /* Fallback to system call */ | 113 | /* Fallback to system call */ |
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S index 91940ed33a4a..3f34e09db5f4 100644 --- a/arch/s390/kernel/vdso64/clock_gettime.S +++ b/arch/s390/kernel/vdso64/clock_gettime.S | |||
@@ -21,7 +21,7 @@ __kernel_clock_gettime: | |||
21 | .cfi_startproc | 21 | .cfi_startproc |
22 | larl %r5,_vdso_data | 22 | larl %r5,_vdso_data |
23 | cghi %r2,__CLOCK_REALTIME | 23 | cghi %r2,__CLOCK_REALTIME |
24 | je 4f | 24 | je 5f |
25 | cghi %r2,__CLOCK_THREAD_CPUTIME_ID | 25 | cghi %r2,__CLOCK_THREAD_CPUTIME_ID |
26 | je 9f | 26 | je 9f |
27 | cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */ | 27 | cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */ |
@@ -30,8 +30,6 @@ __kernel_clock_gettime: | |||
30 | jne 12f | 30 | jne 12f |
31 | 31 | ||
32 | /* CLOCK_MONOTONIC */ | 32 | /* CLOCK_MONOTONIC */ |
33 | ltgr %r3,%r3 | ||
34 | jz 3f /* tp == NULL */ | ||
35 | 0: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */ | 33 | 0: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */ |
36 | tmll %r4,0x0001 /* pending update ? loop */ | 34 | tmll %r4,0x0001 /* pending update ? loop */ |
37 | jnz 0b | 35 | jnz 0b |
@@ -53,12 +51,10 @@ __kernel_clock_gettime: | |||
53 | j 1b | 51 | j 1b |
54 | 2: stg %r0,0(%r3) /* store tp->tv_sec */ | 52 | 2: stg %r0,0(%r3) /* store tp->tv_sec */ |
55 | stg %r1,8(%r3) /* store tp->tv_nsec */ | 53 | stg %r1,8(%r3) /* store tp->tv_nsec */ |
56 | 3: lghi %r2,0 | 54 | lghi %r2,0 |
57 | br %r14 | 55 | br %r14 |
58 | 56 | ||
59 | /* CLOCK_REALTIME */ | 57 | /* CLOCK_REALTIME */ |
60 | 4: ltr %r3,%r3 /* tp == NULL */ | ||
61 | jz 8f | ||
62 | 5: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */ | 58 | 5: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */ |
63 | tmll %r4,0x0001 /* pending update ? loop */ | 59 | tmll %r4,0x0001 /* pending update ? loop */ |
64 | jnz 5b | 60 | jnz 5b |
@@ -80,7 +76,7 @@ __kernel_clock_gettime: | |||
80 | j 6b | 76 | j 6b |
81 | 7: stg %r0,0(%r3) /* store tp->tv_sec */ | 77 | 7: stg %r0,0(%r3) /* store tp->tv_sec */ |
82 | stg %r1,8(%r3) /* store tp->tv_nsec */ | 78 | stg %r1,8(%r3) /* store tp->tv_nsec */ |
83 | 8: lghi %r2,0 | 79 | lghi %r2,0 |
84 | br %r14 | 80 | br %r14 |
85 | 81 | ||
86 | /* CLOCK_THREAD_CPUTIME_ID for this thread */ | 82 | /* CLOCK_THREAD_CPUTIME_ID for this thread */ |