Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'compat-removal'

Heiko Carstens says:

====================

Remove s390 compat support to allow for code simplification and especially
reduced test effort. To the best of our knowledge there aren't any 31 bit
binaries out in the world anymore that would matter for newer kernels or
newer distributions.

Distributions do not provide compat packages since quite some time or even
have CONFIG_COMPAT disabled.

Instead of adding deprecation warnings to config option, or adding kernel
messages, just remove the code. Deprecation warnings haven't proven to be
useful. If it turns out there is still a reason to keep the compat support
this series can be reverted at any time in the future.

====================

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

+462 -3540
-16
arch/s390/Kconfig
··· 505 505 This allows you to specify the maximum length of the kernel command 506 506 line. 507 507 508 - config COMPAT 509 - def_bool n 510 - prompt "Kernel support for 31 bit emulation" 511 - select ARCH_WANT_OLD_COMPAT_IPC 512 - select COMPAT_OLD_SIGACTION 513 - select HAVE_UID16 514 - depends on MULTIUSER 515 - depends on !CC_IS_CLANG && !LD_IS_LLD 516 - help 517 - Select this option if you want to enable your system kernel to 518 - handle system-calls from ELF binaries for 31 bit ESA. This option 519 - (and some other stuff like libraries and such) is needed for 520 - executing 31 bit applications. 521 - 522 - If unsure say N. 523 - 524 508 config SMP 525 509 def_bool y 526 510
+1 -5
arch/s390/Makefile
··· 134 134 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 135 135 136 136 archheaders: 137 - $(Q)$(MAKE) $(build)=$(syscalls) uapi 137 + $(Q)$(MAKE) $(build)=$(syscalls) all 138 138 139 139 archprepare: 140 - $(Q)$(MAKE) $(build)=$(syscalls) kapi 141 140 $(Q)$(MAKE) $(build)=$(tools) kapi $(extra_tools) 142 141 ifeq ($(KBUILD_EXTMOD),) 143 142 # We need to generate vdso-offsets.h before compiling certain files in kernel/. ··· 148 149 prepare: vdso_prepare 149 150 vdso_prepare: prepare0 150 151 $(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h 151 - $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \ 152 - $(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h) 153 152 154 153 vdso-install-y += arch/s390/kernel/vdso64/vdso64.so.dbg 155 - vdso-install-$(CONFIG_COMPAT) += arch/s390/kernel/vdso32/vdso32.so.dbg 156 154 157 155 endif 158 156
+1 -2
arch/s390/boot/ipl_data.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 - #include <linux/compat.h> 4 3 #include <linux/ptrace.h> 5 4 #include <asm/cio.h> 6 5 #include <asm/asm-offsets.h> ··· 11 12 #define PSW_MASK_DISABLED (PSW_MASK_WAIT | PSW_MASK_EA | PSW_MASK_BA) 12 13 13 14 struct ipl_lowcore { 14 - psw_t32 ipl_psw; /* 0x0000 */ 15 + psw32_t ipl_psw; /* 0x0000 */ 15 16 struct ccw0 ccwpgm[2]; /* 0x0008 */ 16 17 u8 fill[56]; /* 0x0018 */ 17 18 struct ccw0 ccwpgmcc[20]; /* 0x0050 */
-3
arch/s390/configs/compat.config
··· 1 - # Help: Enable compat support 2 - CONFIG_COMPAT=y 3 - CONFIG_COMPAT_32BIT_TIME=y
+1 -5
arch/s390/hypfs/hypfs_sprp.c
··· 7 7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> 8 8 */ 9 9 10 - #include <linux/compat.h> 11 10 #include <linux/errno.h> 12 11 #include <linux/gfp.h> 13 12 #include <linux/string.h> ··· 115 116 116 117 if (!capable(CAP_SYS_ADMIN)) 117 118 return -EACCES; 118 - if (is_compat_task()) 119 - argp = compat_ptr(arg); 120 - else 121 - argp = (void __user *) arg; 119 + argp = (void __user *)arg; 122 120 switch (cmd) { 123 121 case HYPFS_DIAG304: 124 122 return __hypfs_sprp_ioctl(argp);
-140
arch/s390/include/asm/compat.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_S390X_COMPAT_H 3 - #define _ASM_S390X_COMPAT_H 4 - /* 5 - * Architecture specific compatibility types 6 - */ 7 - #include <linux/types.h> 8 - #include <linux/sched.h> 9 - #include <linux/sched/task_stack.h> 10 - #include <linux/thread_info.h> 11 - #include <asm/ptrace.h> 12 - 13 - #define compat_mode_t compat_mode_t 14 - typedef u16 compat_mode_t; 15 - 16 - #define __compat_uid_t __compat_uid_t 17 - typedef u16 __compat_uid_t; 18 - typedef u16 __compat_gid_t; 19 - 20 - #define compat_dev_t compat_dev_t 21 - typedef u16 compat_dev_t; 22 - 23 - #define compat_ipc_pid_t compat_ipc_pid_t 24 - typedef u16 compat_ipc_pid_t; 25 - 26 - #define compat_statfs compat_statfs 27 - 28 - #include <asm-generic/compat.h> 29 - 30 - #define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \ 31 - typeof(0?(__force t)0:0ULL), u64)) 32 - 33 - #define __SC_DELOUSE(t,v) ({ \ 34 - BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \ 35 - (__force t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \ 36 - }) 37 - 38 - #define PSW32_MASK_USER 0x0000FF00UL 39 - 40 - #define PSW32_USER_BITS (PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | \ 41 - PSW32_DEFAULT_KEY | PSW32_MASK_BASE | \ 42 - PSW32_MASK_MCHECK | PSW32_MASK_PSTATE | \ 43 - PSW32_ASC_PRIMARY) 44 - 45 - #define COMPAT_UTS_MACHINE "s390\0\0\0\0" 46 - 47 - typedef u16 compat_nlink_t; 48 - 49 - typedef struct { 50 - u32 mask; 51 - u32 addr; 52 - } __aligned(8) psw_compat_t; 53 - 54 - typedef struct { 55 - psw_compat_t psw; 56 - u32 gprs[NUM_GPRS]; 57 - u32 acrs[NUM_ACRS]; 58 - u32 orig_gpr2; 59 - } s390_compat_regs; 60 - 61 - typedef struct { 62 - u32 gprs_high[NUM_GPRS]; 63 - } s390_compat_regs_high; 64 - 65 - struct compat_stat { 66 - compat_dev_t st_dev; 67 - u16 __pad1; 68 - compat_ino_t st_ino; 69 - compat_mode_t st_mode; 70 - compat_nlink_t st_nlink; 71 - __compat_uid_t st_uid; 72 - __compat_gid_t st_gid; 73 - compat_dev_t st_rdev; 74 - u16 __pad2; 75 - u32 st_size; 76 - u32 st_blksize; 77 - u32 st_blocks; 78 - u32 st_atime; 79 - u32 st_atime_nsec; 80 - u32 st_mtime; 81 - u32 st_mtime_nsec; 82 - u32 st_ctime; 83 - u32 st_ctime_nsec; 84 - u32 __unused4; 85 - u32 __unused5; 86 - }; 87 - 88 - struct compat_statfs { 89 - u32 f_type; 90 - u32 f_bsize; 91 - u32 f_blocks; 92 - u32 f_bfree; 93 - u32 f_bavail; 94 - u32 f_files; 95 - u32 f_ffree; 96 - compat_fsid_t f_fsid; 97 - u32 f_namelen; 98 - u32 f_frsize; 99 - u32 f_flags; 100 - u32 f_spare[4]; 101 - }; 102 - 103 - struct compat_statfs64 { 104 - u32 f_type; 105 - u32 f_bsize; 106 - u64 f_blocks; 107 - u64 f_bfree; 108 - u64 f_bavail; 109 - u64 f_files; 110 - u64 f_ffree; 111 - compat_fsid_t f_fsid; 112 - u32 f_namelen; 113 - u32 f_frsize; 114 - u32 f_flags; 115 - u32 f_spare[5]; 116 - }; 117 - 118 - /* 119 - * A pointer passed in from user mode. This should not 120 - * be used for syscall parameters, just declare them 121 - * as pointers because the syscall entry code will have 122 - * appropriately converted them already. 123 - */ 124 - 125 - static inline void __user *compat_ptr(compat_uptr_t uptr) 126 - { 127 - return (void __user *)(unsigned long)(uptr & 0x7fffffffUL); 128 - } 129 - #define compat_ptr(uptr) compat_ptr(uptr) 130 - 131 - #ifdef CONFIG_COMPAT 132 - 133 - static inline int is_compat_task(void) 134 - { 135 - return test_thread_flag(TIF_31BIT); 136 - } 137 - 138 - #endif 139 - 140 - #endif /* _ASM_S390X_COMPAT_H */
+7 -40
arch/s390/include/asm/elf.h
··· 162 162 * ELF register definitions.. 163 163 */ 164 164 165 - #include <linux/compat.h> 166 - 167 165 #include <asm/ptrace.h> 168 166 #include <asm/syscall.h> 169 167 #include <asm/user.h> 170 168 171 169 typedef s390_fp_regs elf_fpregset_t; 172 170 typedef s390_regs elf_gregset_t; 173 - 174 - typedef s390_fp_regs compat_elf_fpregset_t; 175 - typedef s390_compat_regs compat_elf_gregset_t; 176 171 177 172 #include <linux/sched/mm.h> /* for task_struct */ 178 173 #include <asm/mmu_context.h> ··· 178 183 #define elf_check_arch(x) \ 179 184 (((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \ 180 185 && (x)->e_ident[EI_CLASS] == ELF_CLASS) 181 - #define compat_elf_check_arch(x) \ 182 - (((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \ 183 - && (x)->e_ident[EI_CLASS] == ELF_CLASS) 184 - #define compat_start_thread start_thread31 185 186 186 187 /* For SVR4/S390 the function pointer to be registered with `atexit` is 187 188 passed in R14. */ ··· 194 203 the loader. We need to make sure that it is out of the way of the program 195 204 that it will "exec", and that there is sufficient room for the brk. 64-bit 196 205 tasks are aligned to 4GB. */ 197 - #define ELF_ET_DYN_BASE (is_compat_task() ? \ 198 - (STACK_TOP / 3 * 2) : \ 199 - (STACK_TOP / 3 * 2) & ~((1UL << 32) - 1)) 206 + #define ELF_ET_DYN_BASE ((STACK_TOP / 3 * 2) & ~((1UL << 32) - 1)) 200 207 201 208 /* This yields a mask that user programs can use to figure out what 202 209 instruction set this CPU supports. */ ··· 213 224 extern char elf_platform[]; 214 225 #define ELF_PLATFORM (elf_platform) 215 226 216 - #ifndef CONFIG_COMPAT 217 227 #define SET_PERSONALITY(ex) \ 218 228 do { \ 219 229 set_personality(PER_LINUX | \ 220 230 (current->personality & (~PER_MASK))); \ 221 - current->thread.sys_call_table = sys_call_table; \ 222 231 } while (0) 223 - #else /* CONFIG_COMPAT */ 224 - #define SET_PERSONALITY(ex) \ 225 - do { \ 226 - if (personality(current->personality) != PER_LINUX32) \ 227 - set_personality(PER_LINUX | \ 228 - (current->personality & ~PER_MASK)); \ 229 - if ((ex).e_ident[EI_CLASS] == ELFCLASS32) { \ 230 - set_thread_flag(TIF_31BIT); \ 231 - current->thread.sys_call_table = \ 232 - sys_call_table_emu; \ 233 - } else { \ 234 - clear_thread_flag(TIF_31BIT); \ 235 - current->thread.sys_call_table = \ 236 - sys_call_table; \ 237 - } \ 238 - } while (0) 239 - #endif /* CONFIG_COMPAT */ 240 232 241 233 /* 242 234 * Cache aliasing on the latest machines calls for a mapping granularity 243 - * of 512KB for the anonymous mapping base. For 64-bit processes use a 244 - * 512KB alignment and a randomization of up to 1GB. For 31-bit processes 245 - * the virtual address space is limited, use no alignment and limit the 246 - * randomization to 8MB. 247 - * For the additional randomization of the program break use 32MB for 248 - * 64-bit and 8MB for 31-bit. 235 + * of 512KB for the anonymous mapping base. Use a 512KB alignment and a 236 + * randomization of up to 1GB. 237 + * For the additional randomization of the program break use 32MB. 249 238 */ 250 - #define BRK_RND_MASK (is_compat_task() ? 0x7ffUL : 0x1fffUL) 251 - #define MMAP_RND_MASK (is_compat_task() ? 0x7ffUL : 0x3ff80UL) 252 - #define MMAP_ALIGN_MASK (is_compat_task() ? 0 : 0x7fUL) 239 + #define BRK_RND_MASK (0x1fffUL) 240 + #define MMAP_RND_MASK (0x3ff80UL) 241 + #define MMAP_ALIGN_MASK (0x7fUL) 253 242 #define STACK_RND_MASK MMAP_RND_MASK 254 243 255 244 /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
+1 -18
arch/s390/include/asm/ftrace.h
··· 105 105 } 106 106 #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */ 107 107 108 - /* 109 - * Even though the system call numbers are identical for s390/s390x a 110 - * different system call table is used for compat tasks. This may lead 111 - * to e.g. incorrect or missing trace event sysfs files. 112 - * Therefore simply do not trace compat system calls at all. 113 - * See kernel/trace/trace_syscalls.c. 114 - */ 115 - #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS 116 - static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) 117 - { 118 - return is_compat_task(); 119 - } 120 - 121 108 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 122 109 static inline bool arch_syscall_match_sym_name(const char *sym, 123 110 const char *name) 124 111 { 125 - /* 126 - * Skip __s390_ and __s390x_ prefix - due to compat wrappers 127 - * and aliasing some symbols of 64 bit system call functions 128 - * may get the __s390_ prefix instead of the __s390x_ prefix. 129 - */ 112 + /* Skip the __s390x_ prefix. */ 130 113 return !strcmp(sym + 7, name) || !strcmp(sym + 8, name); 131 114 } 132 115
+3 -10
arch/s390/include/asm/processor.h
··· 119 119 unsigned long vdso_text_size(void); 120 120 unsigned long vdso_size(void); 121 121 122 - /* 123 - * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit. 124 - */ 125 - 126 - #define TASK_SIZE (test_thread_flag(TIF_31BIT) ? \ 127 - _REGION3_SIZE : TASK_SIZE_MAX) 128 - #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \ 129 - (_REGION3_SIZE >> 1) : (_REGION2_SIZE >> 1)) 122 + #define TASK_SIZE (TASK_SIZE_MAX) 123 + #define TASK_UNMAPPED_BASE (_REGION2_SIZE >> 1) 130 124 #define TASK_SIZE_MAX (-PAGE_SIZE) 131 125 132 126 #define VDSO_BASE (STACK_TOP + PAGE_SIZE) 133 - #define VDSO_LIMIT (test_thread_flag(TIF_31BIT) ? _REGION3_SIZE : _REGION2_SIZE) 127 + #define VDSO_LIMIT (_REGION2_SIZE) 134 128 #define STACK_TOP (VDSO_LIMIT - vdso_size() - PAGE_SIZE) 135 129 #define STACK_TOP_MAX (_REGION2_SIZE - vdso_size() - PAGE_SIZE) 136 130 ··· 175 181 unsigned long system_timer; /* task cputime in kernel space */ 176 182 unsigned long hardirq_timer; /* task cputime in hardirq context */ 177 183 unsigned long softirq_timer; /* task cputime in softirq context */ 178 - const sys_call_ptr_t *sys_call_table; /* system call table address */ 179 184 union teid gmap_teid; /* address and flags of last gmap fault */ 180 185 unsigned int gmap_int_code; /* int code of last gmap fault */ 181 186 int ufpu_flags; /* user fpu flags */
+1 -1
arch/s390/include/asm/ptrace.h
··· 102 102 typedef struct { 103 103 unsigned int mask; 104 104 unsigned int addr; 105 - } psw_t32 __aligned(8); 105 + } psw32_t __aligned(8); 106 106 107 107 #define PGM_INT_CODE_MASK 0x7f 108 108 #define PGM_INT_CODE_PER 0x80
-5
arch/s390/include/asm/seccomp.h
··· 19 19 #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_S390X 20 20 #define SECCOMP_ARCH_NATIVE_NR NR_syscalls 21 21 #define SECCOMP_ARCH_NATIVE_NAME "s390x" 22 - #ifdef CONFIG_COMPAT 23 - # define SECCOMP_ARCH_COMPAT AUDIT_ARCH_S390 24 - # define SECCOMP_ARCH_COMPAT_NR NR_syscalls 25 - # define SECCOMP_ARCH_COMPAT_NAME "s390" 26 - #endif 27 22 28 23 #endif /* _ASM_S390_SECCOMP_H */
+1 -18
arch/s390/include/asm/syscall.h
··· 15 15 #include <asm/ptrace.h> 16 16 17 17 extern const sys_call_ptr_t sys_call_table[]; 18 - extern const sys_call_ptr_t sys_call_table_emu[]; 19 18 20 19 static inline long syscall_get_nr(struct task_struct *task, 21 20 struct pt_regs *regs) ··· 45 46 struct pt_regs *regs) 46 47 { 47 48 unsigned long error = regs->gprs[2]; 48 - #ifdef CONFIG_COMPAT 49 - if (test_tsk_thread_flag(task, TIF_31BIT)) { 50 - /* 51 - * Sign-extend the value so (int)-EFOO becomes (long)-EFOO 52 - * and will match correctly in comparisons. 53 - */ 54 - error = (long)(int)error; 55 - } 56 - #endif 49 + 57 50 return IS_ERR_VALUE(error) ? error : 0; 58 51 } 59 52 ··· 69 78 { 70 79 unsigned long mask = -1UL; 71 80 72 - #ifdef CONFIG_COMPAT 73 - if (test_tsk_thread_flag(task, TIF_31BIT)) 74 - mask = 0xffffffff; 75 - #endif 76 81 for (int i = 1; i < 6; i++) 77 82 args[i] = regs->gprs[2 + i] & mask; 78 83 ··· 86 99 87 100 static inline int syscall_get_arch(struct task_struct *task) 88 101 { 89 - #ifdef CONFIG_COMPAT 90 - if (test_tsk_thread_flag(task, TIF_31BIT)) 91 - return AUDIT_ARCH_S390; 92 - #endif 93 102 return AUDIT_ARCH_S390X; 94 103 } 95 104
+2 -93
arch/s390/include/asm/syscall_wrapper.h
··· 13 13 ,, regs->orig_gpr2,, regs->gprs[3],, regs->gprs[4] \ 14 14 ,, regs->gprs[5],, regs->gprs[6],, regs->gprs[7]) 15 15 16 - #ifdef CONFIG_COMPAT 17 - 18 - #define __SC_COMPAT_CAST(t, a) \ 19 - ({ \ 20 - long __ReS = a; \ 21 - \ 22 - BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) && \ 23 - !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t) && \ 24 - !__TYPE_IS_LL(t)); \ 25 - if (__TYPE_IS_L(t)) \ 26 - __ReS = (s32)a; \ 27 - if (__TYPE_IS_UL(t)) \ 28 - __ReS = (u32)a; \ 29 - if (__TYPE_IS_PTR(t)) \ 30 - __ReS = a & 0x7fffffff; \ 31 - if (__TYPE_IS_LL(t)) \ 32 - return -ENOSYS; \ 33 - (t)__ReS; \ 34 - }) 35 - 36 - /* 37 - * To keep the naming coherent, re-define SYSCALL_DEFINE0 to create an alias 38 - * named __s390x_sys_*() 39 - */ 40 - #define COMPAT_SYSCALL_DEFINE0(sname) \ 41 - long __s390_compat_sys_##sname(void); \ 42 - ALLOW_ERROR_INJECTION(__s390_compat_sys_##sname, ERRNO); \ 43 - long __s390_compat_sys_##sname(void) 44 - 45 16 #define SYSCALL_DEFINE0(sname) \ 46 17 SYSCALL_METADATA(_##sname, 0); \ 47 - long __s390_sys_##sname(void); \ 48 - ALLOW_ERROR_INJECTION(__s390_sys_##sname, ERRNO); \ 49 - long __s390x_sys_##sname(void); \ 18 + long __s390x_sys_##sname(struct pt_regs *__unused); \ 50 19 ALLOW_ERROR_INJECTION(__s390x_sys_##sname, ERRNO); \ 51 20 static inline long __do_sys_##sname(void); \ 52 - long __s390_sys_##sname(void) \ 53 - { \ 54 - return __do_sys_##sname(); \ 55 - } \ 56 - long __s390x_sys_##sname(void) \ 57 - { \ 58 - return __do_sys_##sname(); \ 59 - } \ 60 - static inline long __do_sys_##sname(void) 61 - 62 - #define COND_SYSCALL(name) \ 63 - cond_syscall(__s390x_sys_##name); \ 64 - cond_syscall(__s390_sys_##name) 65 - 66 - #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ 67 - long __s390_compat_sys##name(struct pt_regs *regs); \ 68 - ALLOW_ERROR_INJECTION(__s390_compat_sys##name, ERRNO); \ 69 - static inline long __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)); \ 70 - static inline long __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__)); \ 71 - long __s390_compat_sys##name(struct pt_regs *regs) \ 72 - { \ 73 - return __se_compat_sys##name(SC_S390_REGS_TO_ARGS(x, __VA_ARGS__)); \ 74 - } \ 75 - static inline long __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)) \ 76 - { \ 77 - __MAP(x, __SC_TEST, __VA_ARGS__); \ 78 - return __do_compat_sys##name(__MAP(x, __SC_DELOUSE, __VA_ARGS__)); \ 79 - } \ 80 - static inline long __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__)) 81 - 82 - /* 83 - * As some compat syscalls may not be implemented, we need to expand 84 - * COND_SYSCALL_COMPAT in kernel/sys_ni.c to cover this case as well. 85 - */ 86 - #define COND_SYSCALL_COMPAT(name) \ 87 - cond_syscall(__s390_compat_sys_##name) 88 - 89 - #define __S390_SYS_STUBx(x, name, ...) \ 90 - long __s390_sys##name(struct pt_regs *regs); \ 91 - ALLOW_ERROR_INJECTION(__s390_sys##name, ERRNO); \ 92 - static inline long ___se_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)); \ 93 - long __s390_sys##name(struct pt_regs *regs) \ 94 - { \ 95 - return ___se_sys##name(SC_S390_REGS_TO_ARGS(x, __VA_ARGS__)); \ 96 - } \ 97 - static inline long ___se_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)) \ 98 - { \ 99 - __MAP(x, __SC_TEST, __VA_ARGS__); \ 100 - return __do_sys##name(__MAP(x, __SC_COMPAT_CAST, __VA_ARGS__)); \ 101 - } 102 - 103 - #else /* CONFIG_COMPAT */ 104 - 105 - #define SYSCALL_DEFINE0(sname) \ 106 - SYSCALL_METADATA(_##sname, 0); \ 107 - long __s390x_sys_##sname(void); \ 108 - ALLOW_ERROR_INJECTION(__s390x_sys_##sname, ERRNO); \ 109 - static inline long __do_sys_##sname(void); \ 110 - long __s390x_sys_##sname(void) \ 21 + long __s390x_sys_##sname(struct pt_regs *__unused) \ 111 22 { \ 112 23 return __do_sys_##sname(); \ 113 24 } \ ··· 28 117 cond_syscall(__s390x_sys_##name) 29 118 30 119 #define __S390_SYS_STUBx(x, fullname, name, ...) 31 - 32 - #endif /* CONFIG_COMPAT */ 33 120 34 121 #define __SYSCALL_DEFINEx(x, name, ...) \ 35 122 long __s390x_sys##name(struct pt_regs *regs); \
-2
arch/s390/include/asm/thread_info.h
··· 69 69 #define TIF_GUARDED_STORAGE 17 /* load guarded storage control block */ 70 70 #define TIF_ISOLATE_BP_GUEST 18 /* Run KVM guests with isolated BP */ 71 71 #define TIF_PER_TRAP 19 /* Need to handle PER trap on exit to usermode */ 72 - #define TIF_31BIT 20 /* 32bit process */ 73 72 #define TIF_SINGLE_STEP 21 /* This task is single stepped */ 74 73 #define TIF_BLOCK_STEP 22 /* This task is block stepped */ 75 74 #define TIF_UPROBE_SINGLESTEP 23 /* This task is uprobe single stepped */ ··· 77 78 #define _TIF_GUARDED_STORAGE BIT(TIF_GUARDED_STORAGE) 78 79 #define _TIF_ISOLATE_BP_GUEST BIT(TIF_ISOLATE_BP_GUEST) 79 80 #define _TIF_PER_TRAP BIT(TIF_PER_TRAP) 80 - #define _TIF_31BIT BIT(TIF_31BIT) 81 81 #define _TIF_SINGLE_STEP BIT(TIF_SINGLE_STEP) 82 82 #define _TIF_BLOCK_STEP BIT(TIF_BLOCK_STEP) 83 83 #define _TIF_UPROBE_SINGLESTEP BIT(TIF_UPROBE_SINGLESTEP)
+2 -6
arch/s390/include/asm/unistd.h
··· 8 8 #define _ASM_S390_UNISTD_H_ 9 9 10 10 #include <uapi/asm/unistd.h> 11 - #include <asm/unistd_nr.h> 11 + 12 + #define NR_syscalls (__NR_syscalls) 12 13 13 14 #define __ARCH_WANT_NEW_STAT 14 15 #define __ARCH_WANT_OLD_READDIR ··· 28 27 #define __ARCH_WANT_SYS_OLDUMOUNT 29 28 #define __ARCH_WANT_SYS_SIGPENDING 30 29 #define __ARCH_WANT_SYS_SIGPROCMASK 31 - # ifdef CONFIG_COMPAT 32 - # define __ARCH_WANT_COMPAT_STAT 33 - # define __ARCH_WANT_SYS_TIME32 34 - # define __ARCH_WANT_SYS_UTIME32 35 - # endif 36 30 #define __ARCH_WANT_SYS_FORK 37 31 #define __ARCH_WANT_SYS_VFORK 38 32 #define __ARCH_WANT_SYS_CLONE
-8
arch/s390/include/asm/vdso-symbols.h
··· 3 3 #define __S390_VDSO_SYMBOLS_H__ 4 4 5 5 #include <generated/vdso64-offsets.h> 6 - #ifdef CONFIG_COMPAT 7 - #include <generated/vdso32-offsets.h> 8 - #endif 9 6 10 7 #define VDSO64_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso64_offset_##name)) 11 - #ifdef CONFIG_COMPAT 12 - #define VDSO32_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso32_offset_##name)) 13 - #else 14 - #define VDSO32_SYMBOL(tsk, name) (-1UL) 15 - #endif 16 8 17 9 #endif /* __S390_VDSO_SYMBOLS_H__ */
-4
arch/s390/include/uapi/asm/bitsperlong.h
··· 2 2 #ifndef __ASM_S390_BITSPERLONG_H 3 3 #define __ASM_S390_BITSPERLONG_H 4 4 5 - #ifndef __s390x__ 6 - #define __BITS_PER_LONG 32 7 - #else 8 5 #define __BITS_PER_LONG 64 9 - #endif 10 6 11 7 #include <asm-generic/bitsperlong.h> 12 8
-3
arch/s390/include/uapi/asm/ipcbuf.h
··· 24 24 __kernel_mode_t mode; 25 25 unsigned short __pad1; 26 26 unsigned short seq; 27 - #ifndef __s390x__ 28 - unsigned short __pad2; 29 - #endif /* ! __s390x__ */ 30 27 unsigned long __unused1; 31 28 unsigned long __unused2; 32 29 };
-13
arch/s390/include/uapi/asm/posix_types.h
··· 26 26 #define __kernel_old_uid_t __kernel_old_uid_t 27 27 #endif 28 28 29 - #ifndef __s390x__ 30 - 31 - typedef unsigned long __kernel_ino_t; 32 - typedef unsigned short __kernel_mode_t; 33 - typedef unsigned short __kernel_ipc_pid_t; 34 - typedef unsigned short __kernel_uid_t; 35 - typedef unsigned short __kernel_gid_t; 36 - typedef int __kernel_ptrdiff_t; 37 - 38 - #else /* __s390x__ */ 39 - 40 29 typedef unsigned int __kernel_ino_t; 41 30 typedef unsigned int __kernel_mode_t; 42 31 typedef int __kernel_ipc_pid_t; ··· 33 44 typedef unsigned int __kernel_gid_t; 34 45 typedef long __kernel_ptrdiff_t; 35 46 typedef unsigned long __kernel_sigset_t; /* at least 32 bits */ 36 - 37 - #endif /* __s390x__ */ 38 47 39 48 #define __kernel_ino_t __kernel_ino_t 40 49 #define __kernel_mode_t __kernel_mode_t
-124
arch/s390/include/uapi/asm/ptrace.h
··· 14 14 * Offsets in the user_regs_struct. They are used for the ptrace 15 15 * system call and in entry.S 16 16 */ 17 - #ifndef __s390x__ 18 - 19 - #define PT_PSWMASK 0x00 20 - #define PT_PSWADDR 0x04 21 - #define PT_GPR0 0x08 22 - #define PT_GPR1 0x0C 23 - #define PT_GPR2 0x10 24 - #define PT_GPR3 0x14 25 - #define PT_GPR4 0x18 26 - #define PT_GPR5 0x1C 27 - #define PT_GPR6 0x20 28 - #define PT_GPR7 0x24 29 - #define PT_GPR8 0x28 30 - #define PT_GPR9 0x2C 31 - #define PT_GPR10 0x30 32 - #define PT_GPR11 0x34 33 - #define PT_GPR12 0x38 34 - #define PT_GPR13 0x3C 35 - #define PT_GPR14 0x40 36 - #define PT_GPR15 0x44 37 - #define PT_ACR0 0x48 38 - #define PT_ACR1 0x4C 39 - #define PT_ACR2 0x50 40 - #define PT_ACR3 0x54 41 - #define PT_ACR4 0x58 42 - #define PT_ACR5 0x5C 43 - #define PT_ACR6 0x60 44 - #define PT_ACR7 0x64 45 - #define PT_ACR8 0x68 46 - #define PT_ACR9 0x6C 47 - #define PT_ACR10 0x70 48 - #define PT_ACR11 0x74 49 - #define PT_ACR12 0x78 50 - #define PT_ACR13 0x7C 51 - #define PT_ACR14 0x80 52 - #define PT_ACR15 0x84 53 - #define PT_ORIGGPR2 0x88 54 - #define PT_FPC 0x90 55 - /* 56 - * A nasty fact of life that the ptrace api 57 - * only supports passing of longs. 58 - */ 59 - #define PT_FPR0_HI 0x98 60 - #define PT_FPR0_LO 0x9C 61 - #define PT_FPR1_HI 0xA0 62 - #define PT_FPR1_LO 0xA4 63 - #define PT_FPR2_HI 0xA8 64 - #define PT_FPR2_LO 0xAC 65 - #define PT_FPR3_HI 0xB0 66 - #define PT_FPR3_LO 0xB4 67 - #define PT_FPR4_HI 0xB8 68 - #define PT_FPR4_LO 0xBC 69 - #define PT_FPR5_HI 0xC0 70 - #define PT_FPR5_LO 0xC4 71 - #define PT_FPR6_HI 0xC8 72 - #define PT_FPR6_LO 0xCC 73 - #define PT_FPR7_HI 0xD0 74 - #define PT_FPR7_LO 0xD4 75 - #define PT_FPR8_HI 0xD8 76 - #define PT_FPR8_LO 0XDC 77 - #define PT_FPR9_HI 0xE0 78 - #define PT_FPR9_LO 0xE4 79 - #define PT_FPR10_HI 0xE8 80 - #define PT_FPR10_LO 0xEC 81 - #define PT_FPR11_HI 0xF0 82 - #define PT_FPR11_LO 0xF4 83 - #define PT_FPR12_HI 0xF8 84 - #define PT_FPR12_LO 0xFC 85 - #define PT_FPR13_HI 0x100 86 - #define PT_FPR13_LO 0x104 87 - #define PT_FPR14_HI 0x108 88 - #define PT_FPR14_LO 0x10C 89 - #define PT_FPR15_HI 0x110 90 - #define PT_FPR15_LO 0x114 91 - #define PT_CR_9 0x118 92 - #define PT_CR_10 0x11C 93 - #define PT_CR_11 0x120 94 - #define PT_IEEE_IP 0x13C 95 - #define PT_LASTOFF PT_IEEE_IP 96 - #define PT_ENDREGS 0x140-1 97 - 98 - #define GPR_SIZE 4 99 - #define CR_SIZE 4 100 - 101 - #define STACK_FRAME_OVERHEAD 96 /* size of minimum stack frame */ 102 - 103 - #else /* __s390x__ */ 104 - 105 17 #define PT_PSWMASK 0x00 106 18 #define PT_PSWADDR 0x08 107 19 #define PT_GPR0 0x10 ··· 78 166 79 167 #define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */ 80 168 81 - #endif /* __s390x__ */ 82 - 83 - #ifndef __s390x__ 84 - 85 - #define PSW_MASK_PER _AC(0x40000000, UL) 86 - #define PSW_MASK_DAT _AC(0x04000000, UL) 87 - #define PSW_MASK_IO _AC(0x02000000, UL) 88 - #define PSW_MASK_EXT _AC(0x01000000, UL) 89 - #define PSW_MASK_KEY _AC(0x00F00000, UL) 90 - #define PSW_MASK_BASE _AC(0x00080000, UL) /* always one */ 91 - #define PSW_MASK_MCHECK _AC(0x00040000, UL) 92 - #define PSW_MASK_WAIT _AC(0x00020000, UL) 93 - #define PSW_MASK_PSTATE _AC(0x00010000, UL) 94 - #define PSW_MASK_ASC _AC(0x0000C000, UL) 95 - #define PSW_MASK_CC _AC(0x00003000, UL) 96 - #define PSW_MASK_PM _AC(0x00000F00, UL) 97 - #define PSW_MASK_RI _AC(0x00000000, UL) 98 - #define PSW_MASK_EA _AC(0x00000000, UL) 99 - #define PSW_MASK_BA _AC(0x00000000, UL) 100 - 101 - #define PSW_MASK_USER _AC(0x0000FF00, UL) 102 - 103 - #define PSW_ADDR_AMODE _AC(0x80000000, UL) 104 - #define PSW_ADDR_INSN _AC(0x7FFFFFFF, UL) 105 - 106 - #define PSW_ASC_PRIMARY _AC(0x00000000, UL) 107 - #define PSW_ASC_ACCREG _AC(0x00004000, UL) 108 - #define PSW_ASC_SECONDARY _AC(0x00008000, UL) 109 - #define PSW_ASC_HOME _AC(0x0000C000, UL) 110 - 111 - #else /* __s390x__ */ 112 - 113 169 #define PSW_MASK_PER _AC(0x4000000000000000, UL) 114 170 #define PSW_MASK_DAT _AC(0x0400000000000000, UL) 115 171 #define PSW_MASK_IO _AC(0x0200000000000000, UL) ··· 103 223 #define PSW_ASC_ACCREG _AC(0x0000400000000000, UL) 104 224 #define PSW_ASC_SECONDARY _AC(0x0000800000000000, UL) 105 225 #define PSW_ASC_HOME _AC(0x0000C00000000000, UL) 106 - 107 - #endif /* __s390x__ */ 108 226 109 227 #define NUM_GPRS 16 110 228 #define NUM_FPRS 16 ··· 186 308 #define PER_EM_MASK 0xE8000000UL 187 309 188 310 typedef struct { 189 - #ifdef __s390x__ 190 311 unsigned : 32; 191 - #endif /* __s390x__ */ 192 312 unsigned em_branching : 1; 193 313 unsigned em_instruction_fetch : 1; 194 314 /*
-15
arch/s390/include/uapi/asm/sigcontext.h
··· 17 17 #define __NUM_VXRS_LOW 16 18 18 #define __NUM_VXRS_HIGH 16 19 19 20 - #ifndef __s390x__ 21 - 22 - /* Has to be at least _NSIG_WORDS from asm/signal.h */ 23 - #define _SIGCONTEXT_NSIG 64 24 - #define _SIGCONTEXT_NSIG_BPW 32 25 - /* Size of stack frame allocated when calling signal handler. */ 26 - #define __SIGNAL_FRAMESIZE 96 27 - 28 - #else /* __s390x__ */ 29 - 30 20 /* Has to be at least _NSIG_WORDS from asm/signal.h */ 31 21 #define _SIGCONTEXT_NSIG 64 32 22 #define _SIGCONTEXT_NSIG_BPW 64 33 23 /* Size of stack frame allocated when calling signal handler. */ 34 24 #define __SIGNAL_FRAMESIZE 160 35 - 36 - #endif /* __s390x__ */ 37 25 38 26 #define _SIGCONTEXT_NSIG_WORDS (_SIGCONTEXT_NSIG / _SIGCONTEXT_NSIG_BPW) 39 27 #define _SIGMASK_COPY_SIZE (sizeof(unsigned long)*_SIGCONTEXT_NSIG_WORDS) ··· 54 66 55 67 typedef struct 56 68 { 57 - #ifndef __s390x__ 58 - unsigned long gprs_high[__NUM_GPRS]; 59 - #endif 60 69 unsigned long long vxrs_low[__NUM_VXRS_LOW]; 61 70 __vector128 vxrs_high[__NUM_VXRS_HIGH]; 62 71 unsigned char __reserved[128];
-70
arch/s390/include/uapi/asm/stat.h
··· 8 8 #ifndef _S390_STAT_H 9 9 #define _S390_STAT_H 10 10 11 - #ifndef __s390x__ 12 - struct __old_kernel_stat { 13 - unsigned short st_dev; 14 - unsigned short st_ino; 15 - unsigned short st_mode; 16 - unsigned short st_nlink; 17 - unsigned short st_uid; 18 - unsigned short st_gid; 19 - unsigned short st_rdev; 20 - unsigned long st_size; 21 - unsigned long st_atime; 22 - unsigned long st_mtime; 23 - unsigned long st_ctime; 24 - }; 25 - 26 - struct stat { 27 - unsigned short st_dev; 28 - unsigned short __pad1; 29 - unsigned long st_ino; 30 - unsigned short st_mode; 31 - unsigned short st_nlink; 32 - unsigned short st_uid; 33 - unsigned short st_gid; 34 - unsigned short st_rdev; 35 - unsigned short __pad2; 36 - unsigned long st_size; 37 - unsigned long st_blksize; 38 - unsigned long st_blocks; 39 - unsigned long st_atime; 40 - unsigned long st_atime_nsec; 41 - unsigned long st_mtime; 42 - unsigned long st_mtime_nsec; 43 - unsigned long st_ctime; 44 - unsigned long st_ctime_nsec; 45 - unsigned long __unused4; 46 - unsigned long __unused5; 47 - }; 48 - 49 - /* This matches struct stat64 in glibc2.1, hence the absolutely 50 - * insane amounts of padding around dev_t's. 51 - */ 52 - struct stat64 { 53 - unsigned long long st_dev; 54 - unsigned int __pad1; 55 - #define STAT64_HAS_BROKEN_ST_INO 1 56 - unsigned long __st_ino; 57 - unsigned int st_mode; 58 - unsigned int st_nlink; 59 - unsigned long st_uid; 60 - unsigned long st_gid; 61 - unsigned long long st_rdev; 62 - unsigned int __pad3; 63 - long long st_size; 64 - unsigned long st_blksize; 65 - unsigned char __pad4[4]; 66 - unsigned long __pad5; /* future possible st_blocks high bits */ 67 - unsigned long st_blocks; /* Number 512-byte blocks allocated. */ 68 - unsigned long st_atime; 69 - unsigned long st_atime_nsec; 70 - unsigned long st_mtime; 71 - unsigned long st_mtime_nsec; 72 - unsigned long st_ctime; 73 - unsigned long st_ctime_nsec; /* will be high 32 bits of ctime someday */ 74 - unsigned long long st_ino; 75 - }; 76 - 77 - #else /* __s390x__ */ 78 - 79 11 struct stat { 80 12 unsigned long st_dev; 81 13 unsigned long st_ino; ··· 28 96 long st_blocks; 29 97 unsigned long __unused[3]; 30 98 }; 31 - 32 - #endif /* __s390x__ */ 33 99 34 100 #define STAT_HAVE_NSEC 1 35 101
-4
arch/s390/include/uapi/asm/unistd.h
··· 8 8 #ifndef _UAPI_ASM_S390_UNISTD_H_ 9 9 #define _UAPI_ASM_S390_UNISTD_H_ 10 10 11 - #ifdef __s390x__ 12 11 #include <asm/unistd_64.h> 13 - #else 14 - #include <asm/unistd_32.h> 15 - #endif 16 12 17 13 #endif /* _UAPI_ASM_S390_UNISTD_H_ */
-4
arch/s390/kernel/Makefile
··· 56 56 obj-$(CONFIG_SCHED_TOPOLOGY) += topology.o hiperdispatch.o 57 57 obj-$(CONFIG_NUMA) += numa.o 58 58 obj-$(CONFIG_AUDIT) += audit.o 59 - compat-obj-$(CONFIG_AUDIT) += compat_audit.o 60 - obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o 61 - obj-$(CONFIG_COMPAT) += $(compat-obj-y) 62 59 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 63 60 obj-$(CONFIG_KPROBES) += kprobes.o 64 61 obj-$(CONFIG_KPROBES) += mcount.o ··· 82 85 83 86 # vdso 84 87 obj-y += vdso64/ 85 - obj-$(CONFIG_COMPAT) += vdso32/
-16
arch/s390/kernel/audit.c
··· 3 3 #include <linux/types.h> 4 4 #include <linux/audit.h> 5 5 #include <asm/unistd.h> 6 - #include "audit.h" 7 6 8 7 static unsigned dir_class[] = { 9 8 #include <asm-generic/audit_dir_write.h> ··· 31 32 32 33 int audit_classify_arch(int arch) 33 34 { 34 - #ifdef CONFIG_COMPAT 35 - if (arch == AUDIT_ARCH_S390) 36 - return 1; 37 - #endif 38 35 return 0; 39 36 } 40 37 41 38 int audit_classify_syscall(int abi, unsigned syscall) 42 39 { 43 - #ifdef CONFIG_COMPAT 44 - if (abi == AUDIT_ARCH_S390) 45 - return s390_classify_syscall(syscall); 46 - #endif 47 40 switch(syscall) { 48 41 case __NR_open: 49 42 return AUDITSC_OPEN; ··· 54 63 55 64 static int __init audit_classes_init(void) 56 65 { 57 - #ifdef CONFIG_COMPAT 58 - audit_register_class(AUDIT_CLASS_WRITE_32, s390_write_class); 59 - audit_register_class(AUDIT_CLASS_READ_32, s390_read_class); 60 - audit_register_class(AUDIT_CLASS_DIR_WRITE_32, s390_dir_class); 61 - audit_register_class(AUDIT_CLASS_CHATTR_32, s390_chattr_class); 62 - audit_register_class(AUDIT_CLASS_SIGNAL_32, s390_signal_class); 63 - #endif 64 66 audit_register_class(AUDIT_CLASS_WRITE, write_class); 65 67 audit_register_class(AUDIT_CLASS_READ, read_class); 66 68 audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class);
-16
arch/s390/kernel/audit.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __ARCH_S390_KERNEL_AUDIT_H 3 - #define __ARCH_S390_KERNEL_AUDIT_H 4 - 5 - #include <linux/types.h> 6 - 7 - #ifdef CONFIG_COMPAT 8 - extern int s390_classify_syscall(unsigned); 9 - extern __u32 s390_dir_class[]; 10 - extern __u32 s390_write_class[]; 11 - extern __u32 s390_read_class[]; 12 - extern __u32 s390_chattr_class[]; 13 - extern __u32 s390_signal_class[]; 14 - #endif /* CONFIG_COMPAT */ 15 - 16 - #endif /* __ARCH_S390_KERNEL_AUDIT_H */
-48
arch/s390/kernel/compat_audit.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #undef __s390x__ 3 - #include <linux/audit_arch.h> 4 - #include <asm/unistd.h> 5 - #include "audit.h" 6 - 7 - unsigned s390_dir_class[] = { 8 - #include <asm-generic/audit_dir_write.h> 9 - ~0U 10 - }; 11 - 12 - unsigned s390_chattr_class[] = { 13 - #include <asm-generic/audit_change_attr.h> 14 - ~0U 15 - }; 16 - 17 - unsigned s390_write_class[] = { 18 - #include <asm-generic/audit_write.h> 19 - ~0U 20 - }; 21 - 22 - unsigned s390_read_class[] = { 23 - #include <asm-generic/audit_read.h> 24 - ~0U 25 - }; 26 - 27 - unsigned s390_signal_class[] = { 28 - #include <asm-generic/audit_signal.h> 29 - ~0U 30 - }; 31 - 32 - int s390_classify_syscall(unsigned syscall) 33 - { 34 - switch(syscall) { 35 - case __NR_open: 36 - return AUDITSC_OPEN; 37 - case __NR_openat: 38 - return AUDITSC_OPENAT; 39 - case __NR_socketcall: 40 - return AUDITSC_SOCKETCALL; 41 - case __NR_execve: 42 - return AUDITSC_EXECVE; 43 - case __NR_openat2: 44 - return AUDITSC_OPENAT2; 45 - default: 46 - return AUDITSC_COMPAT; 47 - } 48 - }
-289
arch/s390/kernel/compat_linux.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * S390 version 4 - * Copyright IBM Corp. 2000 5 - * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 6 - * Gerhard Tonn (ton@de.ibm.com) 7 - * Thomas Spatzier (tspat@de.ibm.com) 8 - * 9 - * Conversion between 31bit and 64bit native syscalls. 10 - * 11 - * Heavily inspired by the 32-bit Sparc compat code which is 12 - * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 13 - * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 14 - * 15 - */ 16 - 17 - 18 - #include <linux/kernel.h> 19 - #include <linux/sched.h> 20 - #include <linux/fs.h> 21 - #include <linux/mm.h> 22 - #include <linux/file.h> 23 - #include <linux/signal.h> 24 - #include <linux/resource.h> 25 - #include <linux/times.h> 26 - #include <linux/smp.h> 27 - #include <linux/sem.h> 28 - #include <linux/msg.h> 29 - #include <linux/shm.h> 30 - #include <linux/uio.h> 31 - #include <linux/quota.h> 32 - #include <linux/poll.h> 33 - #include <linux/personality.h> 34 - #include <linux/stat.h> 35 - #include <linux/filter.h> 36 - #include <linux/highmem.h> 37 - #include <linux/mman.h> 38 - #include <linux/ipv6.h> 39 - #include <linux/in.h> 40 - #include <linux/icmpv6.h> 41 - #include <linux/syscalls.h> 42 - #include <linux/sysctl.h> 43 - #include <linux/binfmts.h> 44 - #include <linux/capability.h> 45 - #include <linux/compat.h> 46 - #include <linux/vfs.h> 47 - #include <linux/ptrace.h> 48 - #include <linux/fadvise.h> 49 - #include <linux/ipc.h> 50 - #include <linux/slab.h> 51 - 52 - #include <asm/types.h> 53 - #include <linux/uaccess.h> 54 - 55 - #include <net/scm.h> 56 - #include <net/sock.h> 57 - 58 - #include "compat_linux.h" 59 - 60 - #ifdef CONFIG_SYSVIPC 61 - COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, compat_ulong_t, second, 62 - compat_ulong_t, third, compat_uptr_t, ptr) 63 - { 64 - if (call >> 16) /* hack for backward compatibility */ 65 - return -EINVAL; 66 - return compat_ksys_ipc(call, first, second, third, ptr, third); 67 - } 68 - #endif 69 - 70 - COMPAT_SYSCALL_DEFINE3(s390_truncate64, const char __user *, path, u32, high, u32, low) 71 - { 72 - return ksys_truncate(path, (unsigned long)high << 32 | low); 73 - } 74 - 75 - COMPAT_SYSCALL_DEFINE3(s390_ftruncate64, unsigned int, fd, u32, high, u32, low) 76 - { 77 - return ksys_ftruncate(fd, (unsigned long)high << 32 | low); 78 - } 79 - 80 - COMPAT_SYSCALL_DEFINE5(s390_pread64, unsigned int, fd, char __user *, ubuf, 81 - compat_size_t, count, u32, high, u32, low) 82 - { 83 - if ((compat_ssize_t) count < 0) 84 - return -EINVAL; 85 - return ksys_pread64(fd, ubuf, count, (unsigned long)high << 32 | low); 86 - } 87 - 88 - COMPAT_SYSCALL_DEFINE5(s390_pwrite64, unsigned int, fd, const char __user *, ubuf, 89 - compat_size_t, count, u32, high, u32, low) 90 - { 91 - if ((compat_ssize_t) count < 0) 92 - return -EINVAL; 93 - return ksys_pwrite64(fd, ubuf, count, (unsigned long)high << 32 | low); 94 - } 95 - 96 - COMPAT_SYSCALL_DEFINE4(s390_readahead, int, fd, u32, high, u32, low, s32, count) 97 - { 98 - return ksys_readahead(fd, (unsigned long)high << 32 | low, count); 99 - } 100 - 101 - struct stat64_emu31 { 102 - unsigned long long st_dev; 103 - unsigned int __pad1; 104 - #define STAT64_HAS_BROKEN_ST_INO 1 105 - u32 __st_ino; 106 - unsigned int st_mode; 107 - unsigned int st_nlink; 108 - u32 st_uid; 109 - u32 st_gid; 110 - unsigned long long st_rdev; 111 - unsigned int __pad3; 112 - long st_size; 113 - u32 st_blksize; 114 - unsigned char __pad4[4]; 115 - u32 __pad5; /* future possible st_blocks high bits */ 116 - u32 st_blocks; /* Number 512-byte blocks allocated. */ 117 - u32 st_atime; 118 - u32 __pad6; 119 - u32 st_mtime; 120 - u32 __pad7; 121 - u32 st_ctime; 122 - u32 __pad8; /* will be high 32 bits of ctime someday */ 123 - unsigned long st_ino; 124 - }; 125 - 126 - static int cp_stat64(struct stat64_emu31 __user *ubuf, struct kstat *stat) 127 - { 128 - struct stat64_emu31 tmp; 129 - 130 - memset(&tmp, 0, sizeof(tmp)); 131 - 132 - tmp.st_dev = huge_encode_dev(stat->dev); 133 - tmp.st_ino = stat->ino; 134 - tmp.__st_ino = (u32)stat->ino; 135 - tmp.st_mode = stat->mode; 136 - tmp.st_nlink = (unsigned int)stat->nlink; 137 - tmp.st_uid = from_kuid_munged(current_user_ns(), stat->uid); 138 - tmp.st_gid = from_kgid_munged(current_user_ns(), stat->gid); 139 - tmp.st_rdev = huge_encode_dev(stat->rdev); 140 - tmp.st_size = stat->size; 141 - tmp.st_blksize = (u32)stat->blksize; 142 - tmp.st_blocks = (u32)stat->blocks; 143 - tmp.st_atime = (u32)stat->atime.tv_sec; 144 - tmp.st_mtime = (u32)stat->mtime.tv_sec; 145 - tmp.st_ctime = (u32)stat->ctime.tv_sec; 146 - 147 - return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 148 - } 149 - 150 - COMPAT_SYSCALL_DEFINE2(s390_stat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf) 151 - { 152 - struct kstat stat; 153 - int ret = vfs_stat(filename, &stat); 154 - if (!ret) 155 - ret = cp_stat64(statbuf, &stat); 156 - return ret; 157 - } 158 - 159 - COMPAT_SYSCALL_DEFINE2(s390_lstat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf) 160 - { 161 - struct kstat stat; 162 - int ret = vfs_lstat(filename, &stat); 163 - if (!ret) 164 - ret = cp_stat64(statbuf, &stat); 165 - return ret; 166 - } 167 - 168 - COMPAT_SYSCALL_DEFINE2(s390_fstat64, unsigned int, fd, struct stat64_emu31 __user *, statbuf) 169 - { 170 - struct kstat stat; 171 - int ret = vfs_fstat(fd, &stat); 172 - if (!ret) 173 - ret = cp_stat64(statbuf, &stat); 174 - return ret; 175 - } 176 - 177 - COMPAT_SYSCALL_DEFINE4(s390_fstatat64, unsigned int, dfd, const char __user *, filename, 178 - struct stat64_emu31 __user *, statbuf, int, flag) 179 - { 180 - struct kstat stat; 181 - int error; 182 - 183 - error = vfs_fstatat(dfd, filename, &stat, flag); 184 - if (error) 185 - return error; 186 - return cp_stat64(statbuf, &stat); 187 - } 188 - 189 - /* 190 - * Linux/i386 didn't use to be able to handle more than 191 - * 4 system call parameters, so these system calls used a memory 192 - * block for parameter passing.. 193 - */ 194 - 195 - struct mmap_arg_struct_emu31 { 196 - compat_ulong_t addr; 197 - compat_ulong_t len; 198 - compat_ulong_t prot; 199 - compat_ulong_t flags; 200 - compat_ulong_t fd; 201 - compat_ulong_t offset; 202 - }; 203 - 204 - COMPAT_SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct_emu31 __user *, arg) 205 - { 206 - struct mmap_arg_struct_emu31 a; 207 - 208 - if (copy_from_user(&a, arg, sizeof(a))) 209 - return -EFAULT; 210 - if (a.offset & ~PAGE_MASK) 211 - return -EINVAL; 212 - return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, 213 - a.offset >> PAGE_SHIFT); 214 - } 215 - 216 - COMPAT_SYSCALL_DEFINE1(s390_mmap2, struct mmap_arg_struct_emu31 __user *, arg) 217 - { 218 - struct mmap_arg_struct_emu31 a; 219 - 220 - if (copy_from_user(&a, arg, sizeof(a))) 221 - return -EFAULT; 222 - return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); 223 - } 224 - 225 - COMPAT_SYSCALL_DEFINE3(s390_read, unsigned int, fd, char __user *, buf, compat_size_t, count) 226 - { 227 - if ((compat_ssize_t) count < 0) 228 - return -EINVAL; 229 - 230 - return ksys_read(fd, buf, count); 231 - } 232 - 233 - COMPAT_SYSCALL_DEFINE3(s390_write, unsigned int, fd, const char __user *, buf, compat_size_t, count) 234 - { 235 - if ((compat_ssize_t) count < 0) 236 - return -EINVAL; 237 - 238 - return ksys_write(fd, buf, count); 239 - } 240 - 241 - /* 242 - * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64. 243 - * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE} 244 - * because the 31 bit values differ from the 64 bit values. 245 - */ 246 - 247 - COMPAT_SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, high, u32, low, compat_size_t, len, int, advise) 248 - { 249 - if (advise == 4) 250 - advise = POSIX_FADV_DONTNEED; 251 - else if (advise == 5) 252 - advise = POSIX_FADV_NOREUSE; 253 - return ksys_fadvise64_64(fd, (unsigned long)high << 32 | low, len, 254 - advise); 255 - } 256 - 257 - struct fadvise64_64_args { 258 - int fd; 259 - long long offset; 260 - long long len; 261 - int advice; 262 - }; 263 - 264 - COMPAT_SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) 265 - { 266 - struct fadvise64_64_args a; 267 - 268 - if ( copy_from_user(&a, args, sizeof(a)) ) 269 - return -EFAULT; 270 - if (a.advice == 4) 271 - a.advice = POSIX_FADV_DONTNEED; 272 - else if (a.advice == 5) 273 - a.advice = POSIX_FADV_NOREUSE; 274 - return ksys_fadvise64_64(a.fd, a.offset, a.len, a.advice); 275 - } 276 - 277 - COMPAT_SYSCALL_DEFINE6(s390_sync_file_range, int, fd, u32, offhigh, u32, offlow, 278 - u32, nhigh, u32, nlow, unsigned int, flags) 279 - { 280 - return ksys_sync_file_range(fd, ((loff_t)offhigh << 32) + offlow, 281 - ((u64)nhigh << 32) + nlow, flags); 282 - } 283 - 284 - COMPAT_SYSCALL_DEFINE6(s390_fallocate, int, fd, int, mode, u32, offhigh, u32, offlow, 285 - u32, lenhigh, u32, lenlow) 286 - { 287 - return ksys_fallocate(fd, mode, ((loff_t)offhigh << 32) + offlow, 288 - ((u64)lenhigh << 32) + lenlow); 289 - }
-101
arch/s390/kernel/compat_linux.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_S390X_S390_H 3 - #define _ASM_S390X_S390_H 4 - 5 - #include <linux/compat.h> 6 - #include <linux/socket.h> 7 - #include <linux/syscalls.h> 8 - #include <asm/ptrace.h> 9 - 10 - /* 11 - * Macro that masks the high order bit of a 32 bit pointer and 12 - * converts it to a 64 bit pointer. 13 - */ 14 - #define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL)) 15 - #define AA(__x) ((unsigned long)(__x)) 16 - 17 - /* Now 32bit compatibility types */ 18 - struct ipc_kludge_32 { 19 - __u32 msgp; /* pointer */ 20 - __s32 msgtyp; 21 - }; 22 - 23 - /* asm/sigcontext.h */ 24 - typedef union { 25 - __u64 d; 26 - __u32 f; 27 - } freg_t32; 28 - 29 - typedef struct { 30 - unsigned int fpc; 31 - unsigned int pad; 32 - freg_t32 fprs[__NUM_FPRS]; 33 - } _s390_fp_regs32; 34 - 35 - typedef struct { 36 - psw_t32 psw; 37 - __u32 gprs[__NUM_GPRS]; 38 - __u32 acrs[__NUM_ACRS]; 39 - } _s390_regs_common32; 40 - 41 - typedef struct { 42 - _s390_regs_common32 regs; 43 - _s390_fp_regs32 fpregs; 44 - } _sigregs32; 45 - 46 - typedef struct { 47 - __u32 gprs_high[__NUM_GPRS]; 48 - __u64 vxrs_low[__NUM_VXRS_LOW]; 49 - __vector128 vxrs_high[__NUM_VXRS_HIGH]; 50 - __u8 __reserved[128]; 51 - } _sigregs_ext32; 52 - 53 - #define _SIGCONTEXT_NSIG32 64 54 - #define _SIGCONTEXT_NSIG_BPW32 32 55 - #define __SIGNAL_FRAMESIZE32 96 56 - #define _SIGMASK_COPY_SIZE32 (sizeof(u32) * 2) 57 - 58 - struct sigcontext32 { 59 - __u32 oldmask[_COMPAT_NSIG_WORDS]; 60 - __u32 sregs; /* pointer */ 61 - }; 62 - 63 - /* asm/signal.h */ 64 - 65 - /* asm/ucontext.h */ 66 - struct ucontext32 { 67 - __u32 uc_flags; 68 - __u32 uc_link; /* pointer */ 69 - compat_stack_t uc_stack; 70 - _sigregs32 uc_mcontext; 71 - compat_sigset_t uc_sigmask; 72 - /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */ 73 - unsigned char __unused[128 - sizeof(compat_sigset_t)]; 74 - _sigregs_ext32 uc_mcontext_ext; 75 - }; 76 - 77 - struct stat64_emu31; 78 - struct mmap_arg_struct_emu31; 79 - struct fadvise64_64_args; 80 - 81 - long compat_sys_s390_truncate64(const char __user *path, u32 high, u32 low); 82 - long compat_sys_s390_ftruncate64(unsigned int fd, u32 high, u32 low); 83 - long compat_sys_s390_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, u32 high, u32 low); 84 - long compat_sys_s390_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, u32 high, u32 low); 85 - long compat_sys_s390_readahead(int fd, u32 high, u32 low, s32 count); 86 - long compat_sys_s390_stat64(const char __user *filename, struct stat64_emu31 __user *statbuf); 87 - long compat_sys_s390_lstat64(const char __user *filename, struct stat64_emu31 __user *statbuf); 88 - long compat_sys_s390_fstat64(unsigned int fd, struct stat64_emu31 __user *statbuf); 89 - long compat_sys_s390_fstatat64(unsigned int dfd, const char __user *filename, struct stat64_emu31 __user *statbuf, int flag); 90 - long compat_sys_s390_old_mmap(struct mmap_arg_struct_emu31 __user *arg); 91 - long compat_sys_s390_mmap2(struct mmap_arg_struct_emu31 __user *arg); 92 - long compat_sys_s390_read(unsigned int fd, char __user *buf, compat_size_t count); 93 - long compat_sys_s390_write(unsigned int fd, const char __user *buf, compat_size_t count); 94 - long compat_sys_s390_fadvise64(int fd, u32 high, u32 low, compat_size_t len, int advise); 95 - long compat_sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); 96 - long compat_sys_s390_sync_file_range(int fd, u32 offhigh, u32 offlow, u32 nhigh, u32 nlow, unsigned int flags); 97 - long compat_sys_s390_fallocate(int fd, int mode, u32 offhigh, u32 offlow, u32 lenhigh, u32 lenlow); 98 - long compat_sys_sigreturn(void); 99 - long compat_sys_rt_sigreturn(void); 100 - 101 - #endif /* _ASM_S390X_S390_H */
-64
arch/s390/kernel/compat_ptrace.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _PTRACE32_H 3 - #define _PTRACE32_H 4 - 5 - #include <asm/ptrace.h> /* needed for NUM_CR_WORDS */ 6 - #include "compat_linux.h" /* needed for psw_compat_t */ 7 - 8 - struct compat_per_struct_kernel { 9 - __u32 cr9; /* PER control bits */ 10 - __u32 cr10; /* PER starting address */ 11 - __u32 cr11; /* PER ending address */ 12 - __u32 bits; /* Obsolete software bits */ 13 - __u32 starting_addr; /* User specified start address */ 14 - __u32 ending_addr; /* User specified end address */ 15 - __u16 perc_atmid; /* PER trap ATMID */ 16 - __u32 address; /* PER trap instruction address */ 17 - __u8 access_id; /* PER trap access identification */ 18 - }; 19 - 20 - struct compat_user_regs_struct 21 - { 22 - psw_compat_t psw; 23 - u32 gprs[NUM_GPRS]; 24 - u32 acrs[NUM_ACRS]; 25 - u32 orig_gpr2; 26 - /* nb: there's a 4-byte hole here */ 27 - s390_fp_regs fp_regs; 28 - /* 29 - * These per registers are in here so that gdb can modify them 30 - * itself as there is no "official" ptrace interface for hardware 31 - * watchpoints. This is the way intel does it. 32 - */ 33 - struct compat_per_struct_kernel per_info; 34 - u32 ieee_instruction_pointer; /* obsolete, always 0 */ 35 - }; 36 - 37 - struct compat_user { 38 - /* We start with the registers, to mimic the way that "memory" 39 - is returned from the ptrace(3,...) function. */ 40 - struct compat_user_regs_struct regs; 41 - /* The rest of this junk is to help gdb figure out what goes where */ 42 - u32 u_tsize; /* Text segment size (pages). */ 43 - u32 u_dsize; /* Data segment size (pages). */ 44 - u32 u_ssize; /* Stack segment size (pages). */ 45 - u32 start_code; /* Starting virtual address of text. */ 46 - u32 start_stack; /* Starting virtual address of stack area. 47 - This is actually the bottom of the stack, 48 - the top of the stack is always found in the 49 - esp register. */ 50 - s32 signal; /* Signal that caused the core dump. */ 51 - u32 u_ar0; /* Used by gdb to help find the values for */ 52 - /* the registers. */ 53 - u32 magic; /* To uniquely identify a core file */ 54 - char u_comm[32]; /* User command that was responsible */ 55 - }; 56 - 57 - typedef struct 58 - { 59 - __u32 len; 60 - __u32 kernel_addr; 61 - __u32 process_addr; 62 - } compat_ptrace_area; 63 - 64 - #endif /* _PTRACE32_H */
-420
arch/s390/kernel/compat_signal.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * Copyright IBM Corp. 2000, 2006 4 - * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) 5 - * Gerhard Tonn (ton@de.ibm.com) 6 - * 7 - * Copyright (C) 1991, 1992 Linus Torvalds 8 - * 9 - * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson 10 - */ 11 - 12 - #include <linux/compat.h> 13 - #include <linux/sched.h> 14 - #include <linux/sched/task_stack.h> 15 - #include <linux/mm.h> 16 - #include <linux/smp.h> 17 - #include <linux/kernel.h> 18 - #include <linux/signal.h> 19 - #include <linux/errno.h> 20 - #include <linux/wait.h> 21 - #include <linux/ptrace.h> 22 - #include <linux/unistd.h> 23 - #include <linux/stddef.h> 24 - #include <linux/tty.h> 25 - #include <linux/personality.h> 26 - #include <linux/binfmts.h> 27 - #include <asm/vdso-symbols.h> 28 - #include <asm/access-regs.h> 29 - #include <asm/ucontext.h> 30 - #include <linux/uaccess.h> 31 - #include <asm/lowcore.h> 32 - #include <asm/fpu.h> 33 - #include "compat_linux.h" 34 - #include "compat_ptrace.h" 35 - #include "entry.h" 36 - 37 - typedef struct 38 - { 39 - __u8 callee_used_stack[__SIGNAL_FRAMESIZE32]; 40 - struct sigcontext32 sc; 41 - _sigregs32 sregs; 42 - int signo; 43 - _sigregs_ext32 sregs_ext; 44 - __u16 svc_insn; /* Offset of svc_insn is NOT fixed! */ 45 - } sigframe32; 46 - 47 - typedef struct 48 - { 49 - __u8 callee_used_stack[__SIGNAL_FRAMESIZE32]; 50 - __u16 svc_insn; 51 - compat_siginfo_t info; 52 - struct ucontext32 uc; 53 - } rt_sigframe32; 54 - 55 - /* Store registers needed to create the signal frame */ 56 - static void store_sigregs(void) 57 - { 58 - save_access_regs(current->thread.acrs); 59 - save_user_fpu_regs(); 60 - } 61 - 62 - /* Load registers after signal return */ 63 - static void load_sigregs(void) 64 - { 65 - restore_access_regs(current->thread.acrs); 66 - } 67 - 68 - static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) 69 - { 70 - _sigregs32 user_sregs; 71 - int i; 72 - 73 - user_sregs.regs.psw.mask = (__u32)(regs->psw.mask >> 32); 74 - user_sregs.regs.psw.mask &= PSW32_MASK_USER | PSW32_MASK_RI; 75 - user_sregs.regs.psw.mask |= PSW32_USER_BITS; 76 - user_sregs.regs.psw.addr = (__u32) regs->psw.addr | 77 - (__u32)(regs->psw.mask & PSW_MASK_BA); 78 - for (i = 0; i < NUM_GPRS; i++) 79 - user_sregs.regs.gprs[i] = (__u32) regs->gprs[i]; 80 - memcpy(&user_sregs.regs.acrs, current->thread.acrs, 81 - sizeof(user_sregs.regs.acrs)); 82 - fpregs_store((_s390_fp_regs *) &user_sregs.fpregs, &current->thread.ufpu); 83 - if (__copy_to_user(sregs, &user_sregs, sizeof(_sigregs32))) 84 - return -EFAULT; 85 - return 0; 86 - } 87 - 88 - static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) 89 - { 90 - _sigregs32 user_sregs; 91 - int i; 92 - 93 - /* Always make any pending restarted system call return -EINTR */ 94 - current->restart_block.fn = do_no_restart_syscall; 95 - 96 - if (__copy_from_user(&user_sregs, &sregs->regs, sizeof(user_sregs))) 97 - return -EFAULT; 98 - 99 - if (!is_ri_task(current) && (user_sregs.regs.psw.mask & PSW32_MASK_RI)) 100 - return -EINVAL; 101 - 102 - /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */ 103 - regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) | 104 - (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 | 105 - (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 | 106 - (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE); 107 - /* Check for invalid user address space control. */ 108 - if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME) 109 - regs->psw.mask = PSW_ASC_PRIMARY | 110 - (regs->psw.mask & ~PSW_MASK_ASC); 111 - regs->psw.addr = (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_INSN); 112 - for (i = 0; i < NUM_GPRS; i++) 113 - regs->gprs[i] = (__u64) user_sregs.regs.gprs[i]; 114 - memcpy(&current->thread.acrs, &user_sregs.regs.acrs, 115 - sizeof(current->thread.acrs)); 116 - fpregs_load((_s390_fp_regs *)&user_sregs.fpregs, &current->thread.ufpu); 117 - 118 - clear_pt_regs_flag(regs, PIF_SYSCALL); /* No longer in a system call */ 119 - return 0; 120 - } 121 - 122 - static int save_sigregs_ext32(struct pt_regs *regs, 123 - _sigregs_ext32 __user *sregs_ext) 124 - { 125 - __u32 gprs_high[NUM_GPRS]; 126 - __u64 vxrs[__NUM_VXRS_LOW]; 127 - int i; 128 - 129 - /* Save high gprs to signal stack */ 130 - for (i = 0; i < NUM_GPRS; i++) 131 - gprs_high[i] = regs->gprs[i] >> 32; 132 - if (__copy_to_user(&sregs_ext->gprs_high, &gprs_high, 133 - sizeof(sregs_ext->gprs_high))) 134 - return -EFAULT; 135 - 136 - /* Save vector registers to signal stack */ 137 - if (cpu_has_vx()) { 138 - for (i = 0; i < __NUM_VXRS_LOW; i++) 139 - vxrs[i] = current->thread.ufpu.vxrs[i].low; 140 - if (__copy_to_user(&sregs_ext->vxrs_low, vxrs, 141 - sizeof(sregs_ext->vxrs_low)) || 142 - __copy_to_user(&sregs_ext->vxrs_high, 143 - current->thread.ufpu.vxrs + __NUM_VXRS_LOW, 144 - sizeof(sregs_ext->vxrs_high))) 145 - return -EFAULT; 146 - } 147 - return 0; 148 - } 149 - 150 - static int restore_sigregs_ext32(struct pt_regs *regs, 151 - _sigregs_ext32 __user *sregs_ext) 152 - { 153 - __u32 gprs_high[NUM_GPRS]; 154 - __u64 vxrs[__NUM_VXRS_LOW]; 155 - int i; 156 - 157 - /* Restore high gprs from signal stack */ 158 - if (__copy_from_user(&gprs_high, &sregs_ext->gprs_high, 159 - sizeof(sregs_ext->gprs_high))) 160 - return -EFAULT; 161 - for (i = 0; i < NUM_GPRS; i++) 162 - *(__u32 *)&regs->gprs[i] = gprs_high[i]; 163 - 164 - /* Restore vector registers from signal stack */ 165 - if (cpu_has_vx()) { 166 - if (__copy_from_user(vxrs, &sregs_ext->vxrs_low, 167 - sizeof(sregs_ext->vxrs_low)) || 168 - __copy_from_user(current->thread.ufpu.vxrs + __NUM_VXRS_LOW, 169 - &sregs_ext->vxrs_high, 170 - sizeof(sregs_ext->vxrs_high))) 171 - return -EFAULT; 172 - for (i = 0; i < __NUM_VXRS_LOW; i++) 173 - current->thread.ufpu.vxrs[i].low = vxrs[i]; 174 - } 175 - return 0; 176 - } 177 - 178 - COMPAT_SYSCALL_DEFINE0(sigreturn) 179 - { 180 - struct pt_regs *regs = task_pt_regs(current); 181 - sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15]; 182 - sigset_t set; 183 - 184 - if (get_compat_sigset(&set, (compat_sigset_t __user *)frame->sc.oldmask)) 185 - goto badframe; 186 - set_current_blocked(&set); 187 - save_user_fpu_regs(); 188 - if (restore_sigregs32(regs, &frame->sregs)) 189 - goto badframe; 190 - if (restore_sigregs_ext32(regs, &frame->sregs_ext)) 191 - goto badframe; 192 - load_sigregs(); 193 - return regs->gprs[2]; 194 - badframe: 195 - force_sig(SIGSEGV); 196 - return 0; 197 - } 198 - 199 - COMPAT_SYSCALL_DEFINE0(rt_sigreturn) 200 - { 201 - struct pt_regs *regs = task_pt_regs(current); 202 - rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15]; 203 - sigset_t set; 204 - 205 - if (get_compat_sigset(&set, &frame->uc.uc_sigmask)) 206 - goto badframe; 207 - set_current_blocked(&set); 208 - if (compat_restore_altstack(&frame->uc.uc_stack)) 209 - goto badframe; 210 - save_user_fpu_regs(); 211 - if (restore_sigregs32(regs, &frame->uc.uc_mcontext)) 212 - goto badframe; 213 - if (restore_sigregs_ext32(regs, &frame->uc.uc_mcontext_ext)) 214 - goto badframe; 215 - load_sigregs(); 216 - return regs->gprs[2]; 217 - badframe: 218 - force_sig(SIGSEGV); 219 - return 0; 220 - } 221 - 222 - /* 223 - * Set up a signal frame. 224 - */ 225 - 226 - 227 - /* 228 - * Determine which stack to use.. 229 - */ 230 - static inline void __user * 231 - get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) 232 - { 233 - unsigned long sp; 234 - 235 - /* Default to using normal stack */ 236 - sp = (unsigned long) A(regs->gprs[15]); 237 - 238 - /* Overflow on alternate signal stack gives SIGSEGV. */ 239 - if (on_sig_stack(sp) && !on_sig_stack((sp - frame_size) & -8UL)) 240 - return (void __user *) -1UL; 241 - 242 - /* This is the X/Open sanctioned signal stack switching. */ 243 - if (ka->sa.sa_flags & SA_ONSTACK) { 244 - if (! sas_ss_flags(sp)) 245 - sp = current->sas_ss_sp + current->sas_ss_size; 246 - } 247 - 248 - return (void __user *)((sp - frame_size) & -8ul); 249 - } 250 - 251 - static int setup_frame32(struct ksignal *ksig, sigset_t *set, 252 - struct pt_regs *regs) 253 - { 254 - int sig = ksig->sig; 255 - sigframe32 __user *frame; 256 - unsigned long restorer; 257 - size_t frame_size; 258 - 259 - /* 260 - * gprs_high are always present for 31-bit compat tasks. 261 - * The space for vector registers is only allocated if 262 - * the machine supports it 263 - */ 264 - frame_size = sizeof(*frame) - sizeof(frame->sregs_ext.__reserved); 265 - if (!cpu_has_vx()) 266 - frame_size -= sizeof(frame->sregs_ext.vxrs_low) + 267 - sizeof(frame->sregs_ext.vxrs_high); 268 - frame = get_sigframe(&ksig->ka, regs, frame_size); 269 - if (frame == (void __user *) -1UL) 270 - return -EFAULT; 271 - 272 - /* Set up backchain. */ 273 - if (__put_user(regs->gprs[15], (unsigned int __user *) frame)) 274 - return -EFAULT; 275 - 276 - /* Create struct sigcontext32 on the signal stack */ 277 - if (put_compat_sigset((compat_sigset_t __user *)frame->sc.oldmask, 278 - set, sizeof(compat_sigset_t))) 279 - return -EFAULT; 280 - if (__put_user(ptr_to_compat(&frame->sregs), &frame->sc.sregs)) 281 - return -EFAULT; 282 - 283 - /* Store registers needed to create the signal frame */ 284 - store_sigregs(); 285 - 286 - /* Create _sigregs32 on the signal stack */ 287 - if (save_sigregs32(regs, &frame->sregs)) 288 - return -EFAULT; 289 - 290 - /* Place signal number on stack to allow backtrace from handler. */ 291 - if (__put_user(regs->gprs[2], (int __force __user *) &frame->signo)) 292 - return -EFAULT; 293 - 294 - /* Create _sigregs_ext32 on the signal stack */ 295 - if (save_sigregs_ext32(regs, &frame->sregs_ext)) 296 - return -EFAULT; 297 - 298 - /* Set up to return from userspace. If provided, use a stub 299 - already in userspace. */ 300 - if (ksig->ka.sa.sa_flags & SA_RESTORER) { 301 - restorer = (unsigned long __force) 302 - ksig->ka.sa.sa_restorer | PSW32_ADDR_AMODE; 303 - } else { 304 - restorer = VDSO32_SYMBOL(current, sigreturn); 305 - } 306 - 307 - /* Set up registers for signal handler */ 308 - regs->gprs[14] = restorer; 309 - regs->gprs[15] = (__force __u64) frame; 310 - /* Force 31 bit amode and default user address space control. */ 311 - regs->psw.mask = PSW_MASK_BA | 312 - (PSW_USER_BITS & PSW_MASK_ASC) | 313 - (regs->psw.mask & ~PSW_MASK_ASC); 314 - regs->psw.addr = (__force __u64) ksig->ka.sa.sa_handler; 315 - 316 - regs->gprs[2] = sig; 317 - regs->gprs[3] = (__force __u64) &frame->sc; 318 - 319 - /* We forgot to include these in the sigcontext. 320 - To avoid breaking binary compatibility, they are passed as args. */ 321 - if (sig == SIGSEGV || sig == SIGBUS || sig == SIGILL || 322 - sig == SIGTRAP || sig == SIGFPE) { 323 - /* set extra registers only for synchronous signals */ 324 - regs->gprs[4] = regs->int_code & 127; 325 - regs->gprs[5] = regs->int_parm_long; 326 - regs->gprs[6] = current->thread.last_break; 327 - } 328 - 329 - return 0; 330 - } 331 - 332 - static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set, 333 - struct pt_regs *regs) 334 - { 335 - rt_sigframe32 __user *frame; 336 - unsigned long restorer; 337 - size_t frame_size; 338 - u32 uc_flags; 339 - 340 - frame_size = sizeof(*frame) - 341 - sizeof(frame->uc.uc_mcontext_ext.__reserved); 342 - /* 343 - * gprs_high are always present for 31-bit compat tasks. 344 - * The space for vector registers is only allocated if 345 - * the machine supports it 346 - */ 347 - uc_flags = UC_GPRS_HIGH; 348 - if (cpu_has_vx()) { 349 - uc_flags |= UC_VXRS; 350 - } else { 351 - frame_size -= sizeof(frame->uc.uc_mcontext_ext.vxrs_low) + 352 - sizeof(frame->uc.uc_mcontext_ext.vxrs_high); 353 - } 354 - frame = get_sigframe(&ksig->ka, regs, frame_size); 355 - if (frame == (void __user *) -1UL) 356 - return -EFAULT; 357 - 358 - /* Set up backchain. */ 359 - if (__put_user(regs->gprs[15], (unsigned int __force __user *) frame)) 360 - return -EFAULT; 361 - 362 - /* Set up to return from userspace. If provided, use a stub 363 - already in userspace. */ 364 - if (ksig->ka.sa.sa_flags & SA_RESTORER) { 365 - restorer = (unsigned long __force) 366 - ksig->ka.sa.sa_restorer | PSW32_ADDR_AMODE; 367 - } else { 368 - restorer = VDSO32_SYMBOL(current, rt_sigreturn); 369 - } 370 - 371 - /* Create siginfo on the signal stack */ 372 - if (copy_siginfo_to_user32(&frame->info, &ksig->info)) 373 - return -EFAULT; 374 - 375 - /* Store registers needed to create the signal frame */ 376 - store_sigregs(); 377 - 378 - /* Create ucontext on the signal stack. */ 379 - if (__put_user(uc_flags, &frame->uc.uc_flags) || 380 - __put_user(0, &frame->uc.uc_link) || 381 - __compat_save_altstack(&frame->uc.uc_stack, regs->gprs[15]) || 382 - save_sigregs32(regs, &frame->uc.uc_mcontext) || 383 - put_compat_sigset(&frame->uc.uc_sigmask, set, sizeof(compat_sigset_t)) || 384 - save_sigregs_ext32(regs, &frame->uc.uc_mcontext_ext)) 385 - return -EFAULT; 386 - 387 - /* Set up registers for signal handler */ 388 - regs->gprs[14] = restorer; 389 - regs->gprs[15] = (__force __u64) frame; 390 - /* Force 31 bit amode and default user address space control. */ 391 - regs->psw.mask = PSW_MASK_BA | 392 - (PSW_USER_BITS & PSW_MASK_ASC) | 393 - (regs->psw.mask & ~PSW_MASK_ASC); 394 - regs->psw.addr = (__u64 __force) ksig->ka.sa.sa_handler; 395 - 396 - regs->gprs[2] = ksig->sig; 397 - regs->gprs[3] = (__force __u64) &frame->info; 398 - regs->gprs[4] = (__force __u64) &frame->uc; 399 - regs->gprs[5] = current->thread.last_break; 400 - return 0; 401 - } 402 - 403 - /* 404 - * OK, we're invoking a handler 405 - */ 406 - 407 - void handle_signal32(struct ksignal *ksig, sigset_t *oldset, 408 - struct pt_regs *regs) 409 - { 410 - int ret; 411 - 412 - /* Set up the stack frame */ 413 - if (ksig->ka.sa.sa_flags & SA_SIGINFO) 414 - ret = setup_rt_frame32(ksig, oldset, regs); 415 - else 416 - ret = setup_frame32(ksig, oldset, regs); 417 - 418 - signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLE_STEP)); 419 - } 420 -
-17
arch/s390/kernel/entry.S
··· 606 606 .quad PSW_KERNEL_BITS 607 607 .quad .Ldaton 608 608 SYM_DATA_END(daton_psw) 609 - 610 - .section .rodata, "a" 611 - .balign 8 612 - #define SYSCALL(esame,emu) .quad __s390x_ ## esame 613 - SYM_DATA_START(sys_call_table) 614 - #include <asm/syscall_table.h> 615 - SYM_DATA_END(sys_call_table) 616 - #undef SYSCALL 617 - 618 - #ifdef CONFIG_COMPAT 619 - 620 - #define SYSCALL(esame,emu) .quad __s390_ ## emu 621 - SYM_DATA_START(sys_call_table_emu) 622 - #include <asm/syscall_table.h> 623 - SYM_DATA_END(sys_call_table_emu) 624 - #undef SYSCALL 625 - #endif
-1
arch/s390/kernel/perf_cpum_cf.c
··· 1689 1689 .open = cfset_open, 1690 1690 .release = cfset_release, 1691 1691 .unlocked_ioctl = cfset_ioctl, 1692 - .compat_ioctl = cfset_ioctl, 1693 1692 }; 1694 1693 1695 1694 static struct miscdevice cfset_dev = {
-1
arch/s390/kernel/perf_event.c
··· 15 15 #include <linux/seq_file.h> 16 16 #include <linux/spinlock.h> 17 17 #include <linux/uaccess.h> 18 - #include <linux/compat.h> 19 18 #include <linux/sysfs.h> 20 19 #include <asm/stacktrace.h> 21 20 #include <asm/irq.h>
-3
arch/s390/kernel/perf_regs.c
··· 44 44 45 45 u64 perf_reg_abi(struct task_struct *task) 46 46 { 47 - if (test_tsk_thread_flag(task, TIF_31BIT)) 48 - return PERF_SAMPLE_REGS_ABI_32; 49 - 50 47 return PERF_SAMPLE_REGS_ABI_64; 51 48 } 52 49
+2 -7
arch/s390/kernel/process.c
··· 24 24 #include <linux/tick.h> 25 25 #include <linux/personality.h> 26 26 #include <linux/syscalls.h> 27 - #include <linux/compat.h> 28 27 #include <linux/kprobes.h> 29 28 #include <linux/random.h> 30 29 #include <linux/init_task.h> ··· 165 166 166 167 /* Set a new TLS ? */ 167 168 if (clone_flags & CLONE_SETTLS) { 168 - if (is_compat_task()) { 169 - p->thread.acrs[0] = (unsigned int)tls; 170 - } else { 171 - p->thread.acrs[0] = (unsigned int)(tls >> 32); 172 - p->thread.acrs[1] = (unsigned int)tls; 173 - } 169 + p->thread.acrs[0] = (unsigned int)(tls >> 32); 170 + p->thread.acrs[1] = (unsigned int)tls; 174 171 } 175 172 /* 176 173 * s390 stores the svc return address in arch_data when calling
-524
arch/s390/kernel/ptrace.c
··· 22 22 #include <linux/elf.h> 23 23 #include <linux/regset.h> 24 24 #include <linux/seccomp.h> 25 - #include <linux/compat.h> 26 25 #include <trace/syscall.h> 27 26 #include <asm/guarded_storage.h> 28 27 #include <asm/access-regs.h> ··· 36 37 #include <asm/fpu.h> 37 38 38 39 #include "entry.h" 39 - 40 - #ifdef CONFIG_COMPAT 41 - #include "compat_ptrace.h" 42 - #endif 43 40 44 41 void update_cr_regs(struct task_struct *task) 45 42 { ··· 501 506 return ptrace_request(child, request, addr, data); 502 507 } 503 508 } 504 - 505 - #ifdef CONFIG_COMPAT 506 - /* 507 - * Now the fun part starts... a 31 bit program running in the 508 - * 31 bit emulation tracing another program. PTRACE_PEEKTEXT, 509 - * PTRACE_PEEKDATA, PTRACE_POKETEXT and PTRACE_POKEDATA are easy 510 - * to handle, the difference to the 64 bit versions of the requests 511 - * is that the access is done in multiples of 4 byte instead of 512 - * 8 bytes (sizeof(unsigned long) on 31/64 bit). 513 - * The ugly part are PTRACE_PEEKUSR, PTRACE_PEEKUSR_AREA, 514 - * PTRACE_POKEUSR and PTRACE_POKEUSR_AREA. If the traced program 515 - * is a 31 bit program too, the content of struct user can be 516 - * emulated. A 31 bit program peeking into the struct user of 517 - * a 64 bit program is a no-no. 518 - */ 519 - 520 - /* 521 - * Same as peek_user_per but for a 31 bit program. 522 - */ 523 - static inline __u32 __peek_user_per_compat(struct task_struct *child, 524 - addr_t addr) 525 - { 526 - if (addr == offsetof(struct compat_per_struct_kernel, cr9)) 527 - /* Control bits of the active per set. */ 528 - return (__u32) test_thread_flag(TIF_SINGLE_STEP) ? 529 - PER_EVENT_IFETCH : child->thread.per_user.control; 530 - else if (addr == offsetof(struct compat_per_struct_kernel, cr10)) 531 - /* Start address of the active per set. */ 532 - return (__u32) test_thread_flag(TIF_SINGLE_STEP) ? 533 - 0 : child->thread.per_user.start; 534 - else if (addr == offsetof(struct compat_per_struct_kernel, cr11)) 535 - /* End address of the active per set. */ 536 - return test_thread_flag(TIF_SINGLE_STEP) ? 537 - PSW32_ADDR_INSN : child->thread.per_user.end; 538 - else if (addr == offsetof(struct compat_per_struct_kernel, bits)) 539 - /* Single-step bit. */ 540 - return (__u32) test_thread_flag(TIF_SINGLE_STEP) ? 541 - 0x80000000 : 0; 542 - else if (addr == offsetof(struct compat_per_struct_kernel, starting_addr)) 543 - /* Start address of the user specified per set. */ 544 - return (__u32) child->thread.per_user.start; 545 - else if (addr == offsetof(struct compat_per_struct_kernel, ending_addr)) 546 - /* End address of the user specified per set. */ 547 - return (__u32) child->thread.per_user.end; 548 - else if (addr == offsetof(struct compat_per_struct_kernel, perc_atmid)) 549 - /* PER code, ATMID and AI of the last PER trap */ 550 - return (__u32) child->thread.per_event.cause << 16; 551 - else if (addr == offsetof(struct compat_per_struct_kernel, address)) 552 - /* Address of the last PER trap */ 553 - return (__u32) child->thread.per_event.address; 554 - else if (addr == offsetof(struct compat_per_struct_kernel, access_id)) 555 - /* Access id of the last PER trap */ 556 - return (__u32) child->thread.per_event.paid << 24; 557 - return 0; 558 - } 559 - 560 - /* 561 - * Same as peek_user but for a 31 bit program. 562 - */ 563 - static u32 __peek_user_compat(struct task_struct *child, addr_t addr) 564 - { 565 - addr_t offset; 566 - __u32 tmp; 567 - 568 - if (addr < offsetof(struct compat_user, regs.acrs)) { 569 - struct pt_regs *regs = task_pt_regs(child); 570 - /* 571 - * psw and gprs are stored on the stack 572 - */ 573 - if (addr == offsetof(struct compat_user, regs.psw.mask)) { 574 - /* Fake a 31 bit psw mask. */ 575 - tmp = (__u32)(regs->psw.mask >> 32); 576 - tmp &= PSW32_MASK_USER | PSW32_MASK_RI; 577 - tmp |= PSW32_USER_BITS; 578 - } else if (addr == offsetof(struct compat_user, regs.psw.addr)) { 579 - /* Fake a 31 bit psw address. */ 580 - tmp = (__u32) regs->psw.addr | 581 - (__u32)(regs->psw.mask & PSW_MASK_BA); 582 - } else { 583 - /* gpr 0-15 */ 584 - tmp = *(__u32 *)((addr_t) &regs->psw + addr*2 + 4); 585 - } 586 - } else if (addr < offsetof(struct compat_user, regs.orig_gpr2)) { 587 - /* 588 - * access registers are stored in the thread structure 589 - */ 590 - offset = addr - offsetof(struct compat_user, regs.acrs); 591 - tmp = *(__u32*)((addr_t) &child->thread.acrs + offset); 592 - 593 - } else if (addr == offsetof(struct compat_user, regs.orig_gpr2)) { 594 - /* 595 - * orig_gpr2 is stored on the kernel stack 596 - */ 597 - tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4); 598 - 599 - } else if (addr < offsetof(struct compat_user, regs.fp_regs)) { 600 - /* 601 - * prevent reads of padding hole between 602 - * orig_gpr2 and fp_regs on s390. 603 - */ 604 - tmp = 0; 605 - 606 - } else if (addr == offsetof(struct compat_user, regs.fp_regs.fpc)) { 607 - /* 608 - * floating point control reg. is in the thread structure 609 - */ 610 - tmp = child->thread.ufpu.fpc; 611 - 612 - } else if (addr < offsetof(struct compat_user, regs.fp_regs) + sizeof(s390_fp_regs)) { 613 - /* 614 - * floating point regs. are in the child->thread.ufpu.vxrs array 615 - */ 616 - offset = addr - offsetof(struct compat_user, regs.fp_regs.fprs); 617 - tmp = *(__u32 *)((addr_t)child->thread.ufpu.vxrs + 2 * offset); 618 - } else if (addr < offsetof(struct compat_user, regs.per_info) + sizeof(struct compat_per_struct_kernel)) { 619 - /* 620 - * Handle access to the per_info structure. 621 - */ 622 - addr -= offsetof(struct compat_user, regs.per_info); 623 - tmp = __peek_user_per_compat(child, addr); 624 - 625 - } else 626 - tmp = 0; 627 - 628 - return tmp; 629 - } 630 - 631 - static int peek_user_compat(struct task_struct *child, 632 - addr_t addr, addr_t data) 633 - { 634 - __u32 tmp; 635 - 636 - if (!is_compat_task() || (addr & 3) || addr > sizeof(struct user) - 3) 637 - return -EIO; 638 - 639 - tmp = __peek_user_compat(child, addr); 640 - return put_user(tmp, (__u32 __user *) data); 641 - } 642 - 643 - /* 644 - * Same as poke_user_per but for a 31 bit program. 645 - */ 646 - static inline void __poke_user_per_compat(struct task_struct *child, 647 - addr_t addr, __u32 data) 648 - { 649 - if (addr == offsetof(struct compat_per_struct_kernel, cr9)) 650 - /* PER event mask of the user specified per set. */ 651 - child->thread.per_user.control = 652 - data & (PER_EVENT_MASK | PER_CONTROL_MASK); 653 - else if (addr == offsetof(struct compat_per_struct_kernel, starting_addr)) 654 - /* Starting address of the user specified per set. */ 655 - child->thread.per_user.start = data; 656 - else if (addr == offsetof(struct compat_per_struct_kernel, ending_addr)) 657 - /* Ending address of the user specified per set. */ 658 - child->thread.per_user.end = data; 659 - } 660 - 661 - /* 662 - * Same as poke_user but for a 31 bit program. 663 - */ 664 - static int __poke_user_compat(struct task_struct *child, 665 - addr_t addr, addr_t data) 666 - { 667 - __u32 tmp = (__u32) data; 668 - addr_t offset; 669 - 670 - if (addr < offsetof(struct compat_user, regs.acrs)) { 671 - struct pt_regs *regs = task_pt_regs(child); 672 - /* 673 - * psw, gprs, acrs and orig_gpr2 are stored on the stack 674 - */ 675 - if (addr == offsetof(struct compat_user, regs.psw.mask)) { 676 - __u32 mask = PSW32_MASK_USER; 677 - 678 - mask |= is_ri_task(child) ? PSW32_MASK_RI : 0; 679 - /* Build a 64 bit psw mask from 31 bit mask. */ 680 - if ((tmp ^ PSW32_USER_BITS) & ~mask) 681 - /* Invalid psw mask. */ 682 - return -EINVAL; 683 - if ((data & PSW32_MASK_ASC) == PSW32_ASC_HOME) 684 - /* Invalid address-space-control bits */ 685 - return -EINVAL; 686 - regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | 687 - (regs->psw.mask & PSW_MASK_BA) | 688 - (__u64)(tmp & mask) << 32; 689 - } else if (addr == offsetof(struct compat_user, regs.psw.addr)) { 690 - /* Build a 64 bit psw address from 31 bit address. */ 691 - regs->psw.addr = (__u64) tmp & PSW32_ADDR_INSN; 692 - /* Transfer 31 bit amode bit to psw mask. */ 693 - regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | 694 - (__u64)(tmp & PSW32_ADDR_AMODE); 695 - } else { 696 - if (test_pt_regs_flag(regs, PIF_SYSCALL) && 697 - addr == offsetof(struct compat_user, regs.gprs[2])) { 698 - struct pt_regs *regs = task_pt_regs(child); 699 - 700 - regs->int_code = 0x20000 | (data & 0xffff); 701 - } 702 - /* gpr 0-15 */ 703 - *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp; 704 - } 705 - } else if (addr < offsetof(struct compat_user, regs.orig_gpr2)) { 706 - /* 707 - * access registers are stored in the thread structure 708 - */ 709 - offset = addr - offsetof(struct compat_user, regs.acrs); 710 - *(__u32*)((addr_t) &child->thread.acrs + offset) = tmp; 711 - 712 - } else if (addr == offsetof(struct compat_user, regs.orig_gpr2)) { 713 - /* 714 - * orig_gpr2 is stored on the kernel stack 715 - */ 716 - *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp; 717 - 718 - } else if (addr < offsetof(struct compat_user, regs.fp_regs)) { 719 - /* 720 - * prevent writess of padding hole between 721 - * orig_gpr2 and fp_regs on s390. 722 - */ 723 - return 0; 724 - 725 - } else if (addr == offsetof(struct compat_user, regs.fp_regs.fpc)) { 726 - /* 727 - * floating point control reg. is in the thread structure 728 - */ 729 - child->thread.ufpu.fpc = data; 730 - 731 - } else if (addr < offsetof(struct compat_user, regs.fp_regs) + sizeof(s390_fp_regs)) { 732 - /* 733 - * floating point regs. are in the child->thread.ufpu.vxrs array 734 - */ 735 - offset = addr - offsetof(struct compat_user, regs.fp_regs.fprs); 736 - *(__u32 *)((addr_t)child->thread.ufpu.vxrs + 2 * offset) = tmp; 737 - } else if (addr < offsetof(struct compat_user, regs.per_info) + sizeof(struct compat_per_struct_kernel)) { 738 - /* 739 - * Handle access to the per_info structure. 740 - */ 741 - addr -= offsetof(struct compat_user, regs.per_info); 742 - __poke_user_per_compat(child, addr, data); 743 - } 744 - 745 - return 0; 746 - } 747 - 748 - static int poke_user_compat(struct task_struct *child, 749 - addr_t addr, addr_t data) 750 - { 751 - if (!is_compat_task() || (addr & 3) || 752 - addr > sizeof(struct compat_user) - 3) 753 - return -EIO; 754 - 755 - return __poke_user_compat(child, addr, data); 756 - } 757 - 758 - long compat_arch_ptrace(struct task_struct *child, compat_long_t request, 759 - compat_ulong_t caddr, compat_ulong_t cdata) 760 - { 761 - unsigned long addr = caddr; 762 - unsigned long data = cdata; 763 - compat_ptrace_area parea; 764 - int copied, ret; 765 - 766 - switch (request) { 767 - case PTRACE_PEEKUSR: 768 - /* read the word at location addr in the USER area. */ 769 - return peek_user_compat(child, addr, data); 770 - 771 - case PTRACE_POKEUSR: 772 - /* write the word at location addr in the USER area */ 773 - return poke_user_compat(child, addr, data); 774 - 775 - case PTRACE_PEEKUSR_AREA: 776 - case PTRACE_POKEUSR_AREA: 777 - if (copy_from_user(&parea, (void __force __user *) addr, 778 - sizeof(parea))) 779 - return -EFAULT; 780 - addr = parea.kernel_addr; 781 - data = parea.process_addr; 782 - copied = 0; 783 - while (copied < parea.len) { 784 - if (request == PTRACE_PEEKUSR_AREA) 785 - ret = peek_user_compat(child, addr, data); 786 - else { 787 - __u32 utmp; 788 - if (get_user(utmp, 789 - (__u32 __force __user *) data)) 790 - return -EFAULT; 791 - ret = poke_user_compat(child, addr, utmp); 792 - } 793 - if (ret) 794 - return ret; 795 - addr += sizeof(unsigned int); 796 - data += sizeof(unsigned int); 797 - copied += sizeof(unsigned int); 798 - } 799 - return 0; 800 - case PTRACE_GET_LAST_BREAK: 801 - return put_user(child->thread.last_break, (unsigned int __user *)data); 802 - } 803 - return compat_ptrace_request(child, request, addr, data); 804 - } 805 - #endif 806 509 807 510 /* 808 511 * user_regset definitions. ··· 990 1297 .n = ARRAY_SIZE(s390_regsets) 991 1298 }; 992 1299 993 - #ifdef CONFIG_COMPAT 994 - static int s390_compat_regs_get(struct task_struct *target, 995 - const struct user_regset *regset, 996 - struct membuf to) 997 - { 998 - unsigned n; 999 - 1000 - if (target == current) 1001 - save_access_regs(target->thread.acrs); 1002 - 1003 - for (n = 0; n < sizeof(s390_compat_regs); n += sizeof(compat_ulong_t)) 1004 - membuf_store(&to, __peek_user_compat(target, n)); 1005 - return 0; 1006 - } 1007 - 1008 - static int s390_compat_regs_set(struct task_struct *target, 1009 - const struct user_regset *regset, 1010 - unsigned int pos, unsigned int count, 1011 - const void *kbuf, const void __user *ubuf) 1012 - { 1013 - int rc = 0; 1014 - 1015 - if (target == current) 1016 - save_access_regs(target->thread.acrs); 1017 - 1018 - if (kbuf) { 1019 - const compat_ulong_t *k = kbuf; 1020 - while (count > 0 && !rc) { 1021 - rc = __poke_user_compat(target, pos, *k++); 1022 - count -= sizeof(*k); 1023 - pos += sizeof(*k); 1024 - } 1025 - } else { 1026 - const compat_ulong_t __user *u = ubuf; 1027 - while (count > 0 && !rc) { 1028 - compat_ulong_t word; 1029 - rc = __get_user(word, u++); 1030 - if (rc) 1031 - break; 1032 - rc = __poke_user_compat(target, pos, word); 1033 - count -= sizeof(*u); 1034 - pos += sizeof(*u); 1035 - } 1036 - } 1037 - 1038 - if (rc == 0 && target == current) 1039 - restore_access_regs(target->thread.acrs); 1040 - 1041 - return rc; 1042 - } 1043 - 1044 - static int s390_compat_regs_high_get(struct task_struct *target, 1045 - const struct user_regset *regset, 1046 - struct membuf to) 1047 - { 1048 - compat_ulong_t *gprs_high; 1049 - int i; 1050 - 1051 - gprs_high = (compat_ulong_t *)task_pt_regs(target)->gprs; 1052 - for (i = 0; i < NUM_GPRS; i++, gprs_high += 2) 1053 - membuf_store(&to, *gprs_high); 1054 - return 0; 1055 - } 1056 - 1057 - static int s390_compat_regs_high_set(struct task_struct *target, 1058 - const struct user_regset *regset, 1059 - unsigned int pos, unsigned int count, 1060 - const void *kbuf, const void __user *ubuf) 1061 - { 1062 - compat_ulong_t *gprs_high; 1063 - int rc = 0; 1064 - 1065 - gprs_high = (compat_ulong_t *) 1066 - &task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)]; 1067 - if (kbuf) { 1068 - const compat_ulong_t *k = kbuf; 1069 - while (count > 0) { 1070 - *gprs_high = *k++; 1071 - *gprs_high += 2; 1072 - count -= sizeof(*k); 1073 - } 1074 - } else { 1075 - const compat_ulong_t __user *u = ubuf; 1076 - while (count > 0 && !rc) { 1077 - unsigned long word; 1078 - rc = __get_user(word, u++); 1079 - if (rc) 1080 - break; 1081 - *gprs_high = word; 1082 - *gprs_high += 2; 1083 - count -= sizeof(*u); 1084 - } 1085 - } 1086 - 1087 - return rc; 1088 - } 1089 - 1090 - static int s390_compat_last_break_get(struct task_struct *target, 1091 - const struct user_regset *regset, 1092 - struct membuf to) 1093 - { 1094 - compat_ulong_t last_break = target->thread.last_break; 1095 - 1096 - return membuf_store(&to, (unsigned long)last_break); 1097 - } 1098 - 1099 - static int s390_compat_last_break_set(struct task_struct *target, 1100 - const struct user_regset *regset, 1101 - unsigned int pos, unsigned int count, 1102 - const void *kbuf, const void __user *ubuf) 1103 - { 1104 - return 0; 1105 - } 1106 - 1107 - static const struct user_regset s390_compat_regsets[] = { 1108 - { 1109 - USER_REGSET_NOTE_TYPE(PRSTATUS), 1110 - .n = sizeof(s390_compat_regs) / sizeof(compat_long_t), 1111 - .size = sizeof(compat_long_t), 1112 - .align = sizeof(compat_long_t), 1113 - .regset_get = s390_compat_regs_get, 1114 - .set = s390_compat_regs_set, 1115 - }, 1116 - { 1117 - USER_REGSET_NOTE_TYPE(PRFPREG), 1118 - .n = sizeof(s390_fp_regs) / sizeof(compat_long_t), 1119 - .size = sizeof(compat_long_t), 1120 - .align = sizeof(compat_long_t), 1121 - .regset_get = s390_fpregs_get, 1122 - .set = s390_fpregs_set, 1123 - }, 1124 - { 1125 - USER_REGSET_NOTE_TYPE(S390_SYSTEM_CALL), 1126 - .n = 1, 1127 - .size = sizeof(compat_uint_t), 1128 - .align = sizeof(compat_uint_t), 1129 - .regset_get = s390_system_call_get, 1130 - .set = s390_system_call_set, 1131 - }, 1132 - { 1133 - USER_REGSET_NOTE_TYPE(S390_LAST_BREAK), 1134 - .n = 1, 1135 - .size = sizeof(long), 1136 - .align = sizeof(long), 1137 - .regset_get = s390_compat_last_break_get, 1138 - .set = s390_compat_last_break_set, 1139 - }, 1140 - { 1141 - USER_REGSET_NOTE_TYPE(S390_TDB), 1142 - .n = 1, 1143 - .size = 256, 1144 - .align = 1, 1145 - .regset_get = s390_tdb_get, 1146 - .set = s390_tdb_set, 1147 - }, 1148 - { 1149 - USER_REGSET_NOTE_TYPE(S390_VXRS_LOW), 1150 - .n = __NUM_VXRS_LOW, 1151 - .size = sizeof(__u64), 1152 - .align = sizeof(__u64), 1153 - .regset_get = s390_vxrs_low_get, 1154 - .set = s390_vxrs_low_set, 1155 - }, 1156 - { 1157 - USER_REGSET_NOTE_TYPE(S390_VXRS_HIGH), 1158 - .n = __NUM_VXRS_HIGH, 1159 - .size = sizeof(__vector128), 1160 - .align = sizeof(__vector128), 1161 - .regset_get = s390_vxrs_high_get, 1162 - .set = s390_vxrs_high_set, 1163 - }, 1164 - { 1165 - USER_REGSET_NOTE_TYPE(S390_HIGH_GPRS), 1166 - .n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t), 1167 - .size = sizeof(compat_long_t), 1168 - .align = sizeof(compat_long_t), 1169 - .regset_get = s390_compat_regs_high_get, 1170 - .set = s390_compat_regs_high_set, 1171 - }, 1172 - { 1173 - USER_REGSET_NOTE_TYPE(S390_GS_CB), 1174 - .n = sizeof(struct gs_cb) / sizeof(__u64), 1175 - .size = sizeof(__u64), 1176 - .align = sizeof(__u64), 1177 - .regset_get = s390_gs_cb_get, 1178 - .set = s390_gs_cb_set, 1179 - }, 1180 - { 1181 - USER_REGSET_NOTE_TYPE(S390_GS_BC), 1182 - .n = sizeof(struct gs_cb) / sizeof(__u64), 1183 - .size = sizeof(__u64), 1184 - .align = sizeof(__u64), 1185 - .regset_get = s390_gs_bc_get, 1186 - .set = s390_gs_bc_set, 1187 - }, 1188 - { 1189 - USER_REGSET_NOTE_TYPE(S390_RI_CB), 1190 - .n = sizeof(struct runtime_instr_cb) / sizeof(__u64), 1191 - .size = sizeof(__u64), 1192 - .align = sizeof(__u64), 1193 - .regset_get = s390_runtime_instr_get, 1194 - .set = s390_runtime_instr_set, 1195 - }, 1196 - }; 1197 - 1198 - static const struct user_regset_view user_s390_compat_view = { 1199 - .name = "s390", 1200 - .e_machine = EM_S390, 1201 - .regsets = s390_compat_regsets, 1202 - .n = ARRAY_SIZE(s390_compat_regsets) 1203 - }; 1204 - #endif 1205 - 1206 1300 const struct user_regset_view *task_user_regset_view(struct task_struct *task) 1207 1301 { 1208 - #ifdef CONFIG_COMPAT 1209 - if (test_tsk_thread_flag(task, TIF_31BIT)) 1210 - return &user_s390_compat_view; 1211 - #endif 1212 1302 return &user_s390_view; 1213 1303 } 1214 1304
-1
arch/s390/kernel/setup.c
··· 47 47 #include <linux/kexec.h> 48 48 #include <linux/crash_dump.h> 49 49 #include <linux/memory.h> 50 - #include <linux/compat.h> 51 50 #include <linux/start_kernel.h> 52 51 #include <linux/hugetlb.h> 53 52 #include <linux/kmemleak.h>
+2 -21
arch/s390/kernel/signal.c
··· 27 27 #include <linux/personality.h> 28 28 #include <linux/binfmts.h> 29 29 #include <linux/syscalls.h> 30 - #include <linux/compat.h> 31 30 #include <asm/ucontext.h> 32 31 #include <linux/uaccess.h> 33 32 #include <asm/vdso-symbols.h> ··· 289 290 unsigned long restorer; 290 291 size_t frame_size; 291 292 292 - /* 293 - * gprs_high are only present for a 31-bit task running on 294 - * a 64-bit kernel (see compat_signal.c) but the space for 295 - * gprs_high need to be allocated if vector registers are 296 - * included in the signal frame on a 31-bit system. 297 - */ 298 293 frame_size = sizeof(*frame) - sizeof(frame->sregs_ext); 299 294 if (cpu_has_vx()) 300 295 frame_size += sizeof(frame->sregs_ext); ··· 360 367 size_t frame_size; 361 368 362 369 frame_size = sizeof(struct rt_sigframe) - sizeof(_sigregs_ext); 363 - /* 364 - * gprs_high are only present for a 31-bit task running on 365 - * a 64-bit kernel (see compat_signal.c) but the space for 366 - * gprs_high need to be allocated if vector registers are 367 - * included in the signal frame on a 31-bit system. 368 - */ 369 370 uc_flags = 0; 370 371 if (cpu_has_vx()) { 371 372 frame_size += sizeof(_sigregs_ext); ··· 477 490 clear_pt_regs_flag(regs, PIF_SYSCALL); 478 491 479 492 rseq_signal_deliver(&ksig, regs); 480 - if (is_compat_task()) 481 - handle_signal32(&ksig, oldset, regs); 482 - else 483 - handle_signal(&ksig, oldset, regs); 493 + handle_signal(&ksig, oldset, regs); 484 494 return; 485 495 } 486 496 ··· 490 506 /* Restart with sys_restart_syscall */ 491 507 regs->gprs[2] = regs->orig_gpr2; 492 508 current->restart_block.arch_data = regs->psw.addr; 493 - if (is_compat_task()) 494 - regs->psw.addr = VDSO32_SYMBOL(current, restart_syscall); 495 - else 496 - regs->psw.addr = VDSO64_SYMBOL(current, restart_syscall); 509 + regs->psw.addr = VDSO64_SYMBOL(current, restart_syscall); 497 510 if (test_thread_flag(TIF_SINGLE_STEP)) 498 511 clear_thread_flag(TIF_PER_TRAP); 499 512 break;
-3
arch/s390/kernel/stacktrace.c
··· 8 8 #include <linux/perf_event.h> 9 9 #include <linux/stacktrace.h> 10 10 #include <linux/uaccess.h> 11 - #include <linux/compat.h> 12 11 #include <asm/asm-offsets.h> 13 12 #include <asm/stacktrace.h> 14 13 #include <asm/unwind.h> ··· 106 107 unsigned long ip, sp; 107 108 bool first = true; 108 109 109 - if (is_compat_task()) 110 - return; 111 110 if (!current->mm) 112 111 return; 113 112 ip = instruction_pointer(regs);
+11 -1
arch/s390/kernel/syscall.c
··· 39 39 40 40 #include "entry.h" 41 41 42 + #define __SYSCALL(nr, sym) long __s390x_##sym(struct pt_regs *); 43 + #include <asm/syscall_table.h> 44 + #undef __SYSCALL 45 + 46 + #define __SYSCALL(nr, sym) [nr] = (__s390x_##sym), 47 + const sys_call_ptr_t sys_call_table[__NR_syscalls] = { 48 + #include <asm/syscall_table.h> 49 + }; 50 + #undef __SYSCALL 51 + 42 52 #ifdef CONFIG_SYSVIPC 43 53 /* 44 54 * sys_ipc() is the de-multiplexer for the SysV IPC calls. ··· 132 122 goto out; 133 123 regs->gprs[2] = -ENOSYS; 134 124 if (likely(nr < NR_syscalls)) 135 - regs->gprs[2] = current->thread.sys_call_table[nr](regs); 125 + regs->gprs[2] = sys_call_table[nr](regs); 136 126 out: 137 127 syscall_exit_to_user_mode(regs); 138 128 }
+21 -37
arch/s390/kernel/syscalls/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + kapi := arch/$(SRCARCH)/include/generated/asm 3 + uapi := arch/$(SRCARCH)/include/generated/uapi/asm 2 4 3 - gen := arch/$(ARCH)/include/generated 4 - kapi := $(gen)/asm 5 - uapi := $(gen)/uapi/asm 6 - 7 - syscall := $(src)/syscall.tbl 8 - systbl := $(src)/syscalltbl 9 - 10 - gen-y := $(kapi)/syscall_table.h 11 - kapi-hdrs-y := $(kapi)/unistd_nr.h 12 - uapi-hdrs-y := $(uapi)/unistd_32.h 13 - uapi-hdrs-y += $(uapi)/unistd_64.h 14 - 15 - targets += $(addprefix ../../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y)) 16 - 17 - PHONY += kapi uapi 18 - 19 - kapi: $(gen-y) $(kapi-hdrs-y) 20 - uapi: $(uapi-hdrs-y) 21 - 22 - 23 - # Create output directory if not already present 24 5 $(shell mkdir -p $(uapi) $(kapi)) 25 6 7 + syscall := $(src)/syscall.tbl 8 + syshdr := $(srctree)/scripts/syscallhdr.sh 9 + systbl := $(srctree)/scripts/syscalltbl.sh 10 + 26 11 quiet_cmd_syshdr = SYSHDR $@ 27 - cmd_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$@" < $< > $@ 12 + cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis common,$* $< $@ 28 13 29 - quiet_cmd_sysnr = SYSNR $@ 30 - cmd_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< > $@ 14 + quiet_cmd_systbl = SYSTBL $@ 15 + cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis common,$* $< $@ 31 16 32 - quiet_cmd_syscalls = SYSTBL $@ 33 - cmd_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $< > $@ 34 - 35 - syshdr_abi_unistd_32 := common,32 36 - $(uapi)/unistd_32.h: $(syscall) $(systbl) FORCE 37 - $(call if_changed,syshdr) 38 - 39 - syshdr_abi_unistd_64 := common,64 40 - $(uapi)/unistd_64.h: $(syscall) $(systbl) FORCE 17 + $(uapi)/unistd_%.h: $(syscall) $(syshdr) FORCE 41 18 $(call if_changed,syshdr) 42 19 43 20 $(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE 44 - $(call if_changed,syscalls) 21 + $(call if_changed,systbl) 45 22 46 - sysnr_abi_unistd_nr := common,32,64 47 - $(kapi)/unistd_nr.h: $(syscall) $(systbl) FORCE 48 - $(call if_changed,sysnr) 23 + uapisyshdr-y += unistd_64.h 24 + kapisyshdr-y += syscall_table.h 25 + 26 + uapisyshdr-y := $(addprefix $(uapi)/, $(uapisyshdr-y)) 27 + kapisyshdr-y := $(addprefix $(kapi)/, $(kapisyshdr-y)) 28 + targets += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y)) 29 + 30 + PHONY += all 31 + all: $(uapisyshdr-y) $(kapisyshdr-y) 32 + @:
+390 -466
arch/s390/kernel/syscalls/syscall.tbl
··· 3 3 # System call table for s390 4 4 # 5 5 # Format: 6 + # <nr> <abi> <syscall> <entry> 6 7 # 7 - # <nr> <abi> <syscall> <entry-64bit> <compat-entry> 8 - # 9 - # where <abi> can be common, 64, or 32 8 + # <abi> is always common. 10 9 11 - 1 common exit sys_exit sys_exit 12 - 2 common fork sys_fork sys_fork 13 - 3 common read sys_read compat_sys_s390_read 14 - 4 common write sys_write compat_sys_s390_write 15 - 5 common open sys_open compat_sys_open 16 - 6 common close sys_close sys_close 17 - 7 common restart_syscall sys_restart_syscall sys_restart_syscall 18 - 8 common creat sys_creat sys_creat 19 - 9 common link sys_link sys_link 20 - 10 common unlink sys_unlink sys_unlink 21 - 11 common execve sys_execve compat_sys_execve 22 - 12 common chdir sys_chdir sys_chdir 23 - 13 32 time - sys_time32 24 - 14 common mknod sys_mknod sys_mknod 25 - 15 common chmod sys_chmod sys_chmod 26 - 16 32 lchown - sys_lchown16 27 - 19 common lseek sys_lseek compat_sys_lseek 28 - 20 common getpid sys_getpid sys_getpid 29 - 21 common mount sys_mount sys_mount 30 - 22 common umount sys_oldumount sys_oldumount 31 - 23 32 setuid - sys_setuid16 32 - 24 32 getuid - sys_getuid16 33 - 25 32 stime - sys_stime32 34 - 26 common ptrace sys_ptrace compat_sys_ptrace 35 - 27 common alarm sys_alarm sys_alarm 36 - 29 common pause sys_pause sys_pause 37 - 30 common utime sys_utime sys_utime32 38 - 33 common access sys_access sys_access 39 - 34 common nice sys_nice sys_nice 40 - 36 common sync sys_sync sys_sync 41 - 37 common kill sys_kill sys_kill 42 - 38 common rename sys_rename sys_rename 43 - 39 common mkdir sys_mkdir sys_mkdir 44 - 40 common rmdir sys_rmdir sys_rmdir 45 - 41 common dup sys_dup sys_dup 46 - 42 common pipe sys_pipe sys_pipe 47 - 43 common times sys_times compat_sys_times 48 - 45 common brk sys_brk sys_brk 49 - 46 32 setgid - sys_setgid16 50 - 47 32 getgid - sys_getgid16 51 - 48 common signal sys_signal sys_signal 52 - 49 32 geteuid - sys_geteuid16 53 - 50 32 getegid - sys_getegid16 54 - 51 common acct sys_acct sys_acct 55 - 52 common umount2 sys_umount sys_umount 56 - 54 common ioctl sys_ioctl compat_sys_ioctl 57 - 55 common fcntl sys_fcntl compat_sys_fcntl 58 - 57 common setpgid sys_setpgid sys_setpgid 59 - 60 common umask sys_umask sys_umask 60 - 61 common chroot sys_chroot sys_chroot 61 - 62 common ustat sys_ustat compat_sys_ustat 62 - 63 common dup2 sys_dup2 sys_dup2 63 - 64 common getppid sys_getppid sys_getppid 64 - 65 common getpgrp sys_getpgrp sys_getpgrp 65 - 66 common setsid sys_setsid sys_setsid 66 - 67 common sigaction sys_sigaction compat_sys_sigaction 67 - 70 32 setreuid - sys_setreuid16 68 - 71 32 setregid - sys_setregid16 69 - 72 common sigsuspend sys_sigsuspend sys_sigsuspend 70 - 73 common sigpending sys_sigpending compat_sys_sigpending 71 - 74 common sethostname sys_sethostname sys_sethostname 72 - 75 common setrlimit sys_setrlimit compat_sys_setrlimit 73 - 76 32 getrlimit - compat_sys_old_getrlimit 74 - 77 common getrusage sys_getrusage compat_sys_getrusage 75 - 78 common gettimeofday sys_gettimeofday compat_sys_gettimeofday 76 - 79 common settimeofday sys_settimeofday compat_sys_settimeofday 77 - 80 32 getgroups - sys_getgroups16 78 - 81 32 setgroups - sys_setgroups16 79 - 83 common symlink sys_symlink sys_symlink 80 - 85 common readlink sys_readlink sys_readlink 81 - 86 common uselib sys_uselib sys_uselib 82 - 87 common swapon sys_swapon sys_swapon 83 - 88 common reboot sys_reboot sys_reboot 84 - 89 common readdir - compat_sys_old_readdir 85 - 90 common mmap sys_old_mmap compat_sys_s390_old_mmap 86 - 91 common munmap sys_munmap sys_munmap 87 - 92 common truncate sys_truncate compat_sys_truncate 88 - 93 common ftruncate sys_ftruncate compat_sys_ftruncate 89 - 94 common fchmod sys_fchmod sys_fchmod 90 - 95 32 fchown - sys_fchown16 91 - 96 common getpriority sys_getpriority sys_getpriority 92 - 97 common setpriority sys_setpriority sys_setpriority 93 - 99 common statfs sys_statfs compat_sys_statfs 94 - 100 common fstatfs sys_fstatfs compat_sys_fstatfs 95 - 101 32 ioperm - - 96 - 102 common socketcall sys_socketcall compat_sys_socketcall 97 - 103 common syslog sys_syslog sys_syslog 98 - 104 common setitimer sys_setitimer compat_sys_setitimer 99 - 105 common getitimer sys_getitimer compat_sys_getitimer 100 - 106 common stat sys_newstat compat_sys_newstat 101 - 107 common lstat sys_newlstat compat_sys_newlstat 102 - 108 common fstat sys_newfstat compat_sys_newfstat 103 - 110 common lookup_dcookie - - 104 - 111 common vhangup sys_vhangup sys_vhangup 105 - 112 common idle - - 106 - 114 common wait4 sys_wait4 compat_sys_wait4 107 - 115 common swapoff sys_swapoff sys_swapoff 108 - 116 common sysinfo sys_sysinfo compat_sys_sysinfo 109 - 117 common ipc sys_s390_ipc compat_sys_s390_ipc 110 - 118 common fsync sys_fsync sys_fsync 111 - 119 common sigreturn sys_sigreturn compat_sys_sigreturn 112 - 120 common clone sys_clone sys_clone 113 - 121 common setdomainname sys_setdomainname sys_setdomainname 114 - 122 common uname sys_newuname sys_newuname 115 - 124 common adjtimex sys_adjtimex sys_adjtimex_time32 116 - 125 common mprotect sys_mprotect sys_mprotect 117 - 126 common sigprocmask sys_sigprocmask compat_sys_sigprocmask 118 - 127 common create_module - - 119 - 128 common init_module sys_init_module sys_init_module 120 - 129 common delete_module sys_delete_module sys_delete_module 121 - 130 common get_kernel_syms - - 122 - 131 common quotactl sys_quotactl sys_quotactl 123 - 132 common getpgid sys_getpgid sys_getpgid 124 - 133 common fchdir sys_fchdir sys_fchdir 125 - 134 common bdflush sys_ni_syscall sys_ni_syscall 126 - 135 common sysfs sys_sysfs sys_sysfs 127 - 136 common personality sys_s390_personality sys_s390_personality 128 - 137 common afs_syscall - - 129 - 138 32 setfsuid - sys_setfsuid16 130 - 139 32 setfsgid - sys_setfsgid16 131 - 140 32 _llseek - sys_llseek 132 - 141 common getdents sys_getdents compat_sys_getdents 133 - 142 32 _newselect - compat_sys_select 134 - 142 64 select sys_select - 135 - 143 common flock sys_flock sys_flock 136 - 144 common msync sys_msync sys_msync 137 - 145 common readv sys_readv sys_readv 138 - 146 common writev sys_writev sys_writev 139 - 147 common getsid sys_getsid sys_getsid 140 - 148 common fdatasync sys_fdatasync sys_fdatasync 141 - 149 common _sysctl - - 142 - 150 common mlock sys_mlock sys_mlock 143 - 151 common munlock sys_munlock sys_munlock 144 - 152 common mlockall sys_mlockall sys_mlockall 145 - 153 common munlockall sys_munlockall sys_munlockall 146 - 154 common sched_setparam sys_sched_setparam sys_sched_setparam 147 - 155 common sched_getparam sys_sched_getparam sys_sched_getparam 148 - 156 common sched_setscheduler sys_sched_setscheduler sys_sched_setscheduler 149 - 157 common sched_getscheduler sys_sched_getscheduler sys_sched_getscheduler 150 - 158 common sched_yield sys_sched_yield sys_sched_yield 151 - 159 common sched_get_priority_max sys_sched_get_priority_max sys_sched_get_priority_max 152 - 160 common sched_get_priority_min sys_sched_get_priority_min sys_sched_get_priority_min 153 - 161 common sched_rr_get_interval sys_sched_rr_get_interval sys_sched_rr_get_interval_time32 154 - 162 common nanosleep sys_nanosleep sys_nanosleep_time32 155 - 163 common mremap sys_mremap sys_mremap 156 - 164 32 setresuid - sys_setresuid16 157 - 165 32 getresuid - sys_getresuid16 158 - 167 common query_module - - 159 - 168 common poll sys_poll sys_poll 160 - 169 common nfsservctl - - 161 - 170 32 setresgid - sys_setresgid16 162 - 171 32 getresgid - sys_getresgid16 163 - 172 common prctl sys_prctl sys_prctl 164 - 173 common rt_sigreturn sys_rt_sigreturn compat_sys_rt_sigreturn 165 - 174 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction 166 - 175 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask 167 - 176 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending 168 - 177 common rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time32 169 - 178 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo 170 - 179 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend 171 - 180 common pread64 sys_pread64 compat_sys_s390_pread64 172 - 181 common pwrite64 sys_pwrite64 compat_sys_s390_pwrite64 173 - 182 32 chown - sys_chown16 174 - 183 common getcwd sys_getcwd sys_getcwd 175 - 184 common capget sys_capget sys_capget 176 - 185 common capset sys_capset sys_capset 177 - 186 common sigaltstack sys_sigaltstack compat_sys_sigaltstack 178 - 187 common sendfile sys_sendfile64 compat_sys_sendfile 179 - 188 common getpmsg - - 180 - 189 common putpmsg - - 181 - 190 common vfork sys_vfork sys_vfork 182 - 191 32 ugetrlimit - compat_sys_getrlimit 183 - 191 64 getrlimit sys_getrlimit - 184 - 192 32 mmap2 - compat_sys_s390_mmap2 185 - 193 32 truncate64 - compat_sys_s390_truncate64 186 - 194 32 ftruncate64 - compat_sys_s390_ftruncate64 187 - 195 32 stat64 - compat_sys_s390_stat64 188 - 196 32 lstat64 - compat_sys_s390_lstat64 189 - 197 32 fstat64 - compat_sys_s390_fstat64 190 - 198 32 lchown32 - sys_lchown 191 - 198 64 lchown sys_lchown - 192 - 199 32 getuid32 - sys_getuid 193 - 199 64 getuid sys_getuid - 194 - 200 32 getgid32 - sys_getgid 195 - 200 64 getgid sys_getgid - 196 - 201 32 geteuid32 - sys_geteuid 197 - 201 64 geteuid sys_geteuid - 198 - 202 32 getegid32 - sys_getegid 199 - 202 64 getegid sys_getegid - 200 - 203 32 setreuid32 - sys_setreuid 201 - 203 64 setreuid sys_setreuid - 202 - 204 32 setregid32 - sys_setregid 203 - 204 64 setregid sys_setregid - 204 - 205 32 getgroups32 - sys_getgroups 205 - 205 64 getgroups sys_getgroups - 206 - 206 32 setgroups32 - sys_setgroups 207 - 206 64 setgroups sys_setgroups - 208 - 207 32 fchown32 - sys_fchown 209 - 207 64 fchown sys_fchown - 210 - 208 32 setresuid32 - sys_setresuid 211 - 208 64 setresuid sys_setresuid - 212 - 209 32 getresuid32 - sys_getresuid 213 - 209 64 getresuid sys_getresuid - 214 - 210 32 setresgid32 - sys_setresgid 215 - 210 64 setresgid sys_setresgid - 216 - 211 32 getresgid32 - sys_getresgid 217 - 211 64 getresgid sys_getresgid - 218 - 212 32 chown32 - sys_chown 219 - 212 64 chown sys_chown - 220 - 213 32 setuid32 - sys_setuid 221 - 213 64 setuid sys_setuid - 222 - 214 32 setgid32 - sys_setgid 223 - 214 64 setgid sys_setgid - 224 - 215 32 setfsuid32 - sys_setfsuid 225 - 215 64 setfsuid sys_setfsuid - 226 - 216 32 setfsgid32 - sys_setfsgid 227 - 216 64 setfsgid sys_setfsgid - 228 - 217 common pivot_root sys_pivot_root sys_pivot_root 229 - 218 common mincore sys_mincore sys_mincore 230 - 219 common madvise sys_madvise sys_madvise 231 - 220 common getdents64 sys_getdents64 sys_getdents64 232 - 221 32 fcntl64 - compat_sys_fcntl64 233 - 222 common readahead sys_readahead compat_sys_s390_readahead 234 - 223 32 sendfile64 - compat_sys_sendfile64 235 - 224 common setxattr sys_setxattr sys_setxattr 236 - 225 common lsetxattr sys_lsetxattr sys_lsetxattr 237 - 226 common fsetxattr sys_fsetxattr sys_fsetxattr 238 - 227 common getxattr sys_getxattr sys_getxattr 239 - 228 common lgetxattr sys_lgetxattr sys_lgetxattr 240 - 229 common fgetxattr sys_fgetxattr sys_fgetxattr 241 - 230 common listxattr sys_listxattr sys_listxattr 242 - 231 common llistxattr sys_llistxattr sys_llistxattr 243 - 232 common flistxattr sys_flistxattr sys_flistxattr 244 - 233 common removexattr sys_removexattr sys_removexattr 245 - 234 common lremovexattr sys_lremovexattr sys_lremovexattr 246 - 235 common fremovexattr sys_fremovexattr sys_fremovexattr 247 - 236 common gettid sys_gettid sys_gettid 248 - 237 common tkill sys_tkill sys_tkill 249 - 238 common futex sys_futex sys_futex_time32 250 - 239 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity 251 - 240 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity 252 - 241 common tgkill sys_tgkill sys_tgkill 253 - 243 common io_setup sys_io_setup compat_sys_io_setup 254 - 244 common io_destroy sys_io_destroy sys_io_destroy 255 - 245 common io_getevents sys_io_getevents sys_io_getevents_time32 256 - 246 common io_submit sys_io_submit compat_sys_io_submit 257 - 247 common io_cancel sys_io_cancel sys_io_cancel 258 - 248 common exit_group sys_exit_group sys_exit_group 259 - 249 common epoll_create sys_epoll_create sys_epoll_create 260 - 250 common epoll_ctl sys_epoll_ctl sys_epoll_ctl 261 - 251 common epoll_wait sys_epoll_wait sys_epoll_wait 262 - 252 common set_tid_address sys_set_tid_address sys_set_tid_address 263 - 253 common fadvise64 sys_fadvise64_64 compat_sys_s390_fadvise64 264 - 254 common timer_create sys_timer_create compat_sys_timer_create 265 - 255 common timer_settime sys_timer_settime sys_timer_settime32 266 - 256 common timer_gettime sys_timer_gettime sys_timer_gettime32 267 - 257 common timer_getoverrun sys_timer_getoverrun sys_timer_getoverrun 268 - 258 common timer_delete sys_timer_delete sys_timer_delete 269 - 259 common clock_settime sys_clock_settime sys_clock_settime32 270 - 260 common clock_gettime sys_clock_gettime sys_clock_gettime32 271 - 261 common clock_getres sys_clock_getres sys_clock_getres_time32 272 - 262 common clock_nanosleep sys_clock_nanosleep sys_clock_nanosleep_time32 273 - 264 32 fadvise64_64 - compat_sys_s390_fadvise64_64 274 - 265 common statfs64 sys_statfs64 compat_sys_statfs64 275 - 266 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 276 - 267 common remap_file_pages sys_remap_file_pages sys_remap_file_pages 277 - 268 common mbind sys_mbind sys_mbind 278 - 269 common get_mempolicy sys_get_mempolicy sys_get_mempolicy 279 - 270 common set_mempolicy sys_set_mempolicy sys_set_mempolicy 280 - 271 common mq_open sys_mq_open compat_sys_mq_open 281 - 272 common mq_unlink sys_mq_unlink sys_mq_unlink 282 - 273 common mq_timedsend sys_mq_timedsend sys_mq_timedsend_time32 283 - 274 common mq_timedreceive sys_mq_timedreceive sys_mq_timedreceive_time32 284 - 275 common mq_notify sys_mq_notify compat_sys_mq_notify 285 - 276 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr 286 - 277 common kexec_load sys_kexec_load compat_sys_kexec_load 287 - 278 common add_key sys_add_key sys_add_key 288 - 279 common request_key sys_request_key sys_request_key 289 - 280 common keyctl sys_keyctl compat_sys_keyctl 290 - 281 common waitid sys_waitid compat_sys_waitid 291 - 282 common ioprio_set sys_ioprio_set sys_ioprio_set 292 - 283 common ioprio_get sys_ioprio_get sys_ioprio_get 293 - 284 common inotify_init sys_inotify_init sys_inotify_init 294 - 285 common inotify_add_watch sys_inotify_add_watch sys_inotify_add_watch 295 - 286 common inotify_rm_watch sys_inotify_rm_watch sys_inotify_rm_watch 296 - 287 common migrate_pages sys_migrate_pages sys_migrate_pages 297 - 288 common openat sys_openat compat_sys_openat 298 - 289 common mkdirat sys_mkdirat sys_mkdirat 299 - 290 common mknodat sys_mknodat sys_mknodat 300 - 291 common fchownat sys_fchownat sys_fchownat 301 - 292 common futimesat sys_futimesat sys_futimesat_time32 302 - 293 32 fstatat64 - compat_sys_s390_fstatat64 303 - 293 64 newfstatat sys_newfstatat - 304 - 294 common unlinkat sys_unlinkat sys_unlinkat 305 - 295 common renameat sys_renameat sys_renameat 306 - 296 common linkat sys_linkat sys_linkat 307 - 297 common symlinkat sys_symlinkat sys_symlinkat 308 - 298 common readlinkat sys_readlinkat sys_readlinkat 309 - 299 common fchmodat sys_fchmodat sys_fchmodat 310 - 300 common faccessat sys_faccessat sys_faccessat 311 - 301 common pselect6 sys_pselect6 compat_sys_pselect6_time32 312 - 302 common ppoll sys_ppoll compat_sys_ppoll_time32 313 - 303 common unshare sys_unshare sys_unshare 314 - 304 common set_robust_list sys_set_robust_list compat_sys_set_robust_list 315 - 305 common get_robust_list sys_get_robust_list compat_sys_get_robust_list 316 - 306 common splice sys_splice sys_splice 317 - 307 common sync_file_range sys_sync_file_range compat_sys_s390_sync_file_range 318 - 308 common tee sys_tee sys_tee 319 - 309 common vmsplice sys_vmsplice sys_vmsplice 320 - 310 common move_pages sys_move_pages sys_move_pages 321 - 311 common getcpu sys_getcpu sys_getcpu 322 - 312 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait 323 - 313 common utimes sys_utimes sys_utimes_time32 324 - 314 common fallocate sys_fallocate compat_sys_s390_fallocate 325 - 315 common utimensat sys_utimensat sys_utimensat_time32 326 - 316 common signalfd sys_signalfd compat_sys_signalfd 327 - 317 common timerfd - - 328 - 318 common eventfd sys_eventfd sys_eventfd 329 - 319 common timerfd_create sys_timerfd_create sys_timerfd_create 330 - 320 common timerfd_settime sys_timerfd_settime sys_timerfd_settime32 331 - 321 common timerfd_gettime sys_timerfd_gettime sys_timerfd_gettime32 332 - 322 common signalfd4 sys_signalfd4 compat_sys_signalfd4 333 - 323 common eventfd2 sys_eventfd2 sys_eventfd2 334 - 324 common inotify_init1 sys_inotify_init1 sys_inotify_init1 335 - 325 common pipe2 sys_pipe2 sys_pipe2 336 - 326 common dup3 sys_dup3 sys_dup3 337 - 327 common epoll_create1 sys_epoll_create1 sys_epoll_create1 338 - 328 common preadv sys_preadv compat_sys_preadv 339 - 329 common pwritev sys_pwritev compat_sys_pwritev 340 - 330 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo 341 - 331 common perf_event_open sys_perf_event_open sys_perf_event_open 342 - 332 common fanotify_init sys_fanotify_init sys_fanotify_init 343 - 333 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark 344 - 334 common prlimit64 sys_prlimit64 sys_prlimit64 345 - 335 common name_to_handle_at sys_name_to_handle_at sys_name_to_handle_at 346 - 336 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at 347 - 337 common clock_adjtime sys_clock_adjtime sys_clock_adjtime32 348 - 338 common syncfs sys_syncfs sys_syncfs 349 - 339 common setns sys_setns sys_setns 350 - 340 common process_vm_readv sys_process_vm_readv sys_process_vm_readv 351 - 341 common process_vm_writev sys_process_vm_writev sys_process_vm_writev 352 - 342 common s390_runtime_instr sys_s390_runtime_instr sys_s390_runtime_instr 353 - 343 common kcmp sys_kcmp sys_kcmp 354 - 344 common finit_module sys_finit_module sys_finit_module 355 - 345 common sched_setattr sys_sched_setattr sys_sched_setattr 356 - 346 common sched_getattr sys_sched_getattr sys_sched_getattr 357 - 347 common renameat2 sys_renameat2 sys_renameat2 358 - 348 common seccomp sys_seccomp sys_seccomp 359 - 349 common getrandom sys_getrandom sys_getrandom 360 - 350 common memfd_create sys_memfd_create sys_memfd_create 361 - 351 common bpf sys_bpf sys_bpf 362 - 352 common s390_pci_mmio_write sys_s390_pci_mmio_write sys_s390_pci_mmio_write 363 - 353 common s390_pci_mmio_read sys_s390_pci_mmio_read sys_s390_pci_mmio_read 364 - 354 common execveat sys_execveat compat_sys_execveat 365 - 355 common userfaultfd sys_userfaultfd sys_userfaultfd 366 - 356 common membarrier sys_membarrier sys_membarrier 367 - 357 common recvmmsg sys_recvmmsg compat_sys_recvmmsg_time32 368 - 358 common sendmmsg sys_sendmmsg compat_sys_sendmmsg 369 - 359 common socket sys_socket sys_socket 370 - 360 common socketpair sys_socketpair sys_socketpair 371 - 361 common bind sys_bind sys_bind 372 - 362 common connect sys_connect sys_connect 373 - 363 common listen sys_listen sys_listen 374 - 364 common accept4 sys_accept4 sys_accept4 375 - 365 common getsockopt sys_getsockopt sys_getsockopt 376 - 366 common setsockopt sys_setsockopt sys_setsockopt 377 - 367 common getsockname sys_getsockname sys_getsockname 378 - 368 common getpeername sys_getpeername sys_getpeername 379 - 369 common sendto sys_sendto sys_sendto 380 - 370 common sendmsg sys_sendmsg compat_sys_sendmsg 381 - 371 common recvfrom sys_recvfrom compat_sys_recvfrom 382 - 372 common recvmsg sys_recvmsg compat_sys_recvmsg 383 - 373 common shutdown sys_shutdown sys_shutdown 384 - 374 common mlock2 sys_mlock2 sys_mlock2 385 - 375 common copy_file_range sys_copy_file_range sys_copy_file_range 386 - 376 common preadv2 sys_preadv2 compat_sys_preadv2 387 - 377 common pwritev2 sys_pwritev2 compat_sys_pwritev2 388 - 378 common s390_guarded_storage sys_s390_guarded_storage sys_s390_guarded_storage 389 - 379 common statx sys_statx sys_statx 390 - 380 common s390_sthyi sys_s390_sthyi sys_s390_sthyi 391 - 381 common kexec_file_load sys_kexec_file_load sys_kexec_file_load 392 - 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 393 - 383 common rseq sys_rseq sys_rseq 394 - 384 common pkey_mprotect sys_pkey_mprotect sys_pkey_mprotect 395 - 385 common pkey_alloc sys_pkey_alloc sys_pkey_alloc 396 - 386 common pkey_free sys_pkey_free sys_pkey_free 10 + 1 common exit sys_exit 11 + 2 common fork sys_fork 12 + 3 common read sys_read 13 + 4 common write sys_write 14 + 5 common open sys_open 15 + 6 common close sys_close 16 + 7 common restart_syscall sys_restart_syscall 17 + 8 common creat sys_creat 18 + 9 common link sys_link 19 + 10 common unlink sys_unlink 20 + 11 common execve sys_execve 21 + 12 common chdir sys_chdir 22 + 14 common mknod sys_mknod 23 + 15 common chmod sys_chmod 24 + 19 common lseek sys_lseek 25 + 20 common getpid sys_getpid 26 + 21 common mount sys_mount 27 + 22 common umount sys_oldumount 28 + 26 common ptrace sys_ptrace 29 + 27 common alarm sys_alarm 30 + 29 common pause sys_pause 31 + 30 common utime sys_utime 32 + 33 common access sys_access 33 + 34 common nice sys_nice 34 + 36 common sync sys_sync 35 + 37 common kill sys_kill 36 + 38 common rename sys_rename 37 + 39 common mkdir sys_mkdir 38 + 40 common rmdir sys_rmdir 39 + 41 common dup sys_dup 40 + 42 common pipe sys_pipe 41 + 43 common times sys_times 42 + 45 common brk sys_brk 43 + 48 common signal sys_signal 44 + 51 common acct sys_acct 45 + 52 common umount2 sys_umount 46 + 54 common ioctl sys_ioctl 47 + 55 common fcntl sys_fcntl 48 + 57 common setpgid sys_setpgid 49 + 60 common umask sys_umask 50 + 61 common chroot sys_chroot 51 + 62 common ustat sys_ustat 52 + 63 common dup2 sys_dup2 53 + 64 common getppid sys_getppid 54 + 65 common getpgrp sys_getpgrp 55 + 66 common setsid sys_setsid 56 + 67 common sigaction sys_sigaction 57 + 72 common sigsuspend sys_sigsuspend 58 + 73 common sigpending sys_sigpending 59 + 74 common sethostname sys_sethostname 60 + 75 common setrlimit sys_setrlimit 61 + 77 common getrusage sys_getrusage 62 + 78 common gettimeofday sys_gettimeofday 63 + 79 common settimeofday sys_settimeofday 64 + 83 common symlink sys_symlink 65 + 85 common readlink sys_readlink 66 + 86 common uselib sys_uselib 67 + 87 common swapon sys_swapon 68 + 88 common reboot sys_reboot 69 + 89 common readdir sys_ni_syscall 70 + 90 common mmap sys_old_mmap 71 + 91 common munmap sys_munmap 72 + 92 common truncate sys_truncate 73 + 93 common ftruncate sys_ftruncate 74 + 94 common fchmod sys_fchmod 75 + 96 common getpriority sys_getpriority 76 + 97 common setpriority sys_setpriority 77 + 99 common statfs sys_statfs 78 + 100 common fstatfs sys_fstatfs 79 + 102 common socketcall sys_socketcall 80 + 103 common syslog sys_syslog 81 + 104 common setitimer sys_setitimer 82 + 105 common getitimer sys_getitimer 83 + 106 common stat sys_newstat 84 + 107 common lstat sys_newlstat 85 + 108 common fstat sys_newfstat 86 + 110 common lookup_dcookie sys_ni_syscall 87 + 111 common vhangup sys_vhangup 88 + 112 common idle sys_ni_syscall 89 + 114 common wait4 sys_wait4 90 + 115 common swapoff sys_swapoff 91 + 116 common sysinfo sys_sysinfo 92 + 117 common ipc sys_s390_ipc 93 + 118 common fsync sys_fsync 94 + 119 common sigreturn sys_sigreturn 95 + 120 common clone sys_clone 96 + 121 common setdomainname sys_setdomainname 97 + 122 common uname sys_newuname 98 + 124 common adjtimex sys_adjtimex 99 + 125 common mprotect sys_mprotect 100 + 126 common sigprocmask sys_sigprocmask 101 + 127 common create_module sys_ni_syscall 102 + 128 common init_module sys_init_module 103 + 129 common delete_module sys_delete_module 104 + 130 common get_kernel_syms sys_ni_syscall 105 + 131 common quotactl sys_quotactl 106 + 132 common getpgid sys_getpgid 107 + 133 common fchdir sys_fchdir 108 + 134 common bdflush sys_ni_syscall 109 + 135 common sysfs sys_sysfs 110 + 136 common personality sys_s390_personality 111 + 137 common afs_syscall sys_ni_syscall 112 + 141 common getdents sys_getdents 113 + 142 common select sys_select 114 + 143 common flock sys_flock 115 + 144 common msync sys_msync 116 + 145 common readv sys_readv 117 + 146 common writev sys_writev 118 + 147 common getsid sys_getsid 119 + 148 common fdatasync sys_fdatasync 120 + 149 common _sysctl sys_ni_syscall 121 + 150 common mlock sys_mlock 122 + 151 common munlock sys_munlock 123 + 152 common mlockall sys_mlockall 124 + 153 common munlockall sys_munlockall 125 + 154 common sched_setparam sys_sched_setparam 126 + 155 common sched_getparam sys_sched_getparam 127 + 156 common sched_setscheduler sys_sched_setscheduler 128 + 157 common sched_getscheduler sys_sched_getscheduler 129 + 158 common sched_yield sys_sched_yield 130 + 159 common sched_get_priority_max sys_sched_get_priority_max 131 + 160 common sched_get_priority_min sys_sched_get_priority_min 132 + 161 common sched_rr_get_interval sys_sched_rr_get_interval 133 + 162 common nanosleep sys_nanosleep 134 + 163 common mremap sys_mremap 135 + 167 common query_module sys_ni_syscall 136 + 168 common poll sys_poll 137 + 169 common nfsservctl sys_ni_syscall 138 + 172 common prctl sys_prctl 139 + 173 common rt_sigreturn sys_rt_sigreturn 140 + 174 common rt_sigaction sys_rt_sigaction 141 + 175 common rt_sigprocmask sys_rt_sigprocmask 142 + 176 common rt_sigpending sys_rt_sigpending 143 + 177 common rt_sigtimedwait sys_rt_sigtimedwait 144 + 178 common rt_sigqueueinfo sys_rt_sigqueueinfo 145 + 179 common rt_sigsuspend sys_rt_sigsuspend 146 + 180 common pread64 sys_pread64 147 + 181 common pwrite64 sys_pwrite64 148 + 183 common getcwd sys_getcwd 149 + 184 common capget sys_capget 150 + 185 common capset sys_capset 151 + 186 common sigaltstack sys_sigaltstack 152 + 187 common sendfile sys_sendfile64 153 + 188 common getpmsg sys_ni_syscall 154 + 189 common putpmsg sys_ni_syscall 155 + 190 common vfork sys_vfork 156 + 191 common getrlimit sys_getrlimit 157 + 198 common lchown sys_lchown 158 + 199 common getuid sys_getuid 159 + 200 common getgid sys_getgid 160 + 201 common geteuid sys_geteuid 161 + 202 common getegid sys_getegid 162 + 203 common setreuid sys_setreuid 163 + 204 common setregid sys_setregid 164 + 205 common getgroups sys_getgroups 165 + 206 common setgroups sys_setgroups 166 + 207 common fchown sys_fchown 167 + 208 common setresuid sys_setresuid 168 + 209 common getresuid sys_getresuid 169 + 210 common setresgid sys_setresgid 170 + 211 common getresgid sys_getresgid 171 + 212 common chown sys_chown 172 + 213 common setuid sys_setuid 173 + 214 common setgid sys_setgid 174 + 215 common setfsuid sys_setfsuid 175 + 216 common setfsgid sys_setfsgid 176 + 217 common pivot_root sys_pivot_root 177 + 218 common mincore sys_mincore 178 + 219 common madvise sys_madvise 179 + 220 common getdents64 sys_getdents64 180 + 222 common readahead sys_readahead 181 + 224 common setxattr sys_setxattr 182 + 225 common lsetxattr sys_lsetxattr 183 + 226 common fsetxattr sys_fsetxattr 184 + 227 common getxattr sys_getxattr 185 + 228 common lgetxattr sys_lgetxattr 186 + 229 common fgetxattr sys_fgetxattr 187 + 230 common listxattr sys_listxattr 188 + 231 common llistxattr sys_llistxattr 189 + 232 common flistxattr sys_flistxattr 190 + 233 common removexattr sys_removexattr 191 + 234 common lremovexattr sys_lremovexattr 192 + 235 common fremovexattr sys_fremovexattr 193 + 236 common gettid sys_gettid 194 + 237 common tkill sys_tkill 195 + 238 common futex sys_futex 196 + 239 common sched_setaffinity sys_sched_setaffinity 197 + 240 common sched_getaffinity sys_sched_getaffinity 198 + 241 common tgkill sys_tgkill 199 + 243 common io_setup sys_io_setup 200 + 244 common io_destroy sys_io_destroy 201 + 245 common io_getevents sys_io_getevents 202 + 246 common io_submit sys_io_submit 203 + 247 common io_cancel sys_io_cancel 204 + 248 common exit_group sys_exit_group 205 + 249 common epoll_create sys_epoll_create 206 + 250 common epoll_ctl sys_epoll_ctl 207 + 251 common epoll_wait sys_epoll_wait 208 + 252 common set_tid_address sys_set_tid_address 209 + 253 common fadvise64 sys_fadvise64_64 210 + 254 common timer_create sys_timer_create 211 + 255 common timer_settime sys_timer_settime 212 + 256 common timer_gettime sys_timer_gettime 213 + 257 common timer_getoverrun sys_timer_getoverrun 214 + 258 common timer_delete sys_timer_delete 215 + 259 common clock_settime sys_clock_settime 216 + 260 common clock_gettime sys_clock_gettime 217 + 261 common clock_getres sys_clock_getres 218 + 262 common clock_nanosleep sys_clock_nanosleep 219 + 265 common statfs64 sys_statfs64 220 + 266 common fstatfs64 sys_fstatfs64 221 + 267 common remap_file_pages sys_remap_file_pages 222 + 268 common mbind sys_mbind 223 + 269 common get_mempolicy sys_get_mempolicy 224 + 270 common set_mempolicy sys_set_mempolicy 225 + 271 common mq_open sys_mq_open 226 + 272 common mq_unlink sys_mq_unlink 227 + 273 common mq_timedsend sys_mq_timedsend 228 + 274 common mq_timedreceive sys_mq_timedreceive 229 + 275 common mq_notify sys_mq_notify 230 + 276 common mq_getsetattr sys_mq_getsetattr 231 + 277 common kexec_load sys_kexec_load 232 + 278 common add_key sys_add_key 233 + 279 common request_key sys_request_key 234 + 280 common keyctl sys_keyctl 235 + 281 common waitid sys_waitid 236 + 282 common ioprio_set sys_ioprio_set 237 + 283 common ioprio_get sys_ioprio_get 238 + 284 common inotify_init sys_inotify_init 239 + 285 common inotify_add_watch sys_inotify_add_watch 240 + 286 common inotify_rm_watch sys_inotify_rm_watch 241 + 287 common migrate_pages sys_migrate_pages 242 + 288 common openat sys_openat 243 + 289 common mkdirat sys_mkdirat 244 + 290 common mknodat sys_mknodat 245 + 291 common fchownat sys_fchownat 246 + 292 common futimesat sys_futimesat 247 + 293 common newfstatat sys_newfstatat 248 + 294 common unlinkat sys_unlinkat 249 + 295 common renameat sys_renameat 250 + 296 common linkat sys_linkat 251 + 297 common symlinkat sys_symlinkat 252 + 298 common readlinkat sys_readlinkat 253 + 299 common fchmodat sys_fchmodat 254 + 300 common faccessat sys_faccessat 255 + 301 common pselect6 sys_pselect6 256 + 302 common ppoll sys_ppoll 257 + 303 common unshare sys_unshare 258 + 304 common set_robust_list sys_set_robust_list 259 + 305 common get_robust_list sys_get_robust_list 260 + 306 common splice sys_splice 261 + 307 common sync_file_range sys_sync_file_range 262 + 308 common tee sys_tee 263 + 309 common vmsplice sys_vmsplice 264 + 310 common move_pages sys_move_pages 265 + 311 common getcpu sys_getcpu 266 + 312 common epoll_pwait sys_epoll_pwait 267 + 313 common utimes sys_utimes 268 + 314 common fallocate sys_fallocate 269 + 315 common utimensat sys_utimensat 270 + 316 common signalfd sys_signalfd 271 + 317 common timerfd sys_ni_syscall 272 + 318 common eventfd sys_eventfd 273 + 319 common timerfd_create sys_timerfd_create 274 + 320 common timerfd_settime sys_timerfd_settime 275 + 321 common timerfd_gettime sys_timerfd_gettime 276 + 322 common signalfd4 sys_signalfd4 277 + 323 common eventfd2 sys_eventfd2 278 + 324 common inotify_init1 sys_inotify_init1 279 + 325 common pipe2 sys_pipe2 280 + 326 common dup3 sys_dup3 281 + 327 common epoll_create1 sys_epoll_create1 282 + 328 common preadv sys_preadv 283 + 329 common pwritev sys_pwritev 284 + 330 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo 285 + 331 common perf_event_open sys_perf_event_open 286 + 332 common fanotify_init sys_fanotify_init 287 + 333 common fanotify_mark sys_fanotify_mark 288 + 334 common prlimit64 sys_prlimit64 289 + 335 common name_to_handle_at sys_name_to_handle_at 290 + 336 common open_by_handle_at sys_open_by_handle_at 291 + 337 common clock_adjtime sys_clock_adjtime 292 + 338 common syncfs sys_syncfs 293 + 339 common setns sys_setns 294 + 340 common process_vm_readv sys_process_vm_readv 295 + 341 common process_vm_writev sys_process_vm_writev 296 + 342 common s390_runtime_instr sys_s390_runtime_instr 297 + 343 common kcmp sys_kcmp 298 + 344 common finit_module sys_finit_module 299 + 345 common sched_setattr sys_sched_setattr 300 + 346 common sched_getattr sys_sched_getattr 301 + 347 common renameat2 sys_renameat2 302 + 348 common seccomp sys_seccomp 303 + 349 common getrandom sys_getrandom 304 + 350 common memfd_create sys_memfd_create 305 + 351 common bpf sys_bpf 306 + 352 common s390_pci_mmio_write sys_s390_pci_mmio_write 307 + 353 common s390_pci_mmio_read sys_s390_pci_mmio_read 308 + 354 common execveat sys_execveat 309 + 355 common userfaultfd sys_userfaultfd 310 + 356 common membarrier sys_membarrier 311 + 357 common recvmmsg sys_recvmmsg 312 + 358 common sendmmsg sys_sendmmsg 313 + 359 common socket sys_socket 314 + 360 common socketpair sys_socketpair 315 + 361 common bind sys_bind 316 + 362 common connect sys_connect 317 + 363 common listen sys_listen 318 + 364 common accept4 sys_accept4 319 + 365 common getsockopt sys_getsockopt 320 + 366 common setsockopt sys_setsockopt 321 + 367 common getsockname sys_getsockname 322 + 368 common getpeername sys_getpeername 323 + 369 common sendto sys_sendto 324 + 370 common sendmsg sys_sendmsg 325 + 371 common recvfrom sys_recvfrom 326 + 372 common recvmsg sys_recvmsg 327 + 373 common shutdown sys_shutdown 328 + 374 common mlock2 sys_mlock2 329 + 375 common copy_file_range sys_copy_file_range 330 + 376 common preadv2 sys_preadv2 331 + 377 common pwritev2 sys_pwritev2 332 + 378 common s390_guarded_storage sys_s390_guarded_storage 333 + 379 common statx sys_statx 334 + 380 common s390_sthyi sys_s390_sthyi 335 + 381 common kexec_file_load sys_kexec_file_load 336 + 382 common io_pgetevents sys_io_pgetevents 337 + 383 common rseq sys_rseq 338 + 384 common pkey_mprotect sys_pkey_mprotect 339 + 385 common pkey_alloc sys_pkey_alloc 340 + 386 common pkey_free sys_pkey_free 397 341 # room for arch specific syscalls 398 - 392 64 semtimedop sys_semtimedop - 399 - 393 common semget sys_semget sys_semget 400 - 394 common semctl sys_semctl compat_sys_semctl 401 - 395 common shmget sys_shmget sys_shmget 402 - 396 common shmctl sys_shmctl compat_sys_shmctl 403 - 397 common shmat sys_shmat compat_sys_shmat 404 - 398 common shmdt sys_shmdt sys_shmdt 405 - 399 common msgget sys_msgget sys_msgget 406 - 400 common msgsnd sys_msgsnd compat_sys_msgsnd 407 - 401 common msgrcv sys_msgrcv compat_sys_msgrcv 408 - 402 common msgctl sys_msgctl compat_sys_msgctl 409 - 403 32 clock_gettime64 - sys_clock_gettime 410 - 404 32 clock_settime64 - sys_clock_settime 411 - 405 32 clock_adjtime64 - sys_clock_adjtime 412 - 406 32 clock_getres_time64 - sys_clock_getres 413 - 407 32 clock_nanosleep_time64 - sys_clock_nanosleep 414 - 408 32 timer_gettime64 - sys_timer_gettime 415 - 409 32 timer_settime64 - sys_timer_settime 416 - 410 32 timerfd_gettime64 - sys_timerfd_gettime 417 - 411 32 timerfd_settime64 - sys_timerfd_settime 418 - 412 32 utimensat_time64 - sys_utimensat 419 - 413 32 pselect6_time64 - compat_sys_pselect6_time64 420 - 414 32 ppoll_time64 - compat_sys_ppoll_time64 421 - 416 32 io_pgetevents_time64 - compat_sys_io_pgetevents_time64 422 - 417 32 recvmmsg_time64 - compat_sys_recvmmsg_time64 423 - 418 32 mq_timedsend_time64 - sys_mq_timedsend 424 - 419 32 mq_timedreceive_time64 - sys_mq_timedreceive 425 - 420 32 semtimedop_time64 - sys_semtimedop 426 - 421 32 rt_sigtimedwait_time64 - compat_sys_rt_sigtimedwait_time64 427 - 422 32 futex_time64 - sys_futex 428 - 423 32 sched_rr_get_interval_time64 - sys_sched_rr_get_interval 429 - 424 common pidfd_send_signal sys_pidfd_send_signal sys_pidfd_send_signal 430 - 425 common io_uring_setup sys_io_uring_setup sys_io_uring_setup 431 - 426 common io_uring_enter sys_io_uring_enter sys_io_uring_enter 432 - 427 common io_uring_register sys_io_uring_register sys_io_uring_register 433 - 428 common open_tree sys_open_tree sys_open_tree 434 - 429 common move_mount sys_move_mount sys_move_mount 435 - 430 common fsopen sys_fsopen sys_fsopen 436 - 431 common fsconfig sys_fsconfig sys_fsconfig 437 - 432 common fsmount sys_fsmount sys_fsmount 438 - 433 common fspick sys_fspick sys_fspick 439 - 434 common pidfd_open sys_pidfd_open sys_pidfd_open 440 - 435 common clone3 sys_clone3 sys_clone3 441 - 436 common close_range sys_close_range sys_close_range 442 - 437 common openat2 sys_openat2 sys_openat2 443 - 438 common pidfd_getfd sys_pidfd_getfd sys_pidfd_getfd 444 - 439 common faccessat2 sys_faccessat2 sys_faccessat2 445 - 440 common process_madvise sys_process_madvise sys_process_madvise 446 - 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 447 - 442 common mount_setattr sys_mount_setattr sys_mount_setattr 448 - 443 common quotactl_fd sys_quotactl_fd sys_quotactl_fd 449 - 444 common landlock_create_ruleset sys_landlock_create_ruleset sys_landlock_create_ruleset 450 - 445 common landlock_add_rule sys_landlock_add_rule sys_landlock_add_rule 451 - 446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self 452 - 447 common memfd_secret sys_memfd_secret sys_memfd_secret 453 - 448 common process_mrelease sys_process_mrelease sys_process_mrelease 454 - 449 common futex_waitv sys_futex_waitv sys_futex_waitv 455 - 450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node 456 - 451 common cachestat sys_cachestat sys_cachestat 457 - 452 common fchmodat2 sys_fchmodat2 sys_fchmodat2 458 - 453 common map_shadow_stack sys_map_shadow_stack sys_map_shadow_stack 459 - 454 common futex_wake sys_futex_wake sys_futex_wake 460 - 455 common futex_wait sys_futex_wait sys_futex_wait 461 - 456 common futex_requeue sys_futex_requeue sys_futex_requeue 462 - 457 common statmount sys_statmount sys_statmount 463 - 458 common listmount sys_listmount sys_listmount 464 - 459 common lsm_get_self_attr sys_lsm_get_self_attr sys_lsm_get_self_attr 465 - 460 common lsm_set_self_attr sys_lsm_set_self_attr sys_lsm_set_self_attr 466 - 461 common lsm_list_modules sys_lsm_list_modules sys_lsm_list_modules 467 - 462 common mseal sys_mseal sys_mseal 468 - 463 common setxattrat sys_setxattrat sys_setxattrat 469 - 464 common getxattrat sys_getxattrat sys_getxattrat 470 - 465 common listxattrat sys_listxattrat sys_listxattrat 471 - 466 common removexattrat sys_removexattrat sys_removexattrat 472 - 467 common open_tree_attr sys_open_tree_attr sys_open_tree_attr 473 - 468 common file_getattr sys_file_getattr sys_file_getattr 474 - 469 common file_setattr sys_file_setattr sys_file_setattr 342 + 392 common semtimedop sys_semtimedop 343 + 393 common semget sys_semget 344 + 394 common semctl sys_semctl 345 + 395 common shmget sys_shmget 346 + 396 common shmctl sys_shmctl 347 + 397 common shmat sys_shmat 348 + 398 common shmdt sys_shmdt 349 + 399 common msgget sys_msgget 350 + 400 common msgsnd sys_msgsnd 351 + 401 common msgrcv sys_msgrcv 352 + 402 common msgctl sys_msgctl 353 + 424 common pidfd_send_signal sys_pidfd_send_signal 354 + 425 common io_uring_setup sys_io_uring_setup 355 + 426 common io_uring_enter sys_io_uring_enter 356 + 427 common io_uring_register sys_io_uring_register 357 + 428 common open_tree sys_open_tree 358 + 429 common move_mount sys_move_mount 359 + 430 common fsopen sys_fsopen 360 + 431 common fsconfig sys_fsconfig 361 + 432 common fsmount sys_fsmount 362 + 433 common fspick sys_fspick 363 + 434 common pidfd_open sys_pidfd_open 364 + 435 common clone3 sys_clone3 365 + 436 common close_range sys_close_range 366 + 437 common openat2 sys_openat2 367 + 438 common pidfd_getfd sys_pidfd_getfd 368 + 439 common faccessat2 sys_faccessat2 369 + 440 common process_madvise sys_process_madvise 370 + 441 common epoll_pwait2 sys_epoll_pwait2 371 + 442 common mount_setattr sys_mount_setattr 372 + 443 common quotactl_fd sys_quotactl_fd 373 + 444 common landlock_create_ruleset sys_landlock_create_ruleset 374 + 445 common landlock_add_rule sys_landlock_add_rule 375 + 446 common landlock_restrict_self sys_landlock_restrict_self 376 + 447 common memfd_secret sys_memfd_secret 377 + 448 common process_mrelease sys_process_mrelease 378 + 449 common futex_waitv sys_futex_waitv 379 + 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 380 + 451 common cachestat sys_cachestat 381 + 452 common fchmodat2 sys_fchmodat2 382 + 453 common map_shadow_stack sys_map_shadow_stack 383 + 454 common futex_wake sys_futex_wake 384 + 455 common futex_wait sys_futex_wait 385 + 456 common futex_requeue sys_futex_requeue 386 + 457 common statmount sys_statmount 387 + 458 common listmount sys_listmount 388 + 459 common lsm_get_self_attr sys_lsm_get_self_attr 389 + 460 common lsm_set_self_attr sys_lsm_set_self_attr 390 + 461 common lsm_list_modules sys_lsm_list_modules 391 + 462 common mseal sys_mseal 392 + 463 common setxattrat sys_setxattrat 393 + 464 common getxattrat sys_getxattrat 394 + 465 common listxattrat sys_listxattrat 395 + 466 common removexattrat sys_removexattrat 396 + 467 common open_tree_attr sys_open_tree_attr 397 + 468 common file_getattr sys_file_getattr 398 + 469 common file_setattr sys_file_setattr
-232
arch/s390/kernel/syscalls/syscalltbl
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - # 4 - # Generate system call table and header files 5 - # 6 - # Copyright IBM Corp. 2018 7 - # Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 8 - 9 - # 10 - # File path to the system call table definition. 11 - # You can set the path with the -i option. If omitted, 12 - # system call table definitions are read from standard input. 13 - # 14 - SYSCALL_TBL="" 15 - 16 - 17 - create_syscall_table_entries() 18 - { 19 - local nr abi name entry64 entry32 _ignore 20 - local temp=$(mktemp ${TMPDIR:-/tmp}/syscalltbl-common.XXXXXXXXX) 21 - 22 - ( 23 - # 24 - # Initialize with 0 to create an NI_SYSCALL for 0 25 - # 26 - local prev_nr=0 prev_32=sys_ni_syscall prev_64=sys_ni_syscall 27 - while read nr abi name entry64 entry32 _ignore; do 28 - test x$entry32 = x- && entry32=sys_ni_syscall 29 - test x$entry64 = x- && entry64=sys_ni_syscall 30 - 31 - if test $prev_nr -eq $nr; then 32 - # 33 - # Same syscall but different ABI, just update 34 - # the respective entry point 35 - # 36 - case $abi in 37 - 32) 38 - prev_32=$entry32 39 - ;; 40 - 64) 41 - prev_64=$entry64 42 - ;; 43 - esac 44 - continue; 45 - else 46 - printf "%d\t%s\t%s\n" $prev_nr $prev_64 $prev_32 47 - fi 48 - 49 - prev_nr=$nr 50 - prev_64=$entry64 51 - prev_32=$entry32 52 - done 53 - printf "%d\t%s\t%s\n" $prev_nr $prev_64 $prev_32 54 - ) >> $temp 55 - 56 - # 57 - # Check for duplicate syscall numbers 58 - # 59 - if ! cat $temp |cut -f1 |uniq -d 2>&1; then 60 - echo "Error: generated system call table contains duplicate entries: $temp" >&2 61 - exit 1 62 - fi 63 - 64 - # 65 - # Generate syscall table 66 - # 67 - prev_nr=0 68 - while read nr entry64 entry32; do 69 - while test $prev_nr -lt $((nr - 1)); do 70 - printf "NI_SYSCALL\n" 71 - prev_nr=$((prev_nr + 1)) 72 - done 73 - if test x$entry64 = xsys_ni_syscall && 74 - test x$entry32 = xsys_ni_syscall; then 75 - printf "NI_SYSCALL\n" 76 - else 77 - printf "SYSCALL(%s,%s)\n" $entry64 $entry32 78 - fi 79 - prev_nr=$nr 80 - done < $temp 81 - rm $temp 82 - } 83 - 84 - generate_syscall_table() 85 - { 86 - cat <<-EoHEADER 87 - /* SPDX-License-Identifier: GPL-2.0 */ 88 - /* 89 - * Definitions for sys_call_table, each line represents an 90 - * entry in the table in the form 91 - * SYSCALL(64 bit syscall, 31 bit emulated syscall) 92 - * 93 - * This file is meant to be included from entry.S. 94 - */ 95 - 96 - #define NI_SYSCALL SYSCALL(sys_ni_syscall,sys_ni_syscall) 97 - 98 - EoHEADER 99 - grep -Ev '^(#|[[:blank:]]*$)' $SYSCALL_TBL \ 100 - |sort -k1 -n \ 101 - |create_syscall_table_entries 102 - } 103 - 104 - create_header_defines() 105 - { 106 - local nr abi name _ignore 107 - 108 - while read nr abi name _ignore; do 109 - printf "#define __NR_%s %d\n" $name $nr 110 - done 111 - } 112 - 113 - normalize_fileguard() 114 - { 115 - local fileguard="$1" 116 - 117 - echo "$1" |tr '[[:lower:]]' '[[:upper:]]' \ 118 - |sed -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g' 119 - } 120 - 121 - generate_syscall_header() 122 - { 123 - local abis=$(echo "($1)" | tr ',' '|') 124 - local filename="$2" 125 - local fileguard suffix 126 - 127 - if test "$filename"; then 128 - fileguard=$(normalize_fileguard "__UAPI_ASM_S390_$2") 129 - else 130 - case "$abis" in 131 - *64*) suffix=64 ;; 132 - *32*) suffix=32 ;; 133 - esac 134 - fileguard=$(normalize_fileguard "__UAPI_ASM_S390_SYSCALLS_$suffix") 135 - fi 136 - 137 - cat <<-EoHEADER 138 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 139 - #ifndef ${fileguard} 140 - #define ${fileguard} 141 - 142 - EoHEADER 143 - 144 - grep -E "^[[:digit:]]+[[:space:]]+${abis}" $SYSCALL_TBL \ 145 - |sort -k1 -n \ 146 - |create_header_defines 147 - 148 - cat <<-EoFOOTER 149 - 150 - #endif /* ${fileguard} */ 151 - EoFOOTER 152 - } 153 - 154 - __max_syscall_nr() 155 - { 156 - local abis=$(echo "($1)" | tr ',' '|') 157 - 158 - grep -E "^[[:digit:]]+[[:space:]]+${abis}" $SYSCALL_TBL \ 159 - |sed -ne 's/^\([[:digit:]]*\)[[:space:]].*/\1/p' \ 160 - |sort -n \ 161 - |tail -1 162 - } 163 - 164 - 165 - generate_syscall_nr() 166 - { 167 - local abis="$1" 168 - local max_syscall_nr num_syscalls 169 - 170 - max_syscall_nr=$(__max_syscall_nr "$abis") 171 - num_syscalls=$((max_syscall_nr + 1)) 172 - 173 - cat <<-EoHEADER 174 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 175 - #ifndef __ASM_S390_SYSCALLS_NR 176 - #define __ASM_S390_SYSCALLS_NR 177 - 178 - #define NR_syscalls ${num_syscalls} 179 - 180 - #endif /* __ASM_S390_SYSCALLS_NR */ 181 - EoHEADER 182 - } 183 - 184 - 185 - # 186 - # Parse command line arguments 187 - # 188 - do_syscall_header="" 189 - do_syscall_table="" 190 - do_syscall_nr="" 191 - output_file="" 192 - abi_list="common,64" 193 - filename="" 194 - while getopts ":HNSXi:a:f:" arg; do 195 - case $arg in 196 - a) 197 - abi_list="$OPTARG" 198 - ;; 199 - i) 200 - SYSCALL_TBL="$OPTARG" 201 - ;; 202 - f) 203 - filename=${OPTARG##*/} 204 - ;; 205 - H) 206 - do_syscall_header=1 207 - ;; 208 - N) 209 - do_syscall_nr=1 210 - ;; 211 - S) 212 - do_syscall_table=1 213 - ;; 214 - X) 215 - set -x 216 - ;; 217 - :) 218 - echo "Missing argument for -$OPTARG" >&2 219 - exit 1 220 - ;; 221 - \?) 222 - echo "Invalid option specified" >&2 223 - exit 1 224 - ;; 225 - esac 226 - done 227 - 228 - test "$do_syscall_header" && generate_syscall_header "$abi_list" "$filename" 229 - test "$do_syscall_table" && generate_syscall_table 230 - test "$do_syscall_nr" && generate_syscall_nr "$abi_list" 231 - 232 - exit 0
+2 -4
arch/s390/kernel/uprobes.c
··· 8 8 9 9 #include <linux/uaccess.h> 10 10 #include <linux/uprobes.h> 11 - #include <linux/compat.h> 12 11 #include <linux/kdebug.h> 13 12 #include <linux/sched/task_stack.h> 14 13 ··· 28 29 { 29 30 if (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_24BIT) 30 31 return -EINVAL; 31 - if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) 32 + if (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) 32 33 return -EINVAL; 33 34 clear_thread_flag(TIF_PER_TRAP); 34 35 auprobe->saved_per = psw_bits(regs->psw).per; ··· 367 368 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) 368 369 { 369 370 if ((psw_bits(regs->psw).eaba == PSW_BITS_AMODE_24BIT) || 370 - ((psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) && 371 - !is_compat_task())) { 371 + (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)) { 372 372 regs->psw.addr = __rewind_psw(regs->psw, UPROBE_SWBP_INSN_SIZE); 373 373 do_report_trap(regs, SIGILL, ILL_ILLADR, NULL); 374 374 return true;
+3 -23
arch/s390/kernel/vdso.c
··· 7 7 */ 8 8 9 9 #include <linux/binfmts.h> 10 - #include <linux/compat.h> 11 10 #include <linux/elf.h> 12 11 #include <linux/errno.h> 13 12 #include <linux/init.h> ··· 23 24 #include <asm/vdso.h> 24 25 25 26 extern char vdso64_start[], vdso64_end[]; 26 - extern char vdso32_start[], vdso32_end[]; 27 27 28 28 static int vdso_mremap(const struct vm_special_mapping *sm, 29 29 struct vm_area_struct *vma) ··· 32 34 } 33 35 34 36 static struct vm_special_mapping vdso64_mapping = { 35 - .name = "[vdso]", 36 - .mremap = vdso_mremap, 37 - }; 38 - 39 - static struct vm_special_mapping vdso32_mapping = { 40 37 .name = "[vdso]", 41 38 .mremap = vdso_mremap, 42 39 }; ··· 55 62 if (mmap_write_lock_killable(mm)) 56 63 return -EINTR; 57 64 58 - if (is_compat_task()) { 59 - vdso_text_len = vdso32_end - vdso32_start; 60 - vdso_mapping = &vdso32_mapping; 61 - } else { 62 - vdso_text_len = vdso64_end - vdso64_start; 63 - vdso_mapping = &vdso64_mapping; 64 - } 65 + vdso_text_len = vdso64_end - vdso64_start; 66 + vdso_mapping = &vdso64_mapping; 65 67 vvar_start = get_unmapped_area(NULL, addr, vdso_mapping_len, 0, 0); 66 68 rc = vvar_start; 67 69 if (IS_ERR_VALUE(vvar_start)) ··· 110 122 111 123 unsigned long vdso_text_size(void) 112 124 { 113 - unsigned long size; 114 - 115 - if (is_compat_task()) 116 - size = vdso32_end - vdso32_start; 117 - else 118 - size = vdso64_end - vdso64_start; 119 - return PAGE_ALIGN(size); 125 + return PAGE_ALIGN(vdso64_end - vdso64_start); 120 126 } 121 127 122 128 unsigned long vdso_size(void) ··· 162 180 { 163 181 vdso_apply_alternatives(); 164 182 vdso64_mapping.pages = vdso_setup_pages(vdso64_start, vdso64_end); 165 - if (IS_ENABLED(CONFIG_COMPAT)) 166 - vdso32_mapping.pages = vdso_setup_pages(vdso32_start, vdso32_end); 167 183 return 0; 168 184 } 169 185 arch_initcall(vdso_init);
-2
arch/s390/kernel/vdso32/.gitignore
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - vdso32.lds
-64
arch/s390/kernel/vdso32/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - # List of files in the vdso 3 - 4 - # Include the generic Makefile to check the built vdso. 5 - include $(srctree)/lib/vdso/Makefile.include 6 - obj-vdso32 = vdso_user_wrapper-32.o note-32.o 7 - 8 - # Build rules 9 - 10 - targets := $(obj-vdso32) vdso32.so vdso32.so.dbg 11 - obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) 12 - 13 - KBUILD_AFLAGS += -DBUILD_VDSO 14 - KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING 15 - 16 - KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS)) 17 - KBUILD_AFLAGS_32 += -m31 -s 18 - 19 - KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS)) 20 - KBUILD_CFLAGS_32 := $(filter-out -mpacked-stack,$(KBUILD_CFLAGS)) 21 - KBUILD_CFLAGS_32 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_32)) 22 - KBUILD_CFLAGS_32 := $(filter-out -fno-asynchronous-unwind-tables,$(KBUILD_CFLAGS_32)) 23 - KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin -fasynchronous-unwind-tables 24 - 25 - LDFLAGS_vdso32.so.dbg += -shared -soname=linux-vdso32.so.1 \ 26 - --hash-style=both --build-id=sha1 -melf_s390 -T 27 - 28 - $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32) 29 - $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32) 30 - 31 - obj-y += vdso32_wrapper.o 32 - targets += vdso32.lds 33 - CPPFLAGS_vdso32.lds += -P -C -U$(ARCH) 34 - 35 - # Force dependency (incbin is bad) 36 - $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so 37 - 38 - quiet_cmd_vdso_and_check = VDSO $@ 39 - cmd_vdso_and_check = $(cmd_ld); $(cmd_vdso_check) 40 - 41 - $(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) FORCE 42 - $(call if_changed,vdso_and_check) 43 - 44 - # strip rule for the .so file 45 - $(obj)/%.so: OBJCOPYFLAGS := -S 46 - $(obj)/%.so: $(obj)/%.so.dbg FORCE 47 - $(call if_changed,objcopy) 48 - 49 - $(obj-vdso32): %-32.o: %.S FORCE 50 - $(call if_changed_dep,vdso32as) 51 - 52 - # actual build commands 53 - quiet_cmd_vdso32as = VDSO32A $@ 54 - cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $< 55 - quiet_cmd_vdso32cc = VDSO32C $@ 56 - cmd_vdso32cc = $(CC) $(c_flags) -c -o $@ $< 57 - 58 - # Generate VDSO offsets using helper script 59 - gen-vdsosym := $(src)/gen_vdso_offsets.sh 60 - quiet_cmd_vdsosym = VDSOSYM $@ 61 - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ 62 - 63 - include/generated/vdso32-offsets.h: $(obj)/vdso32.so.dbg FORCE 64 - $(call if_changed,vdsosym)
-15
arch/s390/kernel/vdso32/gen_vdso_offsets.sh
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - 4 - # 5 - # Match symbols in the DSO that look like VDSO_*; produce a header file 6 - # of constant offsets into the shared object. 7 - # 8 - # Doing this inside the Makefile will break the $(filter-out) function, 9 - # causing Kbuild to rebuild the vdso-offsets header file every time. 10 - # 11 - # Inspired by arm64 version. 12 - # 13 - 14 - LC_ALL=C 15 - sed -n 's/\([0-9a-f]*\) . __kernel_compat_\(.*\)/\#define vdso32_offset_\2\t0x\1/p'
-13
arch/s390/kernel/vdso32/note.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text. 4 - * Here we can supply some information useful to userland. 5 - */ 6 - 7 - #include <linux/uts.h> 8 - #include <linux/version.h> 9 - #include <linux/elfnote.h> 10 - 11 - ELFNOTE_START(Linux, 0, "a") 12 - .long LINUX_VERSION_CODE 13 - ELFNOTE_END
-140
arch/s390/kernel/vdso32/vdso32.lds.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * This is the infamous ld script for the 64 bits vdso 4 - * library 5 - */ 6 - 7 - #include <asm/page.h> 8 - #include <asm/vdso.h> 9 - #include <vdso/datapage.h> 10 - 11 - OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") 12 - OUTPUT_ARCH(s390:31-bit) 13 - 14 - SECTIONS 15 - { 16 - VDSO_VVAR_SYMS 17 - 18 - . = SIZEOF_HEADERS; 19 - 20 - .hash : { *(.hash) } :text 21 - .gnu.hash : { *(.gnu.hash) } 22 - .dynsym : { *(.dynsym) } 23 - .dynstr : { *(.dynstr) } 24 - .gnu.version : { *(.gnu.version) } 25 - .gnu.version_d : { *(.gnu.version_d) } 26 - .gnu.version_r : { *(.gnu.version_r) } 27 - 28 - .note : { *(.note.*) } :text :note 29 - 30 - . = ALIGN(16); 31 - .text : { 32 - *(.text .stub .text.* .gnu.linkonce.t.*) 33 - } :text 34 - PROVIDE(__etext = .); 35 - PROVIDE(_etext = .); 36 - PROVIDE(etext = .); 37 - 38 - /* 39 - * Other stuff is appended to the text segment: 40 - */ 41 - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 42 - .rodata1 : { *(.rodata1) } 43 - 44 - .dynamic : { *(.dynamic) } :text :dynamic 45 - 46 - .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr 47 - .eh_frame : { KEEP (*(.eh_frame)) } :text 48 - .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } 49 - 50 - .rela.dyn ALIGN(8) : { *(.rela.dyn) } 51 - .got ALIGN(8) : { *(.got .toc) } 52 - .got.plt ALIGN(8) : { *(.got.plt) } 53 - 54 - _end = .; 55 - PROVIDE(end = .); 56 - 57 - /* 58 - * Stabs debugging sections are here too. 59 - */ 60 - .stab 0 : { *(.stab) } 61 - .stabstr 0 : { *(.stabstr) } 62 - .stab.excl 0 : { *(.stab.excl) } 63 - .stab.exclstr 0 : { *(.stab.exclstr) } 64 - .stab.index 0 : { *(.stab.index) } 65 - .stab.indexstr 0 : { *(.stab.indexstr) } 66 - .comment 0 : { *(.comment) } 67 - 68 - /* 69 - * DWARF debug sections. 70 - * Symbols in the DWARF debugging sections are relative to the 71 - * beginning of the section so we begin them at 0. 72 - */ 73 - /* DWARF 1 */ 74 - .debug 0 : { *(.debug) } 75 - .line 0 : { *(.line) } 76 - /* GNU DWARF 1 extensions */ 77 - .debug_srcinfo 0 : { *(.debug_srcinfo) } 78 - .debug_sfnames 0 : { *(.debug_sfnames) } 79 - /* DWARF 1.1 and DWARF 2 */ 80 - .debug_aranges 0 : { *(.debug_aranges) } 81 - .debug_pubnames 0 : { *(.debug_pubnames) } 82 - /* DWARF 2 */ 83 - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 84 - .debug_abbrev 0 : { *(.debug_abbrev) } 85 - .debug_line 0 : { *(.debug_line) } 86 - .debug_frame 0 : { *(.debug_frame) } 87 - .debug_str 0 : { *(.debug_str) } 88 - .debug_loc 0 : { *(.debug_loc) } 89 - .debug_macinfo 0 : { *(.debug_macinfo) } 90 - /* SGI/MIPS DWARF 2 extensions */ 91 - .debug_weaknames 0 : { *(.debug_weaknames) } 92 - .debug_funcnames 0 : { *(.debug_funcnames) } 93 - .debug_typenames 0 : { *(.debug_typenames) } 94 - .debug_varnames 0 : { *(.debug_varnames) } 95 - /* DWARF 3 */ 96 - .debug_pubtypes 0 : { *(.debug_pubtypes) } 97 - .debug_ranges 0 : { *(.debug_ranges) } 98 - .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } 99 - 100 - /DISCARD/ : { 101 - *(.note.GNU-stack) 102 - *(.branch_lt) 103 - *(.data .data.* .gnu.linkonce.d.* .sdata*) 104 - *(.bss .sbss .dynbss .dynsbss) 105 - } 106 - } 107 - 108 - /* 109 - * Very old versions of ld do not recognize this name token; use the constant. 110 - */ 111 - #define PT_GNU_EH_FRAME 0x6474e550 112 - 113 - /* 114 - * We must supply the ELF program headers explicitly to get just one 115 - * PT_LOAD segment, and set the flags explicitly to make segments read-only. 116 - */ 117 - PHDRS 118 - { 119 - text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ 120 - dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ 121 - note PT_NOTE FLAGS(4); /* PF_R */ 122 - eh_frame_hdr PT_GNU_EH_FRAME; 123 - } 124 - 125 - /* 126 - * This controls what symbols we export from the DSO. 127 - */ 128 - VERSION 129 - { 130 - VDSO_VERSION_STRING { 131 - global: 132 - /* 133 - * Has to be there for the kernel to find 134 - */ 135 - __kernel_compat_restart_syscall; 136 - __kernel_compat_rt_sigreturn; 137 - __kernel_compat_sigreturn; 138 - local: *; 139 - }; 140 - }
-15
arch/s390/kernel/vdso32/vdso32_wrapper.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #include <linux/init.h> 3 - #include <linux/linkage.h> 4 - #include <asm/page.h> 5 - 6 - __PAGE_ALIGNED_DATA 7 - 8 - .globl vdso32_start, vdso32_end 9 - .balign PAGE_SIZE 10 - vdso32_start: 11 - .incbin "arch/s390/kernel/vdso32/vdso32.so" 12 - .balign PAGE_SIZE 13 - vdso32_end: 14 - 15 - .previous
-22
arch/s390/kernel/vdso32/vdso_user_wrapper.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - 3 - #include <linux/linkage.h> 4 - #include <asm/unistd.h> 5 - #include <asm/dwarf.h> 6 - 7 - .macro vdso_syscall func,syscall 8 - .globl __kernel_compat_\func 9 - .type __kernel_compat_\func,@function 10 - __ALIGN 11 - __kernel_compat_\func: 12 - CFI_STARTPROC 13 - svc \syscall 14 - /* Make sure we notice when a syscall returns, which shouldn't happen */ 15 - .word 0 16 - CFI_ENDPROC 17 - .size __kernel_compat_\func,.-__kernel_compat_\func 18 - .endm 19 - 20 - vdso_syscall restart_syscall,__NR_restart_syscall 21 - vdso_syscall sigreturn,__NR_sigreturn 22 - vdso_syscall rt_sigreturn,__NR_rt_sigreturn
+1 -1
arch/s390/kvm/priv.c
··· 754 754 int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu) 755 755 { 756 756 psw_t *gpsw = &vcpu->arch.sie_block->gpsw; 757 - psw_compat_t new_psw; 757 + psw32_t new_psw; 758 758 u64 addr; 759 759 int rc; 760 760 u8 ar;
-1
arch/s390/mm/fault.c
··· 23 23 #include <linux/ptrace.h> 24 24 #include <linux/mman.h> 25 25 #include <linux/mm.h> 26 - #include <linux/compat.h> 27 26 #include <linux/smp.h> 28 27 #include <linux/kdebug.h> 29 28 #include <linux/init.h>
-1
arch/s390/mm/mmap.c
··· 15 15 #include <linux/sched/signal.h> 16 16 #include <linux/sched/mm.h> 17 17 #include <linux/random.h> 18 - #include <linux/compat.h> 19 18 #include <linux/security.h> 20 19 #include <linux/hugetlb.h> 21 20 #include <asm/elf.h>
+1 -3
arch/s390/pci/pci_clp.c
··· 9 9 #define KMSG_COMPONENT "zpci" 10 10 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 11 11 12 - #include <linux/compat.h> 13 12 #include <linux/kernel.h> 14 13 #include <linux/miscdevice.h> 15 14 #include <linux/slab.h> ··· 650 651 if (cmd != CLP_SYNC) 651 652 return -EINVAL; 652 653 653 - argp = is_compat_task() ? compat_ptr(arg) : (void __user *) arg; 654 + argp = (void __user *)arg; 654 655 if (copy_from_user(&req, argp, sizeof(req))) 655 656 return -EFAULT; 656 657 if (req.r != 0) ··· 668 669 .open = nonseekable_open, 669 670 .release = clp_misc_release, 670 671 .unlocked_ioctl = clp_misc_ioctl, 671 - .compat_ioctl = clp_misc_ioctl, 672 672 }; 673 673 674 674 static struct miscdevice clp_misc_device = {
-1
drivers/s390/block/dasd.c
··· 3350 3350 .open = dasd_open, 3351 3351 .release = dasd_release, 3352 3352 .ioctl = dasd_ioctl, 3353 - .compat_ioctl = dasd_ioctl, 3354 3353 .getgeo = dasd_getgeo, 3355 3354 .set_read_only = dasd_set_read_only, 3356 3355 };
-11
drivers/s390/block/dasd_eckd.c
··· 16 16 #include <linux/hdreg.h> /* HDIO_GETGEO */ 17 17 #include <linux/bio.h> 18 18 #include <linux/module.h> 19 - #include <linux/compat.h> 20 19 #include <linux/init.h> 21 20 #include <linux/seq_file.h> 22 21 #include <linux/uaccess.h> ··· 5388 5389 rc = -EFAULT; 5389 5390 if (copy_from_user(&usrparm, argp, sizeof(usrparm))) 5390 5391 goto out; 5391 - if (is_compat_task()) { 5392 - /* Make sure pointers are sane even on 31 bit. */ 5393 - rc = -EINVAL; 5394 - if ((usrparm.psf_data >> 32) != 0) 5395 - goto out; 5396 - if ((usrparm.rssd_result >> 32) != 0) 5397 - goto out; 5398 - usrparm.psf_data &= 0x7fffffffULL; 5399 - usrparm.rssd_result &= 0x7fffffffULL; 5400 - } 5401 5392 /* at least 2 bytes are accessed and should be allocated */ 5402 5393 if (usrparm.psf_data_len < 2) { 5403 5394 DBF_DEV_EVENT(DBF_WARNING, device,
+1 -5
drivers/s390/block/dasd_ioctl.c
··· 11 11 */ 12 12 13 13 #include <linux/interrupt.h> 14 - #include <linux/compat.h> 15 14 #include <linux/export.h> 16 15 #include <linux/major.h> 17 16 #include <linux/fs.h> ··· 615 616 void __user *argp; 616 617 int rc; 617 618 618 - if (is_compat_task()) 619 - argp = compat_ptr(arg); 620 - else 621 - argp = (void __user *)arg; 619 + argp = (void __user *)arg; 622 620 623 621 if ((_IOC_DIR(cmd) != _IOC_NONE) && !arg) 624 622 return -EINVAL;
-19
drivers/s390/char/con3270.c
··· 21 21 #include <linux/reboot.h> 22 22 #include <linux/slab.h> 23 23 #include <linux/memblock.h> 24 - #include <linux/compat.h> 25 24 26 25 #include <asm/machine.h> 27 26 #include <asm/ccwdev.h> ··· 1946 1947 return kbd_ioctl(tp->kbd, cmd, arg); 1947 1948 } 1948 1949 1949 - #ifdef CONFIG_COMPAT 1950 - static long tty3270_compat_ioctl(struct tty_struct *tty, 1951 - unsigned int cmd, unsigned long arg) 1952 - { 1953 - struct tty3270 *tp; 1954 - 1955 - tp = tty->driver_data; 1956 - if (!tp) 1957 - return -ENODEV; 1958 - if (tty_io_error(tty)) 1959 - return -EIO; 1960 - return kbd_ioctl(tp->kbd, cmd, (unsigned long)compat_ptr(arg)); 1961 - } 1962 - #endif 1963 - 1964 1950 static const struct tty_operations tty3270_ops = { 1965 1951 .install = tty3270_install, 1966 1952 .cleanup = tty3270_cleanup, ··· 1960 1976 .hangup = tty3270_hangup, 1961 1977 .wait_until_sent = tty3270_wait_until_sent, 1962 1978 .ioctl = tty3270_ioctl, 1963 - #ifdef CONFIG_COMPAT 1964 - .compat_ioctl = tty3270_compat_ioctl, 1965 - #endif 1966 1979 .set_termios = tty3270_set_termios 1967 1980 }; 1968 1981
+1 -6
drivers/s390/char/fs3270.c
··· 12 12 #include <linux/console.h> 13 13 #include <linux/init.h> 14 14 #include <linux/interrupt.h> 15 - #include <linux/compat.h> 16 15 #include <linux/sched/signal.h> 17 16 #include <linux/module.h> 18 17 #include <linux/list.h> ··· 329 330 fp = filp->private_data; 330 331 if (!fp) 331 332 return -ENODEV; 332 - if (is_compat_task()) 333 - argp = compat_ptr(arg); 334 - else 335 - argp = (char __user *)arg; 333 + argp = (char __user *)arg; 336 334 rc = 0; 337 335 mutex_lock(&fs3270_mutex); 338 336 switch (cmd) { ··· 508 512 .read = fs3270_read, /* read */ 509 513 .write = fs3270_write, /* write */ 510 514 .unlocked_ioctl = fs3270_ioctl, /* ioctl */ 511 - .compat_ioctl = fs3270_ioctl, /* ioctl */ 512 515 .open = fs3270_open, /* open */ 513 516 .release = fs3270_close, /* release */ 514 517 };
+2 -10
drivers/s390/char/sclp_ctl.c
··· 7 7 * Author: Michael Holzheu <holzheu@linux.vnet.ibm.com> 8 8 */ 9 9 10 - #include <linux/compat.h> 11 10 #include <linux/uaccess.h> 12 11 #include <linux/miscdevice.h> 13 12 #include <linux/gfp.h> ··· 42 43 43 44 static void __user *u64_to_uptr(u64 value) 44 45 { 45 - if (is_compat_task()) 46 - return compat_ptr(value); 47 - else 48 - return (void __user *)(unsigned long)value; 46 + return (void __user *)(unsigned long)value; 49 47 } 50 48 51 49 /* ··· 91 95 { 92 96 void __user *argp; 93 97 94 - if (is_compat_task()) 95 - argp = compat_ptr(arg); 96 - else 97 - argp = (void __user *) arg; 98 + argp = (void __user *)arg; 98 99 switch (cmd) { 99 100 case SCLP_CTL_SCCB: 100 101 return sclp_ctl_ioctl_sccb(argp); ··· 107 114 .owner = THIS_MODULE, 108 115 .open = nonseekable_open, 109 116 .unlocked_ioctl = sclp_ctl_ioctl, 110 - .compat_ioctl = sclp_ctl_ioctl, 111 117 }; 112 118 113 119 /*
-26
drivers/s390/char/tape_char.c
··· 17 17 #include <linux/types.h> 18 18 #include <linux/proc_fs.h> 19 19 #include <linux/mtio.h> 20 - #include <linux/compat.h> 21 20 22 21 #include <linux/uaccess.h> 23 22 ··· 36 37 static int tapechar_open(struct inode *,struct file *); 37 38 static int tapechar_release(struct inode *,struct file *); 38 39 static long tapechar_ioctl(struct file *, unsigned int, unsigned long); 39 - #ifdef CONFIG_COMPAT 40 - static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); 41 - #endif 42 40 43 41 static const struct file_operations tape_fops = 44 42 { ··· 43 47 .read = tapechar_read, 44 48 .write = tapechar_write, 45 49 .unlocked_ioctl = tapechar_ioctl, 46 - #ifdef CONFIG_COMPAT 47 - .compat_ioctl = tapechar_compat_ioctl, 48 - #endif 49 50 .open = tapechar_open, 50 51 .release = tapechar_release, 51 52 }; ··· 433 440 mutex_unlock(&device->mutex); 434 441 return rc; 435 442 } 436 - 437 - #ifdef CONFIG_COMPAT 438 - static long 439 - tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) 440 - { 441 - struct tape_device *device = filp->private_data; 442 - long rc; 443 - 444 - if (no == MTIOCPOS32) 445 - no = MTIOCPOS; 446 - else if (no == MTIOCGET32) 447 - no = MTIOCGET; 448 - 449 - mutex_lock(&device->mutex); 450 - rc = __tapechar_ioctl(device, no, compat_ptr(data)); 451 - mutex_unlock(&device->mutex); 452 - return rc; 453 - } 454 - #endif /* CONFIG_COMPAT */ 455 443 456 444 /* 457 445 * Initialize character device frontend.
+1 -6
drivers/s390/char/vmcp.c
··· 14 14 15 15 #include <linux/fs.h> 16 16 #include <linux/init.h> 17 - #include <linux/compat.h> 18 17 #include <linux/kernel.h> 19 18 #include <linux/miscdevice.h> 20 19 #include <linux/slab.h> ··· 203 204 int __user *argp; 204 205 205 206 session = file->private_data; 206 - if (is_compat_task()) 207 - argp = compat_ptr(arg); 208 - else 209 - argp = (int __user *)arg; 207 + argp = (int __user *)arg; 210 208 if (mutex_lock_interruptible(&session->mutex)) 211 209 return -ERESTARTSYS; 212 210 switch (cmd) { ··· 237 241 .read = vmcp_read, 238 242 .write = vmcp_write, 239 243 .unlocked_ioctl = vmcp_ioctl, 240 - .compat_ioctl = vmcp_ioctl, 241 244 }; 242 245 243 246 static struct miscdevice vmcp_dev = {
+1 -6
drivers/s390/cio/chsc_sch.c
··· 9 9 */ 10 10 11 11 #include <linux/slab.h> 12 - #include <linux/compat.h> 13 12 #include <linux/device.h> 14 13 #include <linux/io.h> 15 14 #include <linux/module.h> ··· 844 845 void __user *argp; 845 846 846 847 CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd); 847 - if (is_compat_task()) 848 - argp = compat_ptr(arg); 849 - else 850 - argp = (void __user *)arg; 848 + argp = (void __user *)arg; 851 849 switch (cmd) { 852 850 case CHSC_START: 853 851 return chsc_ioctl_start(argp); ··· 919 923 .open = chsc_open, 920 924 .release = chsc_release, 921 925 .unlocked_ioctl = chsc_ioctl, 922 - .compat_ioctl = chsc_ioctl, 923 926 }; 924 927 925 928 static struct miscdevice chsc_misc_device = {
-195
drivers/s390/crypto/zcrypt_api.c
··· 21 21 #include <linux/interrupt.h> 22 22 #include <linux/miscdevice.h> 23 23 #include <linux/fs.h> 24 - #include <linux/compat.h> 25 24 #include <linux/slab.h> 26 25 #include <linux/atomic.h> 27 26 #include <linux/uaccess.h> ··· 1733 1734 } 1734 1735 } 1735 1736 1736 - #ifdef CONFIG_COMPAT 1737 - /* 1738 - * ioctl32 conversion routines 1739 - */ 1740 - struct compat_ica_rsa_modexpo { 1741 - compat_uptr_t inputdata; 1742 - unsigned int inputdatalength; 1743 - compat_uptr_t outputdata; 1744 - unsigned int outputdatalength; 1745 - compat_uptr_t b_key; 1746 - compat_uptr_t n_modulus; 1747 - }; 1748 - 1749 - static long trans_modexpo32(struct ap_perms *perms, struct file *filp, 1750 - unsigned int cmd, unsigned long arg) 1751 - { 1752 - struct compat_ica_rsa_modexpo __user *umex32 = compat_ptr(arg); 1753 - struct compat_ica_rsa_modexpo mex32; 1754 - struct ica_rsa_modexpo mex64; 1755 - struct zcrypt_track tr; 1756 - long rc; 1757 - 1758 - memset(&tr, 0, sizeof(tr)); 1759 - if (copy_from_user(&mex32, umex32, sizeof(mex32))) 1760 - return -EFAULT; 1761 - mex64.inputdata = compat_ptr(mex32.inputdata); 1762 - mex64.inputdatalength = mex32.inputdatalength; 1763 - mex64.outputdata = compat_ptr(mex32.outputdata); 1764 - mex64.outputdatalength = mex32.outputdatalength; 1765 - mex64.b_key = compat_ptr(mex32.b_key); 1766 - mex64.n_modulus = compat_ptr(mex32.n_modulus); 1767 - do { 1768 - rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); 1769 - } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX); 1770 - 1771 - /* on ENODEV failure: retry once again after a requested rescan */ 1772 - if (rc == -ENODEV && zcrypt_process_rescan()) 1773 - do { 1774 - rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); 1775 - } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX); 1776 - if (rc == -EAGAIN && tr.again_counter >= TRACK_AGAIN_MAX) 1777 - rc = -EIO; 1778 - if (rc) 1779 - return rc; 1780 - return put_user(mex64.outputdatalength, 1781 - &umex32->outputdatalength); 1782 - } 1783 - 1784 - struct compat_ica_rsa_modexpo_crt { 1785 - compat_uptr_t inputdata; 1786 - unsigned int inputdatalength; 1787 - compat_uptr_t outputdata; 1788 - unsigned int outputdatalength; 1789 - compat_uptr_t bp_key; 1790 - compat_uptr_t bq_key; 1791 - compat_uptr_t np_prime; 1792 - compat_uptr_t nq_prime; 1793 - compat_uptr_t u_mult_inv; 1794 - }; 1795 - 1796 - static long trans_modexpo_crt32(struct ap_perms *perms, struct file *filp, 1797 - unsigned int cmd, unsigned long arg) 1798 - { 1799 - struct compat_ica_rsa_modexpo_crt __user *ucrt32 = compat_ptr(arg); 1800 - struct compat_ica_rsa_modexpo_crt crt32; 1801 - struct ica_rsa_modexpo_crt crt64; 1802 - struct zcrypt_track tr; 1803 - long rc; 1804 - 1805 - memset(&tr, 0, sizeof(tr)); 1806 - if (copy_from_user(&crt32, ucrt32, sizeof(crt32))) 1807 - return -EFAULT; 1808 - crt64.inputdata = compat_ptr(crt32.inputdata); 1809 - crt64.inputdatalength = crt32.inputdatalength; 1810 - crt64.outputdata = compat_ptr(crt32.outputdata); 1811 - crt64.outputdatalength = crt32.outputdatalength; 1812 - crt64.bp_key = compat_ptr(crt32.bp_key); 1813 - crt64.bq_key = compat_ptr(crt32.bq_key); 1814 - crt64.np_prime = compat_ptr(crt32.np_prime); 1815 - crt64.nq_prime = compat_ptr(crt32.nq_prime); 1816 - crt64.u_mult_inv = compat_ptr(crt32.u_mult_inv); 1817 - do { 1818 - rc = zcrypt_rsa_crt(perms, &tr, &crt64); 1819 - } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX); 1820 - 1821 - /* on ENODEV failure: retry once again after a requested rescan */ 1822 - if (rc == -ENODEV && zcrypt_process_rescan()) 1823 - do { 1824 - rc = zcrypt_rsa_crt(perms, &tr, &crt64); 1825 - } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX); 1826 - if (rc == -EAGAIN && tr.again_counter >= TRACK_AGAIN_MAX) 1827 - rc = -EIO; 1828 - if (rc) 1829 - return rc; 1830 - return put_user(crt64.outputdatalength, 1831 - &ucrt32->outputdatalength); 1832 - } 1833 - 1834 - struct compat_ica_xcrb { 1835 - unsigned short agent_ID; 1836 - unsigned int user_defined; 1837 - unsigned short request_ID; 1838 - unsigned int request_control_blk_length; 1839 - unsigned char padding1[16 - sizeof(compat_uptr_t)]; 1840 - compat_uptr_t request_control_blk_addr; 1841 - unsigned int request_data_length; 1842 - char padding2[16 - sizeof(compat_uptr_t)]; 1843 - compat_uptr_t request_data_address; 1844 - unsigned int reply_control_blk_length; 1845 - char padding3[16 - sizeof(compat_uptr_t)]; 1846 - compat_uptr_t reply_control_blk_addr; 1847 - unsigned int reply_data_length; 1848 - char padding4[16 - sizeof(compat_uptr_t)]; 1849 - compat_uptr_t reply_data_addr; 1850 - unsigned short priority_window; 1851 - unsigned int status; 1852 - } __packed; 1853 - 1854 - static long trans_xcrb32(struct ap_perms *perms, struct file *filp, 1855 - unsigned int cmd, unsigned long arg) 1856 - { 1857 - struct compat_ica_xcrb __user *uxcrb32 = compat_ptr(arg); 1858 - u32 xflags = ZCRYPT_XFLAG_USERSPACE; 1859 - struct compat_ica_xcrb xcrb32; 1860 - struct zcrypt_track tr; 1861 - struct ica_xcRB xcrb64; 1862 - long rc; 1863 - 1864 - memset(&tr, 0, sizeof(tr)); 1865 - if (copy_from_user(&xcrb32, uxcrb32, sizeof(xcrb32))) 1866 - return -EFAULT; 1867 - xcrb64.agent_ID = xcrb32.agent_ID; 1868 - xcrb64.user_defined = xcrb32.user_defined; 1869 - xcrb64.request_ID = xcrb32.request_ID; 1870 - xcrb64.request_control_blk_length = 1871 - xcrb32.request_control_blk_length; 1872 - xcrb64.request_control_blk_addr = 1873 - compat_ptr(xcrb32.request_control_blk_addr); 1874 - xcrb64.request_data_length = 1875 - xcrb32.request_data_length; 1876 - xcrb64.request_data_address = 1877 - compat_ptr(xcrb32.request_data_address); 1878 - xcrb64.reply_control_blk_length = 1879 - xcrb32.reply_control_blk_length; 1880 - xcrb64.reply_control_blk_addr = 1881 - compat_ptr(xcrb32.reply_control_blk_addr); 1882 - xcrb64.reply_data_length = xcrb32.reply_data_length; 1883 - xcrb64.reply_data_addr = 1884 - compat_ptr(xcrb32.reply_data_addr); 1885 - xcrb64.priority_window = xcrb32.priority_window; 1886 - xcrb64.status = xcrb32.status; 1887 - do { 1888 - rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb64); 1889 - } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX); 1890 - 1891 - /* on ENODEV failure: retry once again after a requested rescan */ 1892 - if (rc == -ENODEV && zcrypt_process_rescan()) 1893 - do { 1894 - rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb64); 1895 - } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX); 1896 - if (rc == -EAGAIN && tr.again_counter >= TRACK_AGAIN_MAX) 1897 - rc = -EIO; 1898 - xcrb32.reply_control_blk_length = xcrb64.reply_control_blk_length; 1899 - xcrb32.reply_data_length = xcrb64.reply_data_length; 1900 - xcrb32.status = xcrb64.status; 1901 - if (copy_to_user(uxcrb32, &xcrb32, sizeof(xcrb32))) 1902 - return -EFAULT; 1903 - return rc; 1904 - } 1905 - 1906 - static long zcrypt_compat_ioctl(struct file *filp, unsigned int cmd, 1907 - unsigned long arg) 1908 - { 1909 - int rc; 1910 - struct ap_perms *perms = 1911 - (struct ap_perms *)filp->private_data; 1912 - 1913 - rc = zcrypt_check_ioctl(perms, cmd); 1914 - if (rc) 1915 - return rc; 1916 - 1917 - if (cmd == ICARSAMODEXPO) 1918 - return trans_modexpo32(perms, filp, cmd, arg); 1919 - if (cmd == ICARSACRT) 1920 - return trans_modexpo_crt32(perms, filp, cmd, arg); 1921 - if (cmd == ZSECSENDCPRB) 1922 - return trans_xcrb32(perms, filp, cmd, arg); 1923 - return zcrypt_unlocked_ioctl(filp, cmd, arg); 1924 - } 1925 - #endif 1926 - 1927 1737 /* 1928 1738 * Misc device file operations. 1929 1739 */ ··· 1741 1933 .read = zcrypt_read, 1742 1934 .write = zcrypt_write, 1743 1935 .unlocked_ioctl = zcrypt_unlocked_ioctl, 1744 - #ifdef CONFIG_COMPAT 1745 - .compat_ioctl = zcrypt_compat_ioctl, 1746 - #endif 1747 1936 .open = zcrypt_open, 1748 1937 .release = zcrypt_release, 1749 1938 };
-1
drivers/s390/crypto/zcrypt_card.c
··· 19 19 #include <linux/fs.h> 20 20 #include <linux/proc_fs.h> 21 21 #include <linux/seq_file.h> 22 - #include <linux/compat.h> 23 22 #include <linux/slab.h> 24 23 #include <linux/atomic.h> 25 24 #include <linux/uaccess.h>
-1
drivers/s390/crypto/zcrypt_queue.c
··· 19 19 #include <linux/fs.h> 20 20 #include <linux/proc_fs.h> 21 21 #include <linux/seq_file.h> 22 - #include <linux/compat.h> 23 22 #include <linux/slab.h> 24 23 #include <linux/atomic.h> 25 24 #include <linux/uaccess.h>
+1 -3
drivers/s390/net/qeth_core_main.c
··· 10 10 #define KMSG_COMPONENT "qeth" 11 11 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 12 12 13 - #include <linux/compat.h> 14 13 #include <linux/export.h> 15 14 #include <linux/module.h> 16 15 #include <linux/moduleparam.h> ··· 4804 4805 4805 4806 rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_query_oat_cb, &priv); 4806 4807 if (!rc) { 4807 - tmp = is_compat_task() ? compat_ptr(oat_data.ptr) : 4808 - u64_to_user_ptr(oat_data.ptr); 4808 + tmp = u64_to_user_ptr(oat_data.ptr); 4809 4809 oat_data.response_len = priv.response_len; 4810 4810 4811 4811 if (copy_to_user(tmp, priv.buffer, priv.response_len) ||
-4
tools/arch/s390/include/uapi/asm/bitsperlong.h
··· 2 2 #ifndef __ASM_S390_BITSPERLONG_H 3 3 #define __ASM_S390_BITSPERLONG_H 4 4 5 - #ifndef __s390x__ 6 - #define __BITS_PER_LONG 32 7 - #else 8 5 #define __BITS_PER_LONG 64 9 - #endif 10 6 11 7 #include <asm-generic/bitsperlong.h> 12 8
-5
tools/include/nolibc/arch-s390.h
··· 143 143 void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protector _start(void) 144 144 { 145 145 __asm__ volatile ( 146 - #ifdef __s390x__ 147 146 "lgr %r2, %r15\n" /* save stack pointer to %r2, as arg1 of _start_c */ 148 147 "aghi %r15, -160\n" /* allocate new stackframe */ 149 - #else 150 - "lr %r2, %r15\n" 151 - "ahi %r15, -96\n" 152 - #endif 153 148 "xc 0(8,%r15), 0(%r15)\n" /* clear backchain */ 154 149 "brasl %r14, _start_c\n" /* transfer to c runtime */ 155 150 );
+1 -1
tools/include/nolibc/arch.h
··· 27 27 #include "arch-powerpc.h" 28 28 #elif defined(__riscv) 29 29 #include "arch-riscv.h" 30 - #elif defined(__s390x__) || defined(__s390__) 30 + #elif defined(__s390x__) 31 31 #include "arch-s390.h" 32 32 #elif defined(__loongarch__) 33 33 #include "arch-loongarch.h"
-4
tools/lib/bpf/libbpf.c
··· 11325 11325 return "ia32"; 11326 11326 #elif defined(__s390x__) 11327 11327 return "s390x"; 11328 - #elif defined(__s390__) 11329 - return "s390"; 11330 11328 #elif defined(__arm__) 11331 11329 return "arm"; 11332 11330 #elif defined(__aarch64__) ··· 12111 12113 return "/lib/i386-linux-gnu"; 12112 12114 #elif defined(__s390x__) 12113 12115 return "/lib/s390x-linux-gnu"; 12114 - #elif defined(__s390__) 12115 - return "/lib/s390-linux-gnu"; 12116 12116 #elif defined(__arm__) && defined(__SOFTFP__) 12117 12117 return "/lib/arm-linux-gnueabi"; 12118 12118 #elif defined(__arm__) && !defined(__SOFTFP__)
-2
tools/lib/bpf/usdt.c
··· 1376 1376 1377 1377 #elif defined(__s390x__) 1378 1378 1379 - /* Do not support __s390__ for now, since user_pt_regs is broken with -m31. */ 1380 - 1381 1379 static int parse_usdt_arg(const char *arg_str, int arg_num, struct usdt_arg_spec *arg, int *arg_sz) 1382 1380 { 1383 1381 unsigned int reg;
-5
tools/testing/selftests/nolibc/Makefile.nolibc
··· 87 87 IMAGE_riscv32 = arch/riscv/boot/Image 88 88 IMAGE_riscv64 = arch/riscv/boot/Image 89 89 IMAGE_s390x = arch/s390/boot/bzImage 90 - IMAGE_s390 = arch/s390/boot/bzImage 91 90 IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi 92 91 IMAGE_sparc32 = arch/sparc/boot/image 93 92 IMAGE_sparc64 = arch/sparc/boot/image ··· 116 117 DEFCONFIG_riscv32 = rv32_defconfig 117 118 DEFCONFIG_riscv64 = defconfig 118 119 DEFCONFIG_s390x = defconfig 119 - DEFCONFIG_s390 = defconfig compat.config 120 120 DEFCONFIG_loongarch = defconfig 121 121 DEFCONFIG_sparc32 = sparc32_defconfig 122 122 DEFCONFIG_sparc64 = sparc64_defconfig ··· 154 156 QEMU_ARCH_riscv32 = riscv32 155 157 QEMU_ARCH_riscv64 = riscv64 156 158 QEMU_ARCH_s390x = s390x 157 - QEMU_ARCH_s390 = s390x 158 159 QEMU_ARCH_loongarch = loongarch64 159 160 QEMU_ARCH_sparc32 = sparc 160 161 QEMU_ARCH_sparc64 = sparc64 ··· 194 197 QEMU_ARGS_riscv32 = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" 195 198 QEMU_ARGS_riscv64 = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" 196 199 QEMU_ARGS_s390x = -M s390-ccw-virtio -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" 197 - QEMU_ARGS_s390 = -M s390-ccw-virtio -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" 198 200 QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" 199 201 QEMU_ARGS_sparc32 = -M SS-5 -m 256M -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" 200 202 QEMU_ARGS_sparc64 = -M sun4u -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" ··· 219 223 CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple) 220 224 CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2) 221 225 CFLAGS_s390x = -m64 222 - CFLAGS_s390 = -m31 223 226 CFLAGS_mips32le = -EL -mabi=32 -fPIC 224 227 CFLAGS_mips32be = -EB -mabi=32 225 228 CFLAGS_mipsn32le = -EL -mabi=n32 -fPIC -march=mips64r2
+1 -5
tools/testing/selftests/nolibc/run-tests.sh
··· 23 23 mips32le mips32be mipsn32le mipsn32be mips64le mips64be 24 24 ppc ppc64 ppc64le 25 25 riscv32 riscv64 26 - s390x s390 26 + s390x 27 27 loongarch 28 28 sparc32 sparc64 29 29 m68k ··· 185 185 exit 1 186 186 esac 187 187 printf '%-15s' "$arch:" 188 - if [ "$arch" = "s390" ] && ([ "$llvm" = "1" ] || [ "$test_mode" = "user" ]); then 189 - echo "Unsupported configuration" 190 - return 191 - fi 192 188 if [ "$arch" = "m68k" -o "$arch" = "sh4" ] && [ "$llvm" = "1" ]; then 193 189 echo "Unsupported configuration" 194 190 return
-39
tools/testing/selftests/rseq/rseq-s390.h
··· 28 28 RSEQ_WRITE_ONCE(*(p), v); \ 29 29 } while (0) 30 30 31 - #ifdef __s390x__ 32 - 33 31 #define LONG_L "lg" 34 32 #define LONG_S "stg" 35 33 #define LONG_LT_R "ltgr" ··· 60 62 ".pushsection __rseq_exit_point_array, \"aw\"\n\t" \ 61 63 ".quad " __rseq_str(start_ip) ", " __rseq_str(exit_ip) "\n\t" \ 62 64 ".popsection\n\t" 63 - 64 - #elif __s390__ 65 - 66 - #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \ 67 - start_ip, post_commit_offset, abort_ip) \ 68 - ".pushsection __rseq_cs, \"aw\"\n\t" \ 69 - ".balign 32\n\t" \ 70 - __rseq_str(label) ":\n\t" \ 71 - ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \ 72 - ".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) "\n\t" \ 73 - ".popsection\n\t" \ 74 - ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \ 75 - ".long 0x0, " __rseq_str(label) "b\n\t" \ 76 - ".popsection\n\t" 77 - 78 - /* 79 - * Exit points of a rseq critical section consist of all instructions outside 80 - * of the critical section where a critical section can either branch to or 81 - * reach through the normal course of its execution. The abort IP and the 82 - * post-commit IP are already part of the __rseq_cs section and should not be 83 - * explicitly defined as additional exit points. Knowing all exit points is 84 - * useful to assist debuggers stepping over the critical section. 85 - */ 86 - #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \ 87 - ".pushsection __rseq_exit_point_array, \"aw\"\n\t" \ 88 - ".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(exit_ip) "\n\t" \ 89 - ".popsection\n\t" 90 - 91 - #define LONG_L "l" 92 - #define LONG_S "st" 93 - #define LONG_LT_R "ltr" 94 - #define LONG_CMP "c" 95 - #define LONG_CMP_R "cr" 96 - #define LONG_ADDI "ahi" 97 - #define LONG_ADD_R "ar" 98 - 99 - #endif 100 65 101 66 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \ 102 67 __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip, \
-4
tools/testing/selftests/vDSO/vdso_config.h
··· 25 25 #define VDSO_VERSION 1 26 26 #define VDSO_NAMES 0 27 27 #define VDSO_32BIT 1 28 - #elif defined (__s390__) && !defined(__s390x__) 29 - #define VDSO_VERSION 2 30 - #define VDSO_NAMES 0 31 - #define VDSO_32BIT 1 32 28 #elif defined (__s390x__) 33 29 #define VDSO_VERSION 2 34 30 #define VDSO_NAMES 0