]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390: Remove compat support
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 10 Nov 2025 18:54:37 +0000 (19:54 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 17 Nov 2025 10:10:38 +0000 (11:10 +0100)
There shouldn't be any 31 bit code around anymore that matters.
Remove the compat layer support required to run 31 bit code.

Reason for removal is code simplification and reduced test effort.

Note that this comes without any deprecation warnings added to config
options, or kernel messages, since most likely those would be ignored
anyway.

If it turns out there is still a reason to keep the compat layer this
can be reverted at any time in the future.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
57 files changed:
arch/s390/Kconfig
arch/s390/Makefile
arch/s390/boot/ipl_data.c
arch/s390/configs/compat.config [deleted file]
arch/s390/hypfs/hypfs_sprp.c
arch/s390/include/asm/compat.h [deleted file]
arch/s390/include/asm/elf.h
arch/s390/include/asm/ftrace.h
arch/s390/include/asm/processor.h
arch/s390/include/asm/seccomp.h
arch/s390/include/asm/syscall.h
arch/s390/include/asm/syscall_wrapper.h
arch/s390/include/asm/thread_info.h
arch/s390/include/asm/unistd.h
arch/s390/include/asm/vdso-symbols.h
arch/s390/kernel/Makefile
arch/s390/kernel/audit.c
arch/s390/kernel/audit.h [deleted file]
arch/s390/kernel/compat_audit.c [deleted file]
arch/s390/kernel/compat_linux.c [deleted file]
arch/s390/kernel/compat_linux.h [deleted file]
arch/s390/kernel/compat_ptrace.h [deleted file]
arch/s390/kernel/compat_signal.c [deleted file]
arch/s390/kernel/entry.S
arch/s390/kernel/perf_cpum_cf.c
arch/s390/kernel/perf_event.c
arch/s390/kernel/perf_regs.c
arch/s390/kernel/process.c
arch/s390/kernel/ptrace.c
arch/s390/kernel/setup.c
arch/s390/kernel/signal.c
arch/s390/kernel/stacktrace.c
arch/s390/kernel/uprobes.c
arch/s390/kernel/vdso.c
arch/s390/kernel/vdso32/.gitignore [deleted file]
arch/s390/kernel/vdso32/Makefile [deleted file]
arch/s390/kernel/vdso32/gen_vdso_offsets.sh [deleted file]
arch/s390/kernel/vdso32/note.S [deleted file]
arch/s390/kernel/vdso32/vdso32.lds.S [deleted file]
arch/s390/kernel/vdso32/vdso32_wrapper.S [deleted file]
arch/s390/kernel/vdso32/vdso_user_wrapper.S [deleted file]
arch/s390/mm/fault.c
arch/s390/mm/mmap.c
arch/s390/pci/pci_clp.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/char/con3270.c
drivers/s390/char/fs3270.c
drivers/s390/char/sclp_ctl.c
drivers/s390/char/tape_char.c
drivers/s390/char/vmcp.c
drivers/s390/cio/chsc_sch.c
drivers/s390/crypto/zcrypt_api.c
drivers/s390/crypto/zcrypt_card.c
drivers/s390/crypto/zcrypt_queue.c
drivers/s390/net/qeth_core_main.c

index c4145672ca342a656eece10704706d4b12ff9fd6..9914db771e4505b4acbc6d5b4fb6ade4dc4037ec 100644 (file)
@@ -505,22 +505,6 @@ config COMMAND_LINE_SIZE
          This allows you to specify the maximum length of the kernel command
          line.
 
-config COMPAT
-       def_bool n
-       prompt "Kernel support for 31 bit emulation"
-       select ARCH_WANT_OLD_COMPAT_IPC
-       select COMPAT_OLD_SIGACTION
-       select HAVE_UID16
-       depends on MULTIUSER
-       depends on !CC_IS_CLANG && !LD_IS_LLD
-       help
-         Select this option if you want to enable your system kernel to
-         handle system-calls from ELF binaries for 31 bit ESA.  This option
-         (and some other stuff like libraries and such) is needed for
-         executing 31 bit applications.
-
-         If unsure say N.
-
 config SMP
        def_bool y
 
index b4769241332bb98886c05308e800963d505adf4e..f41b8c5c4e560fafacaece98f68cd520bf660dea 100644 (file)
@@ -149,11 +149,8 @@ ifeq ($(KBUILD_EXTMOD),)
 prepare: vdso_prepare
 vdso_prepare: prepare0
        $(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h
-       $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
-               $(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h)
 
 vdso-install-y                 += arch/s390/kernel/vdso64/vdso64.so.dbg
-vdso-install-$(CONFIG_COMPAT)  += arch/s390/kernel/vdso32/vdso32.so.dbg
 
 endif
 
index 7957cc6554e77d71e6dd212928a16c9dd39e2f3f..b0fd8a526b42b4f5111d7f5d749fc200ef4bce40 100644 (file)
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 
-#include <linux/compat.h>
 #include <linux/ptrace.h>
 #include <asm/cio.h>
 #include <asm/asm-offsets.h>
diff --git a/arch/s390/configs/compat.config b/arch/s390/configs/compat.config
deleted file mode 100644 (file)
index 6fd0514..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# Help: Enable compat support
-CONFIG_COMPAT=y
-CONFIG_COMPAT_32BIT_TIME=y
index a2952ed5518bab22d31ff6cdbf3409918febaa29..a72576221cab986616411b1ddcf74d5d15d70b94 100644 (file)
@@ -7,7 +7,6 @@
  *    Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
-#include <linux/compat.h>
 #include <linux/errno.h>
 #include <linux/gfp.h>
 #include <linux/string.h>
@@ -116,10 +115,7 @@ static long hypfs_sprp_ioctl(struct file *file, unsigned int cmd,
 
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
-       if (is_compat_task())
-               argp = compat_ptr(arg);
-       else
-               argp = (void __user *) arg;
+       argp = (void __user *)arg;
        switch (cmd) {
        case HYPFS_DIAG304:
                return __hypfs_sprp_ioctl(argp);
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
deleted file mode 100644 (file)
index 3cb9d81..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_S390X_COMPAT_H
-#define _ASM_S390X_COMPAT_H
-/*
- * Architecture specific compatibility types
- */
-#include <linux/types.h>
-#include <linux/sched.h>
-#include <linux/sched/task_stack.h>
-#include <linux/thread_info.h>
-#include <asm/ptrace.h>
-
-#define compat_mode_t  compat_mode_t
-typedef u16            compat_mode_t;
-
-#define __compat_uid_t __compat_uid_t
-typedef u16            __compat_uid_t;
-typedef u16            __compat_gid_t;
-
-#define compat_dev_t   compat_dev_t
-typedef u16            compat_dev_t;
-
-#define compat_ipc_pid_t compat_ipc_pid_t
-typedef u16             compat_ipc_pid_t;
-
-#define compat_statfs  compat_statfs
-
-#include <asm-generic/compat.h>
-
-#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \
-                               typeof(0?(__force t)0:0ULL), u64))
-
-#define __SC_DELOUSE(t,v) ({ \
-       BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
-       (__force t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
-})
-
-#define PSW32_MASK_USER                0x0000FF00UL
-
-#define PSW32_USER_BITS (PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | \
-                        PSW32_DEFAULT_KEY | PSW32_MASK_BASE | \
-                        PSW32_MASK_MCHECK | PSW32_MASK_PSTATE | \
-                        PSW32_ASC_PRIMARY)
-
-#define COMPAT_UTS_MACHINE     "s390\0\0\0\0"
-
-typedef u16            compat_nlink_t;
-
-typedef struct {
-       u32 mask;
-       u32 addr;
-} __aligned(8) psw_compat_t;
-
-typedef struct {
-       psw_compat_t psw;
-       u32 gprs[NUM_GPRS];
-       u32 acrs[NUM_ACRS];
-       u32 orig_gpr2;
-} s390_compat_regs;
-
-typedef struct {
-       u32 gprs_high[NUM_GPRS];
-} s390_compat_regs_high;
-
-struct compat_stat {
-       compat_dev_t    st_dev;
-       u16             __pad1;
-       compat_ino_t    st_ino;
-       compat_mode_t   st_mode;
-       compat_nlink_t  st_nlink;
-       __compat_uid_t  st_uid;
-       __compat_gid_t  st_gid;
-       compat_dev_t    st_rdev;
-       u16             __pad2;
-       u32             st_size;
-       u32             st_blksize;
-       u32             st_blocks;
-       u32             st_atime;
-       u32             st_atime_nsec;
-       u32             st_mtime;
-       u32             st_mtime_nsec;
-       u32             st_ctime;
-       u32             st_ctime_nsec;
-       u32             __unused4;
-       u32             __unused5;
-};
-
-struct compat_statfs {
-       u32             f_type;
-       u32             f_bsize;
-       u32             f_blocks;
-       u32             f_bfree;
-       u32             f_bavail;
-       u32             f_files;
-       u32             f_ffree;
-       compat_fsid_t   f_fsid;
-       u32             f_namelen;
-       u32             f_frsize;
-       u32             f_flags;
-       u32             f_spare[4];
-};
-
-struct compat_statfs64 {
-       u32             f_type;
-       u32             f_bsize;
-       u64             f_blocks;
-       u64             f_bfree;
-       u64             f_bavail;
-       u64             f_files;
-       u64             f_ffree;
-       compat_fsid_t   f_fsid;
-       u32             f_namelen;
-       u32             f_frsize;
-       u32             f_flags;
-       u32             f_spare[5];
-};
-
-/*
- * A pointer passed in from user mode. This should not
- * be used for syscall parameters, just declare them
- * as pointers because the syscall entry code will have
- * appropriately converted them already.
- */
-
-static inline void __user *compat_ptr(compat_uptr_t uptr)
-{
-       return (void __user *)(unsigned long)(uptr & 0x7fffffffUL);
-}
-#define compat_ptr(uptr) compat_ptr(uptr)
-
-#ifdef CONFIG_COMPAT
-
-static inline int is_compat_task(void)
-{
-       return test_thread_flag(TIF_31BIT);
-}
-
-#endif
-
-#endif /* _ASM_S390X_COMPAT_H */
index a03df312081ef93f95ab70ccb5a5d2bdf88d84ec..2b6ab483b1cab0a1c170dedb6dcb77c54da1a042 100644 (file)
@@ -162,8 +162,6 @@ enum {
  * ELF register definitions..
  */
 
-#include <linux/compat.h>
-
 #include <asm/ptrace.h>
 #include <asm/syscall.h>
 #include <asm/user.h>
@@ -171,9 +169,6 @@ enum {
 typedef s390_fp_regs elf_fpregset_t;
 typedef s390_regs elf_gregset_t;
 
-typedef s390_fp_regs compat_elf_fpregset_t;
-typedef s390_compat_regs compat_elf_gregset_t;
-
 #include <linux/sched/mm.h>    /* for task_struct */
 #include <asm/mmu_context.h>
 
@@ -183,10 +178,6 @@ typedef s390_compat_regs compat_elf_gregset_t;
 #define elf_check_arch(x) \
        (((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \
          && (x)->e_ident[EI_CLASS] == ELF_CLASS) 
-#define compat_elf_check_arch(x) \
-       (((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \
-        && (x)->e_ident[EI_CLASS] == ELF_CLASS)
-#define compat_start_thread    start_thread31
 
 /* For SVR4/S390 the function pointer to be registered with `atexit` is
    passed in R14. */
@@ -203,9 +194,7 @@ typedef s390_compat_regs compat_elf_gregset_t;
    the loader.  We need to make sure that it is out of the way of the program
    that it will "exec", and that there is sufficient room for the brk. 64-bit
    tasks are aligned to 4GB. */
-#define ELF_ET_DYN_BASE (is_compat_task() ? \
-                               (STACK_TOP / 3 * 2) : \
-                               (STACK_TOP / 3 * 2) & ~((1UL << 32) - 1))
+#define ELF_ET_DYN_BASE ((STACK_TOP / 3 * 2) & ~((1UL << 32) - 1))
 
 /* This yields a mask that user programs can use to figure out what
    instruction set this CPU supports. */
@@ -224,43 +213,22 @@ extern unsigned long elf_hwcap;
 extern char elf_platform[];
 #define ELF_PLATFORM (elf_platform)
 
-#ifndef CONFIG_COMPAT
 #define SET_PERSONALITY(ex) \
 do {                                                           \
        set_personality(PER_LINUX |                             \
                (current->personality & (~PER_MASK)));          \
        current->thread.sys_call_table = sys_call_table;        \
 } while (0)
-#else /* CONFIG_COMPAT */
-#define SET_PERSONALITY(ex)                                    \
-do {                                                           \
-       if (personality(current->personality) != PER_LINUX32)   \
-               set_personality(PER_LINUX |                     \
-                       (current->personality & ~PER_MASK));    \
-       if ((ex).e_ident[EI_CLASS] == ELFCLASS32) {             \
-               set_thread_flag(TIF_31BIT);                     \
-               current->thread.sys_call_table =                \
-                       sys_call_table_emu;                     \
-       } else {                                                \
-               clear_thread_flag(TIF_31BIT);                   \
-               current->thread.sys_call_table =                \
-                       sys_call_table;                         \
-       }                                                       \
-} while (0)
-#endif /* CONFIG_COMPAT */
 
 /*
  * Cache aliasing on the latest machines calls for a mapping granularity
- * of 512KB for the anonymous mapping base. For 64-bit processes use a
- * 512KB alignment and a randomization of up to 1GB. For 31-bit processes
- * the virtual address space is limited, use no alignment and limit the
- * randomization to 8MB.
- * For the additional randomization of the program break use 32MB for
- * 64-bit and 8MB for 31-bit.
+ * of 512KB for the anonymous mapping base. Use a 512KB alignment and a
+ * randomization of up to 1GB.
+ * For the additional randomization of the program break use 32MB.
  */
-#define BRK_RND_MASK   (is_compat_task() ? 0x7ffUL : 0x1fffUL)
-#define MMAP_RND_MASK  (is_compat_task() ? 0x7ffUL : 0x3ff80UL)
-#define MMAP_ALIGN_MASK        (is_compat_task() ? 0 : 0x7fUL)
+#define BRK_RND_MASK   (0x1fffUL)
+#define MMAP_RND_MASK  (0x3ff80UL)
+#define MMAP_ALIGN_MASK        (0x7fUL)
 #define STACK_RND_MASK MMAP_RND_MASK
 
 /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
index bee2d16c295173a9ff01ac15ad4e1e29c4e9d786..692c484ec1630248484ed2f30d28171b460b3f68 100644 (file)
@@ -105,28 +105,11 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsi
 }
 #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
 
-/*
- * Even though the system call numbers are identical for s390/s390x a
- * different system call table is used for compat tasks. This may lead
- * to e.g. incorrect or missing trace event sysfs files.
- * Therefore simply do not trace compat system calls at all.
- * See kernel/trace/trace_syscalls.c.
- */
-#define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS
-static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
-{
-       return is_compat_task();
-}
-
 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
 static inline bool arch_syscall_match_sym_name(const char *sym,
                                               const char *name)
 {
-       /*
-        * Skip __s390_ and __s390x_ prefix - due to compat wrappers
-        * and aliasing some symbols of 64 bit system call functions
-        * may get the __s390_ prefix instead of the __s390x_ prefix.
-        */
+       /* Skip the __s390x_ prefix. */
        return !strcmp(sym + 7, name) || !strcmp(sym + 8, name);
 }
 
index ead1ebc9c61e3b14b8d7e0774803bd39ac0c3c26..e8e9e6baebddfbcbdff0723f0dc629e669b31616 100644 (file)
@@ -119,18 +119,12 @@ extern void execve_tail(void);
 unsigned long vdso_text_size(void);
 unsigned long vdso_size(void);
 
-/*
- * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit.
- */
-
-#define TASK_SIZE              (test_thread_flag(TIF_31BIT) ? \
-                                       _REGION3_SIZE : TASK_SIZE_MAX)
-#define TASK_UNMAPPED_BASE     (test_thread_flag(TIF_31BIT) ? \
-                                       (_REGION3_SIZE >> 1) : (_REGION2_SIZE >> 1))
+#define TASK_SIZE              (TASK_SIZE_MAX)
+#define TASK_UNMAPPED_BASE     (_REGION2_SIZE >> 1)
 #define TASK_SIZE_MAX          (-PAGE_SIZE)
 
 #define VDSO_BASE              (STACK_TOP + PAGE_SIZE)
-#define VDSO_LIMIT             (test_thread_flag(TIF_31BIT) ? _REGION3_SIZE : _REGION2_SIZE)
+#define VDSO_LIMIT             (_REGION2_SIZE)
 #define STACK_TOP              (VDSO_LIMIT - vdso_size() - PAGE_SIZE)
 #define STACK_TOP_MAX          (_REGION2_SIZE - vdso_size() - PAGE_SIZE)
 
index 71d46f0ba97b5de4d22702d52927763632cf0db2..f904b674fee0762aef073e12762b299608314bd3 100644 (file)
 #define SECCOMP_ARCH_NATIVE            AUDIT_ARCH_S390X
 #define SECCOMP_ARCH_NATIVE_NR         NR_syscalls
 #define SECCOMP_ARCH_NATIVE_NAME       "s390x"
-#ifdef CONFIG_COMPAT
-# define SECCOMP_ARCH_COMPAT           AUDIT_ARCH_S390
-# define SECCOMP_ARCH_COMPAT_NR                NR_syscalls
-# define SECCOMP_ARCH_COMPAT_NAME      "s390"
-#endif
 
 #endif /* _ASM_S390_SECCOMP_H */
index 10ce5c4ccbd6d665a6ae147aca19aa6d9e194272..4271e4169f45b60c066180dda06843f5475b7596 100644 (file)
@@ -15,7 +15,6 @@
 #include <asm/ptrace.h>
 
 extern const sys_call_ptr_t sys_call_table[];
-extern const sys_call_ptr_t sys_call_table_emu[];
 
 static inline long syscall_get_nr(struct task_struct *task,
                                  struct pt_regs *regs)
@@ -46,15 +45,7 @@ static inline long syscall_get_error(struct task_struct *task,
                                     struct pt_regs *regs)
 {
        unsigned long error = regs->gprs[2];
-#ifdef CONFIG_COMPAT
-       if (test_tsk_thread_flag(task, TIF_31BIT)) {
-               /*
-                * Sign-extend the value so (int)-EFOO becomes (long)-EFOO
-                * and will match correctly in comparisons.
-                */
-               error = (long)(int)error;
-       }
-#endif
+
        return IS_ERR_VALUE(error) ? error : 0;
 }
 
@@ -78,10 +69,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
 {
        unsigned long mask = -1UL;
 
-#ifdef CONFIG_COMPAT
-       if (test_tsk_thread_flag(task, TIF_31BIT))
-               mask = 0xffffffff;
-#endif
        for (int i = 1; i < 6; i++)
                args[i] = regs->gprs[2 + i] & mask;
 
@@ -99,10 +86,6 @@ static inline void syscall_set_arguments(struct task_struct *task,
 
 static inline int syscall_get_arch(struct task_struct *task)
 {
-#ifdef CONFIG_COMPAT
-       if (test_tsk_thread_flag(task, TIF_31BIT))
-               return AUDIT_ARCH_S390;
-#endif
        return AUDIT_ARCH_S390X;
 }
 
index bf1ff5e9242d4f988e56fe1b73bd9fba4cae7c06..9eb58d5348d850985de62663c71fdbe7a01396be 100644 (file)
              ,, regs->orig_gpr2,, regs->gprs[3],, regs->gprs[4]        \
              ,, regs->gprs[5],, regs->gprs[6],, regs->gprs[7])
 
-#ifdef CONFIG_COMPAT
-
-#define __SC_COMPAT_CAST(t, a)                                         \
-({                                                                     \
-       long __ReS = a;                                                 \
-                                                                       \
-       BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&              \
-                    !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t) &&           \
-                    !__TYPE_IS_LL(t));                                 \
-       if (__TYPE_IS_L(t))                                             \
-               __ReS = (s32)a;                                         \
-       if (__TYPE_IS_UL(t))                                            \
-               __ReS = (u32)a;                                         \
-       if (__TYPE_IS_PTR(t))                                           \
-               __ReS = a & 0x7fffffff;                                 \
-       if (__TYPE_IS_LL(t))                                            \
-               return -ENOSYS;                                         \
-       (t)__ReS;                                                       \
-})
-
-/*
- * To keep the naming coherent, re-define SYSCALL_DEFINE0 to create an alias
- * named __s390x_sys_*()
- */
-#define COMPAT_SYSCALL_DEFINE0(sname)                                  \
-       long __s390_compat_sys_##sname(struct pt_regs *__unused);       \
-       ALLOW_ERROR_INJECTION(__s390_compat_sys_##sname, ERRNO);        \
-       long __s390_compat_sys_##sname(struct pt_regs *__unused)
-
-#define SYSCALL_DEFINE0(sname)                                         \
-       SYSCALL_METADATA(_##sname, 0);                                  \
-       long __s390_sys_##sname(struct pt_regs *__unused);              \
-       ALLOW_ERROR_INJECTION(__s390_sys_##sname, ERRNO);               \
-       long __s390x_sys_##sname(struct pt_regs *__unused);             \
-       ALLOW_ERROR_INJECTION(__s390x_sys_##sname, ERRNO);              \
-       static inline long __do_sys_##sname(void);                      \
-       long __s390_sys_##sname(struct pt_regs *__unused)               \
-       {                                                               \
-               return __do_sys_##sname();                              \
-       }                                                               \
-       long __s390x_sys_##sname(struct pt_regs *__unused)              \
-       {                                                               \
-               return __do_sys_##sname();                              \
-       }                                                               \
-       static inline long __do_sys_##sname(void)
-
-#define COND_SYSCALL(name)                                             \
-       cond_syscall(__s390x_sys_##name);                               \
-       cond_syscall(__s390_sys_##name)
-
-#define COMPAT_SYSCALL_DEFINEx(x, name, ...)                                           \
-       long __s390_compat_sys##name(struct pt_regs *regs);                             \
-       ALLOW_ERROR_INJECTION(__s390_compat_sys##name, ERRNO);                          \
-       static inline long __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__));     \
-       static inline long __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__));     \
-       long __s390_compat_sys##name(struct pt_regs *regs)                              \
-       {                                                                               \
-               return __se_compat_sys##name(SC_S390_REGS_TO_ARGS(x, __VA_ARGS__));     \
-       }                                                                               \
-       static inline long __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__))      \
-       {                                                                               \
-               __MAP(x, __SC_TEST, __VA_ARGS__);                                       \
-               return __do_compat_sys##name(__MAP(x, __SC_DELOUSE, __VA_ARGS__));      \
-       }                                                                               \
-       static inline long __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__))
-
-/*
- * As some compat syscalls may not be implemented, we need to expand
- * COND_SYSCALL_COMPAT in kernel/sys_ni.c to cover this case as well.
- */
-#define COND_SYSCALL_COMPAT(name)                                      \
-       cond_syscall(__s390_compat_sys_##name)
-
-#define __S390_SYS_STUBx(x, name, ...)                                         \
-       long __s390_sys##name(struct pt_regs *regs);                            \
-       ALLOW_ERROR_INJECTION(__s390_sys##name, ERRNO);                         \
-       static inline long ___se_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__));   \
-       long __s390_sys##name(struct pt_regs *regs)                             \
-       {                                                                       \
-               return ___se_sys##name(SC_S390_REGS_TO_ARGS(x, __VA_ARGS__));   \
-       }                                                                       \
-       static inline long ___se_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__))    \
-       {                                                                       \
-               __MAP(x, __SC_TEST, __VA_ARGS__);                               \
-               return __do_sys##name(__MAP(x, __SC_COMPAT_CAST, __VA_ARGS__)); \
-       }
-
-#else /* CONFIG_COMPAT */
-
 #define SYSCALL_DEFINE0(sname)                                         \
        SYSCALL_METADATA(_##sname, 0);                                  \
        long __s390x_sys_##sname(struct pt_regs *__unused);             \
 
 #define __S390_SYS_STUBx(x, fullname, name, ...)
 
-#endif /* CONFIG_COMPAT */
-
 #define __SYSCALL_DEFINEx(x, name, ...)                                                \
        long __s390x_sys##name(struct pt_regs *regs);                           \
        ALLOW_ERROR_INJECTION(__s390x_sys##name, ERRNO);                        \
index 7878e9bfbf072b126e0fa24647ebc7cd519eb77a..6a548a8194006c81628b55095093db129fc17936 100644 (file)
@@ -69,7 +69,6 @@ void arch_setup_new_exec(void);
 #define TIF_GUARDED_STORAGE    17      /* load guarded storage control block */
 #define TIF_ISOLATE_BP_GUEST   18      /* Run KVM guests with isolated BP */
 #define TIF_PER_TRAP           19      /* Need to handle PER trap on exit to usermode */
-#define TIF_31BIT              20      /* 32bit process */
 #define TIF_SINGLE_STEP                21      /* This task is single stepped */
 #define TIF_BLOCK_STEP         22      /* This task is block stepped */
 #define TIF_UPROBE_SINGLESTEP  23      /* This task is uprobe single stepped */
@@ -78,7 +77,6 @@ void arch_setup_new_exec(void);
 #define _TIF_GUARDED_STORAGE   BIT(TIF_GUARDED_STORAGE)
 #define _TIF_ISOLATE_BP_GUEST  BIT(TIF_ISOLATE_BP_GUEST)
 #define _TIF_PER_TRAP          BIT(TIF_PER_TRAP)
-#define _TIF_31BIT             BIT(TIF_31BIT)
 #define _TIF_SINGLE_STEP       BIT(TIF_SINGLE_STEP)
 #define _TIF_BLOCK_STEP                BIT(TIF_BLOCK_STEP)
 #define _TIF_UPROBE_SINGLESTEP BIT(TIF_UPROBE_SINGLESTEP)
index 70fc671397dad21bd611864d908a4f97471baf17..252d7ac7a6b2afefd47b8be5c2fd913477b8363a 100644 (file)
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
-# ifdef CONFIG_COMPAT
-#   define __ARCH_WANT_COMPAT_STAT
-#   define __ARCH_WANT_SYS_TIME32
-#   define __ARCH_WANT_SYS_UTIME32
-# endif
 #define __ARCH_WANT_SYS_FORK
 #define __ARCH_WANT_SYS_VFORK
 #define __ARCH_WANT_SYS_CLONE
index 0df17574d788907dad3a8ae6c93a25be354195b8..205da2c565c2694f387a1e1fc90321d7427df5ae 100644 (file)
@@ -3,15 +3,7 @@
 #define __S390_VDSO_SYMBOLS_H__
 
 #include <generated/vdso64-offsets.h>
-#ifdef CONFIG_COMPAT
-#include <generated/vdso32-offsets.h>
-#endif
 
 #define VDSO64_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso64_offset_##name))
-#ifdef CONFIG_COMPAT
-#define VDSO32_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso32_offset_##name))
-#else
-#define VDSO32_SYMBOL(tsk, name) (-1UL)
-#endif
 
 #endif /* __S390_VDSO_SYMBOLS_H__ */
index c5791179b4b0c31d59dc6fa64538946e2766d39c..810000355ac5bfa5394c96d139ec6d4b3344747d 100644 (file)
@@ -56,9 +56,6 @@ obj-$(CONFIG_MODULES)         += module.o
 obj-$(CONFIG_SCHED_TOPOLOGY)   += topology.o hiperdispatch.o
 obj-$(CONFIG_NUMA)             += numa.o
 obj-$(CONFIG_AUDIT)            += audit.o
-compat-obj-$(CONFIG_AUDIT)     += compat_audit.o
-obj-$(CONFIG_COMPAT)           += compat_linux.o compat_signal.o
-obj-$(CONFIG_COMPAT)           += $(compat-obj-y)
 obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
 obj-$(CONFIG_KPROBES)          += kprobes.o
 obj-$(CONFIG_KPROBES)          += mcount.o
@@ -85,4 +82,3 @@ obj-$(CONFIG_TRACEPOINTS)     += trace.o
 
 # vdso
 obj-y                          += vdso64/
-obj-$(CONFIG_COMPAT)           += vdso32/
index 02051a596b87cc279213e55c45f724184825f016..7897d9411e1303098e6ac893aae6cff07fd8e7db 100644 (file)
@@ -3,7 +3,6 @@
 #include <linux/types.h>
 #include <linux/audit.h>
 #include <asm/unistd.h>
-#include "audit.h"
 
 static unsigned dir_class[] = {
 #include <asm-generic/audit_dir_write.h>
@@ -32,19 +31,11 @@ static unsigned signal_class[] = {
 
 int audit_classify_arch(int arch)
 {
-#ifdef CONFIG_COMPAT
-       if (arch == AUDIT_ARCH_S390)
-               return 1;
-#endif
        return 0;
 }
 
 int audit_classify_syscall(int abi, unsigned syscall)
 {
-#ifdef CONFIG_COMPAT
-       if (abi == AUDIT_ARCH_S390)
-               return s390_classify_syscall(syscall);
-#endif
        switch(syscall) {
        case __NR_open:
                return AUDITSC_OPEN;
@@ -63,13 +54,6 @@ int audit_classify_syscall(int abi, unsigned syscall)
 
 static int __init audit_classes_init(void)
 {
-#ifdef CONFIG_COMPAT
-       audit_register_class(AUDIT_CLASS_WRITE_32, s390_write_class);
-       audit_register_class(AUDIT_CLASS_READ_32, s390_read_class);
-       audit_register_class(AUDIT_CLASS_DIR_WRITE_32, s390_dir_class);
-       audit_register_class(AUDIT_CLASS_CHATTR_32, s390_chattr_class);
-       audit_register_class(AUDIT_CLASS_SIGNAL_32, s390_signal_class);
-#endif
        audit_register_class(AUDIT_CLASS_WRITE, write_class);
        audit_register_class(AUDIT_CLASS_READ, read_class);
        audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class);
diff --git a/arch/s390/kernel/audit.h b/arch/s390/kernel/audit.h
deleted file mode 100644 (file)
index 4d4b596..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ARCH_S390_KERNEL_AUDIT_H
-#define __ARCH_S390_KERNEL_AUDIT_H
-
-#include <linux/types.h>
-
-#ifdef CONFIG_COMPAT
-extern int s390_classify_syscall(unsigned);
-extern __u32 s390_dir_class[];
-extern __u32 s390_write_class[];
-extern __u32 s390_read_class[];
-extern __u32 s390_chattr_class[];
-extern __u32 s390_signal_class[];
-#endif /* CONFIG_COMPAT */
-
-#endif /* __ARCH_S390_KERNEL_AUDIT_H */
diff --git a/arch/s390/kernel/compat_audit.c b/arch/s390/kernel/compat_audit.c
deleted file mode 100644 (file)
index a7c46e8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#undef __s390x__
-#include <linux/audit_arch.h>
-#include <asm/unistd.h>
-#include "audit.h"
-
-unsigned s390_dir_class[] = {
-#include <asm-generic/audit_dir_write.h>
-~0U
-};
-
-unsigned s390_chattr_class[] = {
-#include <asm-generic/audit_change_attr.h>
-~0U
-};
-
-unsigned s390_write_class[] = {
-#include <asm-generic/audit_write.h>
-~0U
-};
-
-unsigned s390_read_class[] = {
-#include <asm-generic/audit_read.h>
-~0U
-};
-
-unsigned s390_signal_class[] = {
-#include <asm-generic/audit_signal.h>
-~0U
-};
-
-int s390_classify_syscall(unsigned syscall)
-{
-       switch(syscall) {
-       case __NR_open:
-               return AUDITSC_OPEN;
-       case __NR_openat:
-               return AUDITSC_OPENAT;
-       case __NR_socketcall:
-               return AUDITSC_SOCKETCALL;
-       case __NR_execve:
-               return AUDITSC_EXECVE;
-       case __NR_openat2:
-               return AUDITSC_OPENAT2;
-       default:
-               return AUDITSC_COMPAT;
-       }
-}
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
deleted file mode 100644 (file)
index f9d418d..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *  S390 version
- *    Copyright IBM Corp. 2000
- *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
- *               Gerhard Tonn (ton@de.ibm.com)   
- *               Thomas Spatzier (tspat@de.ibm.com)
- *
- *  Conversion between 31bit and 64bit native syscalls.
- *
- * Heavily inspired by the 32-bit Sparc compat code which is 
- * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
- * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
- *
- */
-
-
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/fs.h> 
-#include <linux/mm.h> 
-#include <linux/file.h> 
-#include <linux/signal.h>
-#include <linux/resource.h>
-#include <linux/times.h>
-#include <linux/smp.h>
-#include <linux/sem.h>
-#include <linux/msg.h>
-#include <linux/shm.h>
-#include <linux/uio.h>
-#include <linux/quota.h>
-#include <linux/poll.h>
-#include <linux/personality.h>
-#include <linux/stat.h>
-#include <linux/filter.h>
-#include <linux/highmem.h>
-#include <linux/mman.h>
-#include <linux/ipv6.h>
-#include <linux/in.h>
-#include <linux/icmpv6.h>
-#include <linux/syscalls.h>
-#include <linux/sysctl.h>
-#include <linux/binfmts.h>
-#include <linux/capability.h>
-#include <linux/compat.h>
-#include <linux/vfs.h>
-#include <linux/ptrace.h>
-#include <linux/fadvise.h>
-#include <linux/ipc.h>
-#include <linux/slab.h>
-
-#include <asm/types.h>
-#include <linux/uaccess.h>
-
-#include <net/scm.h>
-#include <net/sock.h>
-
-#include "compat_linux.h"
-
-#ifdef CONFIG_SYSVIPC
-COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, compat_ulong_t, second,
-               compat_ulong_t, third, compat_uptr_t, ptr)
-{
-       if (call >> 16)         /* hack for backward compatibility */
-               return -EINVAL;
-       return compat_ksys_ipc(call, first, second, third, ptr, third);
-}
-#endif
-
-COMPAT_SYSCALL_DEFINE3(s390_truncate64, const char __user *, path, u32, high, u32, low)
-{
-       return ksys_truncate(path, (unsigned long)high << 32 | low);
-}
-
-COMPAT_SYSCALL_DEFINE3(s390_ftruncate64, unsigned int, fd, u32, high, u32, low)
-{
-       return ksys_ftruncate(fd, (unsigned long)high << 32 | low);
-}
-
-COMPAT_SYSCALL_DEFINE5(s390_pread64, unsigned int, fd, char __user *, ubuf,
-                      compat_size_t, count, u32, high, u32, low)
-{
-       if ((compat_ssize_t) count < 0)
-               return -EINVAL;
-       return ksys_pread64(fd, ubuf, count, (unsigned long)high << 32 | low);
-}
-
-COMPAT_SYSCALL_DEFINE5(s390_pwrite64, unsigned int, fd, const char __user *, ubuf,
-                      compat_size_t, count, u32, high, u32, low)
-{
-       if ((compat_ssize_t) count < 0)
-               return -EINVAL;
-       return ksys_pwrite64(fd, ubuf, count, (unsigned long)high << 32 | low);
-}
-
-COMPAT_SYSCALL_DEFINE4(s390_readahead, int, fd, u32, high, u32, low, s32, count)
-{
-       return ksys_readahead(fd, (unsigned long)high << 32 | low, count);
-}
-
-struct stat64_emu31 {
-       unsigned long long  st_dev;
-       unsigned int    __pad1;
-#define STAT64_HAS_BROKEN_ST_INO        1
-       u32             __st_ino;
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-       u32             st_uid;
-       u32             st_gid;
-       unsigned long long  st_rdev;
-       unsigned int    __pad3;
-       long            st_size;
-       u32             st_blksize;
-       unsigned char   __pad4[4];
-       u32             __pad5;     /* future possible st_blocks high bits */
-       u32             st_blocks;  /* Number 512-byte blocks allocated. */
-       u32             st_atime;
-       u32             __pad6;
-       u32             st_mtime;
-       u32             __pad7;
-       u32             st_ctime;
-       u32             __pad8;     /* will be high 32 bits of ctime someday */
-       unsigned long   st_ino;
-};     
-
-static int cp_stat64(struct stat64_emu31 __user *ubuf, struct kstat *stat)
-{
-       struct stat64_emu31 tmp;
-
-       memset(&tmp, 0, sizeof(tmp));
-
-       tmp.st_dev = huge_encode_dev(stat->dev);
-       tmp.st_ino = stat->ino;
-       tmp.__st_ino = (u32)stat->ino;
-       tmp.st_mode = stat->mode;
-       tmp.st_nlink = (unsigned int)stat->nlink;
-       tmp.st_uid = from_kuid_munged(current_user_ns(), stat->uid);
-       tmp.st_gid = from_kgid_munged(current_user_ns(), stat->gid);
-       tmp.st_rdev = huge_encode_dev(stat->rdev);
-       tmp.st_size = stat->size;
-       tmp.st_blksize = (u32)stat->blksize;
-       tmp.st_blocks = (u32)stat->blocks;
-       tmp.st_atime = (u32)stat->atime.tv_sec;
-       tmp.st_mtime = (u32)stat->mtime.tv_sec;
-       tmp.st_ctime = (u32)stat->ctime.tv_sec;
-
-       return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 
-}
-
-COMPAT_SYSCALL_DEFINE2(s390_stat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf)
-{
-       struct kstat stat;
-       int ret = vfs_stat(filename, &stat);
-       if (!ret)
-               ret = cp_stat64(statbuf, &stat);
-       return ret;
-}
-
-COMPAT_SYSCALL_DEFINE2(s390_lstat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf)
-{
-       struct kstat stat;
-       int ret = vfs_lstat(filename, &stat);
-       if (!ret)
-               ret = cp_stat64(statbuf, &stat);
-       return ret;
-}
-
-COMPAT_SYSCALL_DEFINE2(s390_fstat64, unsigned int, fd, struct stat64_emu31 __user *, statbuf)
-{
-       struct kstat stat;
-       int ret = vfs_fstat(fd, &stat);
-       if (!ret)
-               ret = cp_stat64(statbuf, &stat);
-       return ret;
-}
-
-COMPAT_SYSCALL_DEFINE4(s390_fstatat64, unsigned int, dfd, const char __user *, filename,
-                      struct stat64_emu31 __user *, statbuf, int, flag)
-{
-       struct kstat stat;
-       int error;
-
-       error = vfs_fstatat(dfd, filename, &stat, flag);
-       if (error)
-               return error;
-       return cp_stat64(statbuf, &stat);
-}
-
-/*
- * Linux/i386 didn't use to be able to handle more than
- * 4 system call parameters, so these system calls used a memory
- * block for parameter passing..
- */
-
-struct mmap_arg_struct_emu31 {
-       compat_ulong_t addr;
-       compat_ulong_t len;
-       compat_ulong_t prot;
-       compat_ulong_t flags;
-       compat_ulong_t fd;
-       compat_ulong_t offset;
-};
-
-COMPAT_SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct_emu31 __user *, arg)
-{
-       struct mmap_arg_struct_emu31 a;
-
-       if (copy_from_user(&a, arg, sizeof(a)))
-               return -EFAULT;
-       if (a.offset & ~PAGE_MASK)
-               return -EINVAL;
-       return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
-                              a.offset >> PAGE_SHIFT);
-}
-
-COMPAT_SYSCALL_DEFINE1(s390_mmap2, struct mmap_arg_struct_emu31 __user *, arg)
-{
-       struct mmap_arg_struct_emu31 a;
-
-       if (copy_from_user(&a, arg, sizeof(a)))
-               return -EFAULT;
-       return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
-}
-
-COMPAT_SYSCALL_DEFINE3(s390_read, unsigned int, fd, char __user *, buf, compat_size_t, count)
-{
-       if ((compat_ssize_t) count < 0)
-               return -EINVAL; 
-
-       return ksys_read(fd, buf, count);
-}
-
-COMPAT_SYSCALL_DEFINE3(s390_write, unsigned int, fd, const char __user *, buf, compat_size_t, count)
-{
-       if ((compat_ssize_t) count < 0)
-               return -EINVAL; 
-
-       return ksys_write(fd, buf, count);
-}
-
-/*
- * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
- * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
- * because the 31 bit values differ from the 64 bit values.
- */
-
-COMPAT_SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, high, u32, low, compat_size_t, len, int, advise)
-{
-       if (advise == 4)
-               advise = POSIX_FADV_DONTNEED;
-       else if (advise == 5)
-               advise = POSIX_FADV_NOREUSE;
-       return ksys_fadvise64_64(fd, (unsigned long)high << 32 | low, len,
-                                advise);
-}
-
-struct fadvise64_64_args {
-       int fd;
-       long long offset;
-       long long len;
-       int advice;
-};
-
-COMPAT_SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args)
-{
-       struct fadvise64_64_args a;
-
-       if ( copy_from_user(&a, args, sizeof(a)) )
-               return -EFAULT;
-       if (a.advice == 4)
-               a.advice = POSIX_FADV_DONTNEED;
-       else if (a.advice == 5)
-               a.advice = POSIX_FADV_NOREUSE;
-       return ksys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
-}
-
-COMPAT_SYSCALL_DEFINE6(s390_sync_file_range, int, fd, u32, offhigh, u32, offlow,
-                      u32, nhigh, u32, nlow, unsigned int, flags)
-{
-       return ksys_sync_file_range(fd, ((loff_t)offhigh << 32) + offlow,
-                                  ((u64)nhigh << 32) + nlow, flags);
-}
-
-COMPAT_SYSCALL_DEFINE6(s390_fallocate, int, fd, int, mode, u32, offhigh, u32, offlow,
-                      u32, lenhigh, u32, lenlow)
-{
-       return ksys_fallocate(fd, mode, ((loff_t)offhigh << 32) + offlow,
-                             ((u64)lenhigh << 32) + lenlow);
-}
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
deleted file mode 100644 (file)
index 133f22b..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_S390X_S390_H
-#define _ASM_S390X_S390_H
-
-#include <linux/compat.h>
-#include <linux/socket.h>
-#include <linux/syscalls.h>
-#include <asm/ptrace.h>
-
-/*
- * Macro that masks the high order bit of a 32 bit pointer and
- * converts it to a 64 bit pointer.
- */
-#define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
-#define AA(__x)        ((unsigned long)(__x))
-
-/* Now 32bit compatibility types */
-struct ipc_kludge_32 {
-       __u32   msgp;   /* pointer */
-       __s32   msgtyp;
-};
-
-/* asm/sigcontext.h */
-typedef union {
-       __u64   d;
-       __u32   f;
-} freg_t32;
-
-typedef struct {
-       unsigned int    fpc;
-       unsigned int    pad;
-       freg_t32        fprs[__NUM_FPRS];
-} _s390_fp_regs32;
-
-typedef struct {
-       psw32_t         psw;
-       __u32           gprs[__NUM_GPRS];
-       __u32           acrs[__NUM_ACRS];
-} _s390_regs_common32;
-
-typedef struct {
-       _s390_regs_common32 regs;
-       _s390_fp_regs32     fpregs;
-} _sigregs32;
-
-typedef struct {
-       __u32           gprs_high[__NUM_GPRS];
-       __u64           vxrs_low[__NUM_VXRS_LOW];
-       __vector128     vxrs_high[__NUM_VXRS_HIGH];
-       __u8            __reserved[128];
-} _sigregs_ext32;
-
-#define _SIGCONTEXT_NSIG32     64
-#define _SIGCONTEXT_NSIG_BPW32 32
-#define __SIGNAL_FRAMESIZE32   96
-#define _SIGMASK_COPY_SIZE32   (sizeof(u32) * 2)
-
-struct sigcontext32 {
-       __u32   oldmask[_COMPAT_NSIG_WORDS];
-       __u32   sregs;  /* pointer */
-};
-
-/* asm/signal.h */
-
-/* asm/ucontext.h */
-struct ucontext32 {
-       __u32                   uc_flags;
-       __u32                   uc_link;        /* pointer */
-       compat_stack_t          uc_stack;
-       _sigregs32              uc_mcontext;
-       compat_sigset_t         uc_sigmask;
-       /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
-       unsigned char           __unused[128 - sizeof(compat_sigset_t)];
-       _sigregs_ext32          uc_mcontext_ext;
-};
-
-struct stat64_emu31;
-struct mmap_arg_struct_emu31;
-struct fadvise64_64_args;
-
-long compat_sys_s390_truncate64(const char __user *path, u32 high, u32 low);
-long compat_sys_s390_ftruncate64(unsigned int fd, u32 high, u32 low);
-long compat_sys_s390_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, u32 high, u32 low);
-long compat_sys_s390_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, u32 high, u32 low);
-long compat_sys_s390_readahead(int fd, u32 high, u32 low, s32 count);
-long compat_sys_s390_stat64(const char __user *filename, struct stat64_emu31 __user *statbuf);
-long compat_sys_s390_lstat64(const char __user *filename, struct stat64_emu31 __user *statbuf);
-long compat_sys_s390_fstat64(unsigned int fd, struct stat64_emu31 __user *statbuf);
-long compat_sys_s390_fstatat64(unsigned int dfd, const char __user *filename, struct stat64_emu31 __user *statbuf, int flag);
-long compat_sys_s390_old_mmap(struct mmap_arg_struct_emu31 __user *arg);
-long compat_sys_s390_mmap2(struct mmap_arg_struct_emu31 __user *arg);
-long compat_sys_s390_read(unsigned int fd, char __user *buf, compat_size_t count);
-long compat_sys_s390_write(unsigned int fd, const char __user *buf, compat_size_t count);
-long compat_sys_s390_fadvise64(int fd, u32 high, u32 low, compat_size_t len, int advise);
-long compat_sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
-long compat_sys_s390_sync_file_range(int fd, u32 offhigh, u32 offlow, u32 nhigh, u32 nlow, unsigned int flags);
-long compat_sys_s390_fallocate(int fd, int mode, u32 offhigh, u32 offlow, u32 lenhigh, u32 lenlow);
-long compat_sys_sigreturn(void);
-long compat_sys_rt_sigreturn(void);
-
-#endif /* _ASM_S390X_S390_H */
diff --git a/arch/s390/kernel/compat_ptrace.h b/arch/s390/kernel/compat_ptrace.h
deleted file mode 100644 (file)
index 3c400fc..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _PTRACE32_H
-#define _PTRACE32_H
-
-#include <asm/ptrace.h>    /* needed for NUM_CR_WORDS */
-#include "compat_linux.h"  /* needed for psw_compat_t */
-
-struct compat_per_struct_kernel {
-       __u32 cr9;              /* PER control bits */
-       __u32 cr10;             /* PER starting address */
-       __u32 cr11;             /* PER ending address */
-       __u32 bits;             /* Obsolete software bits */
-       __u32 starting_addr;    /* User specified start address */
-       __u32 ending_addr;      /* User specified end address */
-       __u16 perc_atmid;       /* PER trap ATMID */
-       __u32 address;          /* PER trap instruction address */
-       __u8  access_id;        /* PER trap access identification */
-};
-
-struct compat_user_regs_struct
-{
-       psw_compat_t psw;
-       u32 gprs[NUM_GPRS];
-       u32 acrs[NUM_ACRS];
-       u32 orig_gpr2;
-       /* nb: there's a 4-byte hole here */
-       s390_fp_regs fp_regs;
-       /*
-        * These per registers are in here so that gdb can modify them
-        * itself as there is no "official" ptrace interface for hardware
-        * watchpoints. This is the way intel does it.
-        */
-       struct compat_per_struct_kernel per_info;
-       u32  ieee_instruction_pointer;  /* obsolete, always 0 */
-};
-
-struct compat_user {
-       /* We start with the registers, to mimic the way that "memory"
-          is returned from the ptrace(3,...) function.  */
-       struct compat_user_regs_struct regs;
-       /* The rest of this junk is to help gdb figure out what goes where */
-       u32 u_tsize;            /* Text segment size (pages). */
-       u32 u_dsize;            /* Data segment size (pages). */
-       u32 u_ssize;            /* Stack segment size (pages). */
-       u32 start_code;         /* Starting virtual address of text. */
-       u32 start_stack;        /* Starting virtual address of stack area.
-                                  This is actually the bottom of the stack,
-                                  the top of the stack is always found in the
-                                  esp register.  */
-       s32 signal;              /* Signal that caused the core dump. */
-       u32 u_ar0;               /* Used by gdb to help find the values for */
-                                /* the registers. */
-       u32 magic;               /* To uniquely identify a core file */
-       char u_comm[32];         /* User command that was responsible */
-};
-
-typedef struct
-{
-       __u32   len;
-       __u32   kernel_addr;
-       __u32   process_addr;
-} compat_ptrace_area;
-
-#endif /* _PTRACE32_H */
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
deleted file mode 100644 (file)
index 5a86b9d..0000000
+++ /dev/null
@@ -1,420 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *    Copyright IBM Corp. 2000, 2006
- *    Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
- *               Gerhard Tonn (ton@de.ibm.com)                  
- *
- *  Copyright (C) 1991, 1992  Linus Torvalds
- *
- *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
- */
-
-#include <linux/compat.h>
-#include <linux/sched.h>
-#include <linux/sched/task_stack.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/kernel.h>
-#include <linux/signal.h>
-#include <linux/errno.h>
-#include <linux/wait.h>
-#include <linux/ptrace.h>
-#include <linux/unistd.h>
-#include <linux/stddef.h>
-#include <linux/tty.h>
-#include <linux/personality.h>
-#include <linux/binfmts.h>
-#include <asm/vdso-symbols.h>
-#include <asm/access-regs.h>
-#include <asm/ucontext.h>
-#include <linux/uaccess.h>
-#include <asm/lowcore.h>
-#include <asm/fpu.h>
-#include "compat_linux.h"
-#include "compat_ptrace.h"
-#include "entry.h"
-
-typedef struct 
-{
-       __u8 callee_used_stack[__SIGNAL_FRAMESIZE32];
-       struct sigcontext32 sc;
-       _sigregs32 sregs;
-       int signo;
-       _sigregs_ext32 sregs_ext;
-       __u16 svc_insn;         /* Offset of svc_insn is NOT fixed! */
-} sigframe32;
-
-typedef struct 
-{
-       __u8 callee_used_stack[__SIGNAL_FRAMESIZE32];
-       __u16 svc_insn;
-       compat_siginfo_t info;
-       struct ucontext32 uc;
-} rt_sigframe32;
-
-/* Store registers needed to create the signal frame */
-static void store_sigregs(void)
-{
-       save_access_regs(current->thread.acrs);
-       save_user_fpu_regs();
-}
-
-/* Load registers after signal return */
-static void load_sigregs(void)
-{
-       restore_access_regs(current->thread.acrs);
-}
-
-static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
-{
-       _sigregs32 user_sregs;
-       int i;
-
-       user_sregs.regs.psw.mask = (__u32)(regs->psw.mask >> 32);
-       user_sregs.regs.psw.mask &= PSW32_MASK_USER | PSW32_MASK_RI;
-       user_sregs.regs.psw.mask |= PSW32_USER_BITS;
-       user_sregs.regs.psw.addr = (__u32) regs->psw.addr |
-               (__u32)(regs->psw.mask & PSW_MASK_BA);
-       for (i = 0; i < NUM_GPRS; i++)
-               user_sregs.regs.gprs[i] = (__u32) regs->gprs[i];
-       memcpy(&user_sregs.regs.acrs, current->thread.acrs,
-              sizeof(user_sregs.regs.acrs));
-       fpregs_store((_s390_fp_regs *) &user_sregs.fpregs, &current->thread.ufpu);
-       if (__copy_to_user(sregs, &user_sregs, sizeof(_sigregs32)))
-               return -EFAULT;
-       return 0;
-}
-
-static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
-{
-       _sigregs32 user_sregs;
-       int i;
-
-       /* Always make any pending restarted system call return -EINTR */
-       current->restart_block.fn = do_no_restart_syscall;
-
-       if (__copy_from_user(&user_sregs, &sregs->regs, sizeof(user_sregs)))
-               return -EFAULT;
-
-       if (!is_ri_task(current) && (user_sregs.regs.psw.mask & PSW32_MASK_RI))
-               return -EINVAL;
-
-       /* Use regs->psw.mask instead of PSW_USER_BITS to preserve PER bit. */
-       regs->psw.mask = (regs->psw.mask & ~(PSW_MASK_USER | PSW_MASK_RI)) |
-               (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_USER) << 32 |
-               (__u64)(user_sregs.regs.psw.mask & PSW32_MASK_RI) << 32 |
-               (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_AMODE);
-       /* Check for invalid user address space control. */
-       if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_HOME)
-               regs->psw.mask = PSW_ASC_PRIMARY |
-                       (regs->psw.mask & ~PSW_MASK_ASC);
-       regs->psw.addr = (__u64)(user_sregs.regs.psw.addr & PSW32_ADDR_INSN);
-       for (i = 0; i < NUM_GPRS; i++)
-               regs->gprs[i] = (__u64) user_sregs.regs.gprs[i];
-       memcpy(&current->thread.acrs, &user_sregs.regs.acrs,
-              sizeof(current->thread.acrs));
-       fpregs_load((_s390_fp_regs *)&user_sregs.fpregs, &current->thread.ufpu);
-
-       clear_pt_regs_flag(regs, PIF_SYSCALL); /* No longer in a system call */
-       return 0;
-}
-
-static int save_sigregs_ext32(struct pt_regs *regs,
-                             _sigregs_ext32 __user *sregs_ext)
-{
-       __u32 gprs_high[NUM_GPRS];
-       __u64 vxrs[__NUM_VXRS_LOW];
-       int i;
-
-       /* Save high gprs to signal stack */
-       for (i = 0; i < NUM_GPRS; i++)
-               gprs_high[i] = regs->gprs[i] >> 32;
-       if (__copy_to_user(&sregs_ext->gprs_high, &gprs_high,
-                          sizeof(sregs_ext->gprs_high)))
-               return -EFAULT;
-
-       /* Save vector registers to signal stack */
-       if (cpu_has_vx()) {
-               for (i = 0; i < __NUM_VXRS_LOW; i++)
-                       vxrs[i] = current->thread.ufpu.vxrs[i].low;
-               if (__copy_to_user(&sregs_ext->vxrs_low, vxrs,
-                                  sizeof(sregs_ext->vxrs_low)) ||
-                   __copy_to_user(&sregs_ext->vxrs_high,
-                                  current->thread.ufpu.vxrs + __NUM_VXRS_LOW,
-                                  sizeof(sregs_ext->vxrs_high)))
-                       return -EFAULT;
-       }
-       return 0;
-}
-
-static int restore_sigregs_ext32(struct pt_regs *regs,
-                                _sigregs_ext32 __user *sregs_ext)
-{
-       __u32 gprs_high[NUM_GPRS];
-       __u64 vxrs[__NUM_VXRS_LOW];
-       int i;
-
-       /* Restore high gprs from signal stack */
-       if (__copy_from_user(&gprs_high, &sregs_ext->gprs_high,
-                            sizeof(sregs_ext->gprs_high)))
-               return -EFAULT;
-       for (i = 0; i < NUM_GPRS; i++)
-               *(__u32 *)&regs->gprs[i] = gprs_high[i];
-
-       /* Restore vector registers from signal stack */
-       if (cpu_has_vx()) {
-               if (__copy_from_user(vxrs, &sregs_ext->vxrs_low,
-                                    sizeof(sregs_ext->vxrs_low)) ||
-                   __copy_from_user(current->thread.ufpu.vxrs + __NUM_VXRS_LOW,
-                                    &sregs_ext->vxrs_high,
-                                    sizeof(sregs_ext->vxrs_high)))
-                       return -EFAULT;
-               for (i = 0; i < __NUM_VXRS_LOW; i++)
-                       current->thread.ufpu.vxrs[i].low = vxrs[i];
-       }
-       return 0;
-}
-
-COMPAT_SYSCALL_DEFINE0(sigreturn)
-{
-       struct pt_regs *regs = task_pt_regs(current);
-       sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15];
-       sigset_t set;
-
-       if (get_compat_sigset(&set, (compat_sigset_t __user *)frame->sc.oldmask))
-               goto badframe;
-       set_current_blocked(&set);
-       save_user_fpu_regs();
-       if (restore_sigregs32(regs, &frame->sregs))
-               goto badframe;
-       if (restore_sigregs_ext32(regs, &frame->sregs_ext))
-               goto badframe;
-       load_sigregs();
-       return regs->gprs[2];
-badframe:
-       force_sig(SIGSEGV);
-       return 0;
-}
-
-COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
-{
-       struct pt_regs *regs = task_pt_regs(current);
-       rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15];
-       sigset_t set;
-
-       if (get_compat_sigset(&set, &frame->uc.uc_sigmask))
-               goto badframe;
-       set_current_blocked(&set);
-       if (compat_restore_altstack(&frame->uc.uc_stack))
-               goto badframe;
-       save_user_fpu_regs();
-       if (restore_sigregs32(regs, &frame->uc.uc_mcontext))
-               goto badframe;
-       if (restore_sigregs_ext32(regs, &frame->uc.uc_mcontext_ext))
-               goto badframe;
-       load_sigregs();
-       return regs->gprs[2];
-badframe:
-       force_sig(SIGSEGV);
-       return 0;
-}      
-
-/*
- * Set up a signal frame.
- */
-
-
-/*
- * Determine which stack to use..
- */
-static inline void __user *
-get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
-{
-       unsigned long sp;
-
-       /* Default to using normal stack */
-       sp = (unsigned long) A(regs->gprs[15]);
-
-       /* Overflow on alternate signal stack gives SIGSEGV. */
-       if (on_sig_stack(sp) && !on_sig_stack((sp - frame_size) & -8UL))
-               return (void __user *) -1UL;
-
-       /* This is the X/Open sanctioned signal stack switching.  */
-       if (ka->sa.sa_flags & SA_ONSTACK) {
-               if (! sas_ss_flags(sp))
-                       sp = current->sas_ss_sp + current->sas_ss_size;
-       }
-
-       return (void __user *)((sp - frame_size) & -8ul);
-}
-
-static int setup_frame32(struct ksignal *ksig, sigset_t *set,
-                        struct pt_regs *regs)
-{
-       int sig = ksig->sig;
-       sigframe32 __user *frame;
-       unsigned long restorer;
-       size_t frame_size;
-
-       /*
-        * gprs_high are always present for 31-bit compat tasks.
-        * The space for vector registers is only allocated if
-        * the machine supports it
-        */
-       frame_size = sizeof(*frame) - sizeof(frame->sregs_ext.__reserved);
-       if (!cpu_has_vx())
-               frame_size -= sizeof(frame->sregs_ext.vxrs_low) +
-                             sizeof(frame->sregs_ext.vxrs_high);
-       frame = get_sigframe(&ksig->ka, regs, frame_size);
-       if (frame == (void __user *) -1UL)
-               return -EFAULT;
-
-       /* Set up backchain. */
-       if (__put_user(regs->gprs[15], (unsigned int __user *) frame))
-               return -EFAULT;
-
-       /* Create struct sigcontext32 on the signal stack */
-       if (put_compat_sigset((compat_sigset_t __user *)frame->sc.oldmask,
-                             set, sizeof(compat_sigset_t)))
-               return -EFAULT;
-       if (__put_user(ptr_to_compat(&frame->sregs), &frame->sc.sregs))
-               return -EFAULT;
-
-       /* Store registers needed to create the signal frame */
-       store_sigregs();
-
-       /* Create _sigregs32 on the signal stack */
-       if (save_sigregs32(regs, &frame->sregs))
-               return -EFAULT;
-
-       /* Place signal number on stack to allow backtrace from handler.  */
-       if (__put_user(regs->gprs[2], (int __force __user *) &frame->signo))
-               return -EFAULT;
-
-       /* Create _sigregs_ext32 on the signal stack */
-       if (save_sigregs_ext32(regs, &frame->sregs_ext))
-               return -EFAULT;
-
-       /* Set up to return from userspace.  If provided, use a stub
-          already in userspace.  */
-       if (ksig->ka.sa.sa_flags & SA_RESTORER) {
-               restorer = (unsigned long __force)
-                       ksig->ka.sa.sa_restorer | PSW32_ADDR_AMODE;
-       } else {
-               restorer = VDSO32_SYMBOL(current, sigreturn);
-        }
-
-       /* Set up registers for signal handler */
-       regs->gprs[14] = restorer;
-       regs->gprs[15] = (__force __u64) frame;
-       /* Force 31 bit amode and default user address space control. */
-       regs->psw.mask = PSW_MASK_BA |
-               (PSW_USER_BITS & PSW_MASK_ASC) |
-               (regs->psw.mask & ~PSW_MASK_ASC);
-       regs->psw.addr = (__force __u64) ksig->ka.sa.sa_handler;
-
-       regs->gprs[2] = sig;
-       regs->gprs[3] = (__force __u64) &frame->sc;
-
-       /* We forgot to include these in the sigcontext.
-          To avoid breaking binary compatibility, they are passed as args. */
-       if (sig == SIGSEGV || sig == SIGBUS || sig == SIGILL ||
-           sig == SIGTRAP || sig == SIGFPE) {
-               /* set extra registers only for synchronous signals */
-               regs->gprs[4] = regs->int_code & 127;
-               regs->gprs[5] = regs->int_parm_long;
-               regs->gprs[6] = current->thread.last_break;
-       }
-
-       return 0;
-}
-
-static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set,
-                           struct pt_regs *regs)
-{
-       rt_sigframe32 __user *frame;
-       unsigned long restorer;
-       size_t frame_size;
-       u32 uc_flags;
-
-       frame_size = sizeof(*frame) -
-                    sizeof(frame->uc.uc_mcontext_ext.__reserved);
-       /*
-        * gprs_high are always present for 31-bit compat tasks.
-        * The space for vector registers is only allocated if
-        * the machine supports it
-        */
-       uc_flags = UC_GPRS_HIGH;
-       if (cpu_has_vx()) {
-               uc_flags |= UC_VXRS;
-       } else {
-               frame_size -= sizeof(frame->uc.uc_mcontext_ext.vxrs_low) +
-                             sizeof(frame->uc.uc_mcontext_ext.vxrs_high);
-       }
-       frame = get_sigframe(&ksig->ka, regs, frame_size);
-       if (frame == (void __user *) -1UL)
-               return -EFAULT;
-
-       /* Set up backchain. */
-       if (__put_user(regs->gprs[15], (unsigned int __force __user *) frame))
-               return -EFAULT;
-
-       /* Set up to return from userspace.  If provided, use a stub
-          already in userspace.  */
-       if (ksig->ka.sa.sa_flags & SA_RESTORER) {
-               restorer = (unsigned long __force)
-                       ksig->ka.sa.sa_restorer | PSW32_ADDR_AMODE;
-       } else {
-               restorer = VDSO32_SYMBOL(current, rt_sigreturn);
-       }
-
-       /* Create siginfo on the signal stack */
-       if (copy_siginfo_to_user32(&frame->info, &ksig->info))
-               return -EFAULT;
-
-       /* Store registers needed to create the signal frame */
-       store_sigregs();
-
-       /* Create ucontext on the signal stack. */
-       if (__put_user(uc_flags, &frame->uc.uc_flags) ||
-           __put_user(0, &frame->uc.uc_link) ||
-           __compat_save_altstack(&frame->uc.uc_stack, regs->gprs[15]) ||
-           save_sigregs32(regs, &frame->uc.uc_mcontext) ||
-           put_compat_sigset(&frame->uc.uc_sigmask, set, sizeof(compat_sigset_t)) ||
-           save_sigregs_ext32(regs, &frame->uc.uc_mcontext_ext))
-               return -EFAULT;
-
-       /* Set up registers for signal handler */
-       regs->gprs[14] = restorer;
-       regs->gprs[15] = (__force __u64) frame;
-       /* Force 31 bit amode and default user address space control. */
-       regs->psw.mask = PSW_MASK_BA |
-               (PSW_USER_BITS & PSW_MASK_ASC) |
-               (regs->psw.mask & ~PSW_MASK_ASC);
-       regs->psw.addr = (__u64 __force) ksig->ka.sa.sa_handler;
-
-       regs->gprs[2] = ksig->sig;
-       regs->gprs[3] = (__force __u64) &frame->info;
-       regs->gprs[4] = (__force __u64) &frame->uc;
-       regs->gprs[5] = current->thread.last_break;
-       return 0;
-}
-
-/*
- * OK, we're invoking a handler
- */    
-
-void handle_signal32(struct ksignal *ksig, sigset_t *oldset,
-                    struct pt_regs *regs)
-{
-       int ret;
-
-       /* Set up the stack frame */
-       if (ksig->ka.sa.sa_flags & SA_SIGINFO)
-               ret = setup_rt_frame32(ksig, oldset, regs);
-       else
-               ret = setup_frame32(ksig, oldset, regs);
-
-       signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLE_STEP));
-}
-
index 75b0fbb236d05f420b20cac6bac925e8ac36fa68..3c7f183a945d1921449fa511d8e48f18045b5ad9 100644 (file)
@@ -614,12 +614,3 @@ SYM_DATA_START(sys_call_table)
 #include <asm/syscall_table.h>
 SYM_DATA_END(sys_call_table)
 #undef SYSCALL
-
-#ifdef CONFIG_COMPAT
-
-#define SYSCALL(esame,emu)     .quad __s390_ ## emu
-SYM_DATA_START(sys_call_table_emu)
-#include <asm/syscall_table.h>
-SYM_DATA_END(sys_call_table_emu)
-#undef SYSCALL
-#endif
index 04457d88e5892c35f267be70c24051648b37d5e0..b7fa9712ee1ed9d3b51be8bf3375fd8cad15da96 100644 (file)
@@ -1689,7 +1689,6 @@ static const struct file_operations cfset_fops = {
        .open = cfset_open,
        .release = cfset_release,
        .unlocked_ioctl = cfset_ioctl,
-       .compat_ioctl = cfset_ioctl,
 };
 
 static struct miscdevice cfset_dev = {
index 91b8716c883a58dcccfc77b7d1e6b0ea71444310..2de1574d95b2db6620c36efc77e8a18351e44394 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/seq_file.h>
 #include <linux/spinlock.h>
 #include <linux/uaccess.h>
-#include <linux/compat.h>
 #include <linux/sysfs.h>
 #include <asm/stacktrace.h>
 #include <asm/irq.h>
index a6b058ee4a36c0f097958723f6e34bc09623ca6e..7b305f1456f825f853b80151877d6b08e203e986 100644 (file)
@@ -44,9 +44,6 @@ int perf_reg_validate(u64 mask)
 
 u64 perf_reg_abi(struct task_struct *task)
 {
-       if (test_tsk_thread_flag(task, TIF_31BIT))
-               return PERF_SAMPLE_REGS_ABI_32;
-
        return PERF_SAMPLE_REGS_ABI_64;
 }
 
index b107dbca4ed7df55f5f12fdbf00b6d5a7c0fdfa3..0df95dcb2101206e445db0b996a3db475b591d58 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/tick.h>
 #include <linux/personality.h>
 #include <linux/syscalls.h>
-#include <linux/compat.h>
 #include <linux/kprobes.h>
 #include <linux/random.h>
 #include <linux/init_task.h>
@@ -166,12 +165,8 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 
        /* Set a new TLS ?  */
        if (clone_flags & CLONE_SETTLS) {
-               if (is_compat_task()) {
-                       p->thread.acrs[0] = (unsigned int)tls;
-               } else {
-                       p->thread.acrs[0] = (unsigned int)(tls >> 32);
-                       p->thread.acrs[1] = (unsigned int)tls;
-               }
+               p->thread.acrs[0] = (unsigned int)(tls >> 32);
+               p->thread.acrs[1] = (unsigned int)tls;
        }
        /*
         * s390 stores the svc return address in arch_data when calling
index 494216c4b4f3d33656665585f5a4bef0eec311a2..ceaa1726e3285196a98299926edf9da37fa34941 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/elf.h>
 #include <linux/regset.h>
 #include <linux/seccomp.h>
-#include <linux/compat.h>
 #include <trace/syscall.h>
 #include <asm/guarded_storage.h>
 #include <asm/access-regs.h>
 
 #include "entry.h"
 
-#ifdef CONFIG_COMPAT
-#include "compat_ptrace.h"
-#endif
-
 void update_cr_regs(struct task_struct *task)
 {
        struct pt_regs *regs = task_pt_regs(task);
@@ -507,308 +502,6 @@ long arch_ptrace(struct task_struct *child, long request,
        }
 }
 
-#ifdef CONFIG_COMPAT
-/*
- * Now the fun part starts... a 31 bit program running in the
- * 31 bit emulation tracing another program. PTRACE_PEEKTEXT,
- * PTRACE_PEEKDATA, PTRACE_POKETEXT and PTRACE_POKEDATA are easy
- * to handle, the difference to the 64 bit versions of the requests
- * is that the access is done in multiples of 4 byte instead of
- * 8 bytes (sizeof(unsigned long) on 31/64 bit).
- * The ugly part are PTRACE_PEEKUSR, PTRACE_PEEKUSR_AREA,
- * PTRACE_POKEUSR and PTRACE_POKEUSR_AREA. If the traced program
- * is a 31 bit program too, the content of struct user can be
- * emulated. A 31 bit program peeking into the struct user of
- * a 64 bit program is a no-no.
- */
-
-/*
- * Same as peek_user_per but for a 31 bit program.
- */
-static inline __u32 __peek_user_per_compat(struct task_struct *child,
-                                          addr_t addr)
-{
-       if (addr == offsetof(struct compat_per_struct_kernel, cr9))
-               /* Control bits of the active per set. */
-               return (__u32) test_thread_flag(TIF_SINGLE_STEP) ?
-                       PER_EVENT_IFETCH : child->thread.per_user.control;
-       else if (addr == offsetof(struct compat_per_struct_kernel, cr10))
-               /* Start address of the active per set. */
-               return (__u32) test_thread_flag(TIF_SINGLE_STEP) ?
-                       0 : child->thread.per_user.start;
-       else if (addr == offsetof(struct compat_per_struct_kernel, cr11))
-               /* End address of the active per set. */
-               return test_thread_flag(TIF_SINGLE_STEP) ?
-                       PSW32_ADDR_INSN : child->thread.per_user.end;
-       else if (addr == offsetof(struct compat_per_struct_kernel, bits))
-               /* Single-step bit. */
-               return (__u32) test_thread_flag(TIF_SINGLE_STEP) ?
-                       0x80000000 : 0;
-       else if (addr == offsetof(struct compat_per_struct_kernel, starting_addr))
-               /* Start address of the user specified per set. */
-               return (__u32) child->thread.per_user.start;
-       else if (addr == offsetof(struct compat_per_struct_kernel, ending_addr))
-               /* End address of the user specified per set. */
-               return (__u32) child->thread.per_user.end;
-       else if (addr == offsetof(struct compat_per_struct_kernel, perc_atmid))
-               /* PER code, ATMID and AI of the last PER trap */
-               return (__u32) child->thread.per_event.cause << 16;
-       else if (addr == offsetof(struct compat_per_struct_kernel, address))
-               /* Address of the last PER trap */
-               return (__u32) child->thread.per_event.address;
-       else if (addr == offsetof(struct compat_per_struct_kernel, access_id))
-               /* Access id of the last PER trap */
-               return (__u32) child->thread.per_event.paid << 24;
-       return 0;
-}
-
-/*
- * Same as peek_user but for a 31 bit program.
- */
-static u32 __peek_user_compat(struct task_struct *child, addr_t addr)
-{
-       addr_t offset;
-       __u32 tmp;
-
-       if (addr < offsetof(struct compat_user, regs.acrs)) {
-               struct pt_regs *regs = task_pt_regs(child);
-               /*
-                * psw and gprs are stored on the stack
-                */
-               if (addr == offsetof(struct compat_user, regs.psw.mask)) {
-                       /* Fake a 31 bit psw mask. */
-                       tmp = (__u32)(regs->psw.mask >> 32);
-                       tmp &= PSW32_MASK_USER | PSW32_MASK_RI;
-                       tmp |= PSW32_USER_BITS;
-               } else if (addr == offsetof(struct compat_user, regs.psw.addr)) {
-                       /* Fake a 31 bit psw address. */
-                       tmp = (__u32) regs->psw.addr |
-                               (__u32)(regs->psw.mask & PSW_MASK_BA);
-               } else {
-                       /* gpr 0-15 */
-                       tmp = *(__u32 *)((addr_t) &regs->psw + addr*2 + 4);
-               }
-       } else if (addr < offsetof(struct compat_user, regs.orig_gpr2)) {
-               /*
-                * access registers are stored in the thread structure
-                */
-               offset = addr - offsetof(struct compat_user, regs.acrs);
-               tmp = *(__u32*)((addr_t) &child->thread.acrs + offset);
-
-       } else if (addr == offsetof(struct compat_user, regs.orig_gpr2)) {
-               /*
-                * orig_gpr2 is stored on the kernel stack
-                */
-               tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4);
-
-       } else if (addr < offsetof(struct compat_user, regs.fp_regs)) {
-               /*
-                * prevent reads of padding hole between
-                * orig_gpr2 and fp_regs on s390.
-                */
-               tmp = 0;
-
-       } else if (addr == offsetof(struct compat_user, regs.fp_regs.fpc)) {
-               /*
-                * floating point control reg. is in the thread structure
-                */
-               tmp = child->thread.ufpu.fpc;
-
-       } else if (addr < offsetof(struct compat_user, regs.fp_regs) + sizeof(s390_fp_regs)) {
-               /*
-                * floating point regs. are in the child->thread.ufpu.vxrs array
-                */
-               offset = addr - offsetof(struct compat_user, regs.fp_regs.fprs);
-               tmp = *(__u32 *)((addr_t)child->thread.ufpu.vxrs + 2 * offset);
-       } else if (addr < offsetof(struct compat_user, regs.per_info) + sizeof(struct compat_per_struct_kernel)) {
-               /*
-                * Handle access to the per_info structure.
-                */
-               addr -= offsetof(struct compat_user, regs.per_info);
-               tmp = __peek_user_per_compat(child, addr);
-
-       } else
-               tmp = 0;
-
-       return tmp;
-}
-
-static int peek_user_compat(struct task_struct *child,
-                           addr_t addr, addr_t data)
-{
-       __u32 tmp;
-
-       if (!is_compat_task() || (addr & 3) || addr > sizeof(struct user) - 3)
-               return -EIO;
-
-       tmp = __peek_user_compat(child, addr);
-       return put_user(tmp, (__u32 __user *) data);
-}
-
-/*
- * Same as poke_user_per but for a 31 bit program.
- */
-static inline void __poke_user_per_compat(struct task_struct *child,
-                                         addr_t addr, __u32 data)
-{
-       if (addr == offsetof(struct compat_per_struct_kernel, cr9))
-               /* PER event mask of the user specified per set. */
-               child->thread.per_user.control =
-                       data & (PER_EVENT_MASK | PER_CONTROL_MASK);
-       else if (addr == offsetof(struct compat_per_struct_kernel, starting_addr))
-               /* Starting address of the user specified per set. */
-               child->thread.per_user.start = data;
-       else if (addr == offsetof(struct compat_per_struct_kernel, ending_addr))
-               /* Ending address of the user specified per set. */
-               child->thread.per_user.end = data;
-}
-
-/*
- * Same as poke_user but for a 31 bit program.
- */
-static int __poke_user_compat(struct task_struct *child,
-                             addr_t addr, addr_t data)
-{
-       __u32 tmp = (__u32) data;
-       addr_t offset;
-
-       if (addr < offsetof(struct compat_user, regs.acrs)) {
-               struct pt_regs *regs = task_pt_regs(child);
-               /*
-                * psw, gprs, acrs and orig_gpr2 are stored on the stack
-                */
-               if (addr == offsetof(struct compat_user, regs.psw.mask)) {
-                       __u32 mask = PSW32_MASK_USER;
-
-                       mask |= is_ri_task(child) ? PSW32_MASK_RI : 0;
-                       /* Build a 64 bit psw mask from 31 bit mask. */
-                       if ((tmp ^ PSW32_USER_BITS) & ~mask)
-                               /* Invalid psw mask. */
-                               return -EINVAL;
-                       if ((data & PSW32_MASK_ASC) == PSW32_ASC_HOME)
-                               /* Invalid address-space-control bits */
-                               return -EINVAL;
-                       regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
-                               (regs->psw.mask & PSW_MASK_BA) |
-                               (__u64)(tmp & mask) << 32;
-               } else if (addr == offsetof(struct compat_user, regs.psw.addr)) {
-                       /* Build a 64 bit psw address from 31 bit address. */
-                       regs->psw.addr = (__u64) tmp & PSW32_ADDR_INSN;
-                       /* Transfer 31 bit amode bit to psw mask. */
-                       regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
-                               (__u64)(tmp & PSW32_ADDR_AMODE);
-               } else {
-                       if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
-                               addr == offsetof(struct compat_user, regs.gprs[2])) {
-                               struct pt_regs *regs = task_pt_regs(child);
-
-                               regs->int_code = 0x20000 | (data & 0xffff);
-                       }
-                       /* gpr 0-15 */
-                       *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
-               }
-       } else if (addr < offsetof(struct compat_user, regs.orig_gpr2)) {
-               /*
-                * access registers are stored in the thread structure
-                */
-               offset = addr - offsetof(struct compat_user, regs.acrs);
-               *(__u32*)((addr_t) &child->thread.acrs + offset) = tmp;
-
-       } else if (addr == offsetof(struct compat_user, regs.orig_gpr2)) {
-               /*
-                * orig_gpr2 is stored on the kernel stack
-                */
-               *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp;
-
-       } else if (addr < offsetof(struct compat_user, regs.fp_regs)) {
-               /*
-                * prevent writess of padding hole between
-                * orig_gpr2 and fp_regs on s390.
-                */
-               return 0;
-
-       } else if (addr == offsetof(struct compat_user, regs.fp_regs.fpc)) {
-               /*
-                * floating point control reg. is in the thread structure
-                */
-               child->thread.ufpu.fpc = data;
-
-       } else if (addr < offsetof(struct compat_user, regs.fp_regs) + sizeof(s390_fp_regs)) {
-               /*
-                * floating point regs. are in the child->thread.ufpu.vxrs array
-                */
-               offset = addr - offsetof(struct compat_user, regs.fp_regs.fprs);
-               *(__u32 *)((addr_t)child->thread.ufpu.vxrs + 2 * offset) = tmp;
-       } else if (addr < offsetof(struct compat_user, regs.per_info) + sizeof(struct compat_per_struct_kernel)) {
-               /*
-                * Handle access to the per_info structure.
-                */
-               addr -= offsetof(struct compat_user, regs.per_info);
-               __poke_user_per_compat(child, addr, data);
-       }
-
-       return 0;
-}
-
-static int poke_user_compat(struct task_struct *child,
-                           addr_t addr, addr_t data)
-{
-       if (!is_compat_task() || (addr & 3) ||
-           addr > sizeof(struct compat_user) - 3)
-               return -EIO;
-
-       return __poke_user_compat(child, addr, data);
-}
-
-long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
-                       compat_ulong_t caddr, compat_ulong_t cdata)
-{
-       unsigned long addr = caddr;
-       unsigned long data = cdata;
-       compat_ptrace_area parea;
-       int copied, ret;
-
-       switch (request) {
-       case PTRACE_PEEKUSR:
-               /* read the word at location addr in the USER area. */
-               return peek_user_compat(child, addr, data);
-
-       case PTRACE_POKEUSR:
-               /* write the word at location addr in the USER area */
-               return poke_user_compat(child, addr, data);
-
-       case PTRACE_PEEKUSR_AREA:
-       case PTRACE_POKEUSR_AREA:
-               if (copy_from_user(&parea, (void __force __user *) addr,
-                                                       sizeof(parea)))
-                       return -EFAULT;
-               addr = parea.kernel_addr;
-               data = parea.process_addr;
-               copied = 0;
-               while (copied < parea.len) {
-                       if (request == PTRACE_PEEKUSR_AREA)
-                               ret = peek_user_compat(child, addr, data);
-                       else {
-                               __u32 utmp;
-                               if (get_user(utmp,
-                                            (__u32 __force __user *) data))
-                                       return -EFAULT;
-                               ret = poke_user_compat(child, addr, utmp);
-                       }
-                       if (ret)
-                               return ret;
-                       addr += sizeof(unsigned int);
-                       data += sizeof(unsigned int);
-                       copied += sizeof(unsigned int);
-               }
-               return 0;
-       case PTRACE_GET_LAST_BREAK:
-               return put_user(child->thread.last_break, (unsigned int __user *)data);
-       }
-       return compat_ptrace_request(child, request, addr, data);
-}
-#endif
-
 /*
  * user_regset definitions.
  */
@@ -1297,225 +990,8 @@ static const struct user_regset_view user_s390_view = {
        .n = ARRAY_SIZE(s390_regsets)
 };
 
-#ifdef CONFIG_COMPAT
-static int s390_compat_regs_get(struct task_struct *target,
-                               const struct user_regset *regset,
-                               struct membuf to)
-{
-       unsigned n;
-
-       if (target == current)
-               save_access_regs(target->thread.acrs);
-
-       for (n = 0; n < sizeof(s390_compat_regs); n += sizeof(compat_ulong_t))
-               membuf_store(&to, __peek_user_compat(target, n));
-       return 0;
-}
-
-static int s390_compat_regs_set(struct task_struct *target,
-                               const struct user_regset *regset,
-                               unsigned int pos, unsigned int count,
-                               const void *kbuf, const void __user *ubuf)
-{
-       int rc = 0;
-
-       if (target == current)
-               save_access_regs(target->thread.acrs);
-
-       if (kbuf) {
-               const compat_ulong_t *k = kbuf;
-               while (count > 0 && !rc) {
-                       rc = __poke_user_compat(target, pos, *k++);
-                       count -= sizeof(*k);
-                       pos += sizeof(*k);
-               }
-       } else {
-               const compat_ulong_t  __user *u = ubuf;
-               while (count > 0 && !rc) {
-                       compat_ulong_t word;
-                       rc = __get_user(word, u++);
-                       if (rc)
-                               break;
-                       rc = __poke_user_compat(target, pos, word);
-                       count -= sizeof(*u);
-                       pos += sizeof(*u);
-               }
-       }
-
-       if (rc == 0 && target == current)
-               restore_access_regs(target->thread.acrs);
-
-       return rc;
-}
-
-static int s390_compat_regs_high_get(struct task_struct *target,
-                                    const struct user_regset *regset,
-                                    struct membuf to)
-{
-       compat_ulong_t *gprs_high;
-       int i;
-
-       gprs_high = (compat_ulong_t *)task_pt_regs(target)->gprs;
-       for (i = 0; i < NUM_GPRS; i++, gprs_high += 2)
-               membuf_store(&to, *gprs_high);
-       return 0;
-}
-
-static int s390_compat_regs_high_set(struct task_struct *target,
-                                    const struct user_regset *regset,
-                                    unsigned int pos, unsigned int count,
-                                    const void *kbuf, const void __user *ubuf)
-{
-       compat_ulong_t *gprs_high;
-       int rc = 0;
-
-       gprs_high = (compat_ulong_t *)
-               &task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)];
-       if (kbuf) {
-               const compat_ulong_t *k = kbuf;
-               while (count > 0) {
-                       *gprs_high = *k++;
-                       *gprs_high += 2;
-                       count -= sizeof(*k);
-               }
-       } else {
-               const compat_ulong_t  __user *u = ubuf;
-               while (count > 0 && !rc) {
-                       unsigned long word;
-                       rc = __get_user(word, u++);
-                       if (rc)
-                               break;
-                       *gprs_high = word;
-                       *gprs_high += 2;
-                       count -= sizeof(*u);
-               }
-       }
-
-       return rc;
-}
-
-static int s390_compat_last_break_get(struct task_struct *target,
-                                     const struct user_regset *regset,
-                                     struct membuf to)
-{
-       compat_ulong_t last_break = target->thread.last_break;
-
-       return membuf_store(&to, (unsigned long)last_break);
-}
-
-static int s390_compat_last_break_set(struct task_struct *target,
-                                     const struct user_regset *regset,
-                                     unsigned int pos, unsigned int count,
-                                     const void *kbuf, const void __user *ubuf)
-{
-       return 0;
-}
-
-static const struct user_regset s390_compat_regsets[] = {
-       {
-               USER_REGSET_NOTE_TYPE(PRSTATUS),
-               .n = sizeof(s390_compat_regs) / sizeof(compat_long_t),
-               .size = sizeof(compat_long_t),
-               .align = sizeof(compat_long_t),
-               .regset_get = s390_compat_regs_get,
-               .set = s390_compat_regs_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(PRFPREG),
-               .n = sizeof(s390_fp_regs) / sizeof(compat_long_t),
-               .size = sizeof(compat_long_t),
-               .align = sizeof(compat_long_t),
-               .regset_get = s390_fpregs_get,
-               .set = s390_fpregs_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_SYSTEM_CALL),
-               .n = 1,
-               .size = sizeof(compat_uint_t),
-               .align = sizeof(compat_uint_t),
-               .regset_get = s390_system_call_get,
-               .set = s390_system_call_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_LAST_BREAK),
-               .n = 1,
-               .size = sizeof(long),
-               .align = sizeof(long),
-               .regset_get = s390_compat_last_break_get,
-               .set = s390_compat_last_break_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_TDB),
-               .n = 1,
-               .size = 256,
-               .align = 1,
-               .regset_get = s390_tdb_get,
-               .set = s390_tdb_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_VXRS_LOW),
-               .n = __NUM_VXRS_LOW,
-               .size = sizeof(__u64),
-               .align = sizeof(__u64),
-               .regset_get = s390_vxrs_low_get,
-               .set = s390_vxrs_low_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_VXRS_HIGH),
-               .n = __NUM_VXRS_HIGH,
-               .size = sizeof(__vector128),
-               .align = sizeof(__vector128),
-               .regset_get = s390_vxrs_high_get,
-               .set = s390_vxrs_high_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_HIGH_GPRS),
-               .n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t),
-               .size = sizeof(compat_long_t),
-               .align = sizeof(compat_long_t),
-               .regset_get = s390_compat_regs_high_get,
-               .set = s390_compat_regs_high_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_GS_CB),
-               .n = sizeof(struct gs_cb) / sizeof(__u64),
-               .size = sizeof(__u64),
-               .align = sizeof(__u64),
-               .regset_get = s390_gs_cb_get,
-               .set = s390_gs_cb_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_GS_BC),
-               .n = sizeof(struct gs_cb) / sizeof(__u64),
-               .size = sizeof(__u64),
-               .align = sizeof(__u64),
-               .regset_get = s390_gs_bc_get,
-               .set = s390_gs_bc_set,
-       },
-       {
-               USER_REGSET_NOTE_TYPE(S390_RI_CB),
-               .n = sizeof(struct runtime_instr_cb) / sizeof(__u64),
-               .size = sizeof(__u64),
-               .align = sizeof(__u64),
-               .regset_get = s390_runtime_instr_get,
-               .set = s390_runtime_instr_set,
-       },
-};
-
-static const struct user_regset_view user_s390_compat_view = {
-       .name = "s390",
-       .e_machine = EM_S390,
-       .regsets = s390_compat_regsets,
-       .n = ARRAY_SIZE(s390_compat_regsets)
-};
-#endif
-
 const struct user_regset_view *task_user_regset_view(struct task_struct *task)
 {
-#ifdef CONFIG_COMPAT
-       if (test_tsk_thread_flag(task, TIF_31BIT))
-               return &user_s390_compat_view;
-#endif
        return &user_s390_view;
 }
 
index 892fce2b75497589c98c816fb4e2a366eb0d8cdb..3c50246dc8c5d8340b52b154640750ec0b3b91ee 100644 (file)
@@ -47,7 +47,6 @@
 #include <linux/kexec.h>
 #include <linux/crash_dump.h>
 #include <linux/memory.h>
-#include <linux/compat.h>
 #include <linux/start_kernel.h>
 #include <linux/hugetlb.h>
 #include <linux/kmemleak.h>
index e48013cd832c169b5982475d32445bf397f384f5..e7775d121fa144834f18a4a4d064ba0100894b58 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/personality.h>
 #include <linux/binfmts.h>
 #include <linux/syscalls.h>
-#include <linux/compat.h>
 #include <asm/ucontext.h>
 #include <linux/uaccess.h>
 #include <asm/vdso-symbols.h>
@@ -290,12 +289,6 @@ static int setup_frame(int sig, struct k_sigaction *ka,
        unsigned long restorer;
        size_t frame_size;
 
-       /*
-        * gprs_high are only present for a 31-bit task running on
-        * a 64-bit kernel (see compat_signal.c) but the space for
-        * gprs_high need to be allocated if vector registers are
-        * included in the signal frame on a 31-bit system.
-        */
        frame_size = sizeof(*frame) - sizeof(frame->sregs_ext);
        if (cpu_has_vx())
                frame_size += sizeof(frame->sregs_ext);
@@ -367,12 +360,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
        size_t frame_size;
 
        frame_size = sizeof(struct rt_sigframe) - sizeof(_sigregs_ext);
-       /*
-        * gprs_high are only present for a 31-bit task running on
-        * a 64-bit kernel (see compat_signal.c) but the space for
-        * gprs_high need to be allocated if vector registers are
-        * included in the signal frame on a 31-bit system.
-        */
        uc_flags = 0;
        if (cpu_has_vx()) {
                frame_size += sizeof(_sigregs_ext);
@@ -490,10 +477,7 @@ void arch_do_signal_or_restart(struct pt_regs *regs)
                clear_pt_regs_flag(regs, PIF_SYSCALL);
 
                rseq_signal_deliver(&ksig, regs);
-               if (is_compat_task())
-                       handle_signal32(&ksig, oldset, regs);
-               else
-                       handle_signal(&ksig, oldset, regs);
+               handle_signal(&ksig, oldset, regs);
                return;
        }
 
@@ -506,10 +490,7 @@ void arch_do_signal_or_restart(struct pt_regs *regs)
                        /* Restart with sys_restart_syscall */
                        regs->gprs[2] = regs->orig_gpr2;
                        current->restart_block.arch_data = regs->psw.addr;
-                       if (is_compat_task())
-                               regs->psw.addr = VDSO32_SYMBOL(current, restart_syscall);
-                       else
-                               regs->psw.addr = VDSO64_SYMBOL(current, restart_syscall);
+                       regs->psw.addr = VDSO64_SYMBOL(current, restart_syscall);
                        if (test_thread_flag(TIF_SINGLE_STEP))
                                clear_thread_flag(TIF_PER_TRAP);
                        break;
index b153a395f46d25023a9b37c5c95f4701284d3cd6..3aae7f70e6ab1293991685230717fd6eccdc521c 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/perf_event.h>
 #include <linux/stacktrace.h>
 #include <linux/uaccess.h>
-#include <linux/compat.h>
 #include <asm/asm-offsets.h>
 #include <asm/stacktrace.h>
 #include <asm/unwind.h>
@@ -107,8 +106,6 @@ void arch_stack_walk_user_common(stack_trace_consume_fn consume_entry, void *coo
        unsigned long ip, sp;
        bool first = true;
 
-       if (is_compat_task())
-               return;
        if (!current->mm)
                return;
        ip = instruction_pointer(regs);
index a91b4fd01bf44720377d597117bcac2d56a0917a..c624f3361e4388777b61461b9a500f1fa234c182 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <linux/uaccess.h>
 #include <linux/uprobes.h>
-#include <linux/compat.h>
 #include <linux/kdebug.h>
 #include <linux/sched/task_stack.h>
 
@@ -29,7 +28,7 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
        if (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_24BIT)
                return -EINVAL;
-       if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)
+       if (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)
                return -EINVAL;
        clear_thread_flag(TIF_PER_TRAP);
        auprobe->saved_per = psw_bits(regs->psw).per;
@@ -368,8 +367,7 @@ static void handle_insn_ril(struct arch_uprobe *auprobe, struct pt_regs *regs)
 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
        if ((psw_bits(regs->psw).eaba == PSW_BITS_AMODE_24BIT) ||
-           ((psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) &&
-            !is_compat_task())) {
+           (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)) {
                regs->psw.addr = __rewind_psw(regs->psw, UPROBE_SWBP_INSN_SIZE);
                do_report_trap(regs, SIGILL, ILL_ILLADR, NULL);
                return true;
index 430feb1a501366e5868b0c4d775770177fa5c6a5..83cc67cf21c833ea57baa51312eed2740bc8cab3 100644 (file)
@@ -7,7 +7,6 @@
  */
 
 #include <linux/binfmts.h>
-#include <linux/compat.h>
 #include <linux/elf.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -24,7 +23,6 @@
 #include <asm/vdso.h>
 
 extern char vdso64_start[], vdso64_end[];
-extern char vdso32_start[], vdso32_end[];
 
 static int vdso_mremap(const struct vm_special_mapping *sm,
                       struct vm_area_struct *vma)
@@ -38,11 +36,6 @@ static struct vm_special_mapping vdso64_mapping = {
        .mremap = vdso_mremap,
 };
 
-static struct vm_special_mapping vdso32_mapping = {
-       .name = "[vdso]",
-       .mremap = vdso_mremap,
-};
-
 int vdso_getcpu_init(void)
 {
        set_tod_programmable_field(smp_processor_id());
@@ -62,13 +55,8 @@ static int map_vdso(unsigned long addr, unsigned long vdso_mapping_len)
        if (mmap_write_lock_killable(mm))
                return -EINTR;
 
-       if (is_compat_task()) {
-               vdso_text_len = vdso32_end - vdso32_start;
-               vdso_mapping = &vdso32_mapping;
-       } else {
-               vdso_text_len = vdso64_end - vdso64_start;
-               vdso_mapping = &vdso64_mapping;
-       }
+       vdso_text_len = vdso64_end - vdso64_start;
+       vdso_mapping = &vdso64_mapping;
        vvar_start = get_unmapped_area(NULL, addr, vdso_mapping_len, 0, 0);
        rc = vvar_start;
        if (IS_ERR_VALUE(vvar_start))
@@ -122,13 +110,7 @@ static unsigned long vdso_addr(unsigned long start, unsigned long len)
 
 unsigned long vdso_text_size(void)
 {
-       unsigned long size;
-
-       if (is_compat_task())
-               size = vdso32_end - vdso32_start;
-       else
-               size = vdso64_end - vdso64_start;
-       return PAGE_ALIGN(size);
+       return PAGE_ALIGN(vdso64_end - vdso64_start);
 }
 
 unsigned long vdso_size(void)
@@ -180,8 +162,6 @@ static int __init vdso_init(void)
 {
        vdso_apply_alternatives();
        vdso64_mapping.pages = vdso_setup_pages(vdso64_start, vdso64_end);
-       if (IS_ENABLED(CONFIG_COMPAT))
-               vdso32_mapping.pages = vdso_setup_pages(vdso32_start, vdso32_end);
        return 0;
 }
 arch_initcall(vdso_init);
diff --git a/arch/s390/kernel/vdso32/.gitignore b/arch/s390/kernel/vdso32/.gitignore
deleted file mode 100644 (file)
index 5167384..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-vdso32.lds
diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile
deleted file mode 100644 (file)
index 1e4ddd1..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# List of files in the vdso
-
-# Include the generic Makefile to check the built vdso.
-include $(srctree)/lib/vdso/Makefile.include
-obj-vdso32 = vdso_user_wrapper-32.o note-32.o
-
-# Build rules
-
-targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
-obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
-
-KBUILD_AFLAGS += -DBUILD_VDSO
-KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
-
-KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS))
-KBUILD_AFLAGS_32 += -m31 -s
-
-KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
-KBUILD_CFLAGS_32 := $(filter-out -mpacked-stack,$(KBUILD_CFLAGS))
-KBUILD_CFLAGS_32 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_32))
-KBUILD_CFLAGS_32 := $(filter-out -fno-asynchronous-unwind-tables,$(KBUILD_CFLAGS_32))
-KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin -fasynchronous-unwind-tables
-
-LDFLAGS_vdso32.so.dbg += -shared -soname=linux-vdso32.so.1 \
-       --hash-style=both --build-id=sha1 -melf_s390 -T
-
-$(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
-$(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
-
-obj-y += vdso32_wrapper.o
-targets += vdso32.lds
-CPPFLAGS_vdso32.lds += -P -C -U$(ARCH)
-
-# Force dependency (incbin is bad)
-$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
-
-quiet_cmd_vdso_and_check = VDSO    $@
-      cmd_vdso_and_check = $(cmd_ld); $(cmd_vdso_check)
-
-$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) FORCE
-       $(call if_changed,vdso_and_check)
-
-# strip rule for the .so file
-$(obj)/%.so: OBJCOPYFLAGS := -S
-$(obj)/%.so: $(obj)/%.so.dbg FORCE
-       $(call if_changed,objcopy)
-
-$(obj-vdso32): %-32.o: %.S FORCE
-       $(call if_changed_dep,vdso32as)
-
-# actual build commands
-quiet_cmd_vdso32as = VDSO32A $@
-      cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $<
-quiet_cmd_vdso32cc = VDSO32C $@
-      cmd_vdso32cc = $(CC) $(c_flags) -c -o $@ $<
-
-# Generate VDSO offsets using helper script
-gen-vdsosym := $(src)/gen_vdso_offsets.sh
-quiet_cmd_vdsosym = VDSOSYM $@
-       cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
-
-include/generated/vdso32-offsets.h: $(obj)/vdso32.so.dbg FORCE
-       $(call if_changed,vdsosym)
diff --git a/arch/s390/kernel/vdso32/gen_vdso_offsets.sh b/arch/s390/kernel/vdso32/gen_vdso_offsets.sh
deleted file mode 100755 (executable)
index 9c4f951..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# Match symbols in the DSO that look like VDSO_*; produce a header file
-# of constant offsets into the shared object.
-#
-# Doing this inside the Makefile will break the $(filter-out) function,
-# causing Kbuild to rebuild the vdso-offsets header file every time.
-#
-# Inspired by arm64 version.
-#
-
-LC_ALL=C
-sed -n 's/\([0-9a-f]*\) . __kernel_compat_\(.*\)/\#define vdso32_offset_\2\t0x\1/p'
diff --git a/arch/s390/kernel/vdso32/note.S b/arch/s390/kernel/vdso32/note.S
deleted file mode 100644 (file)
index db19d06..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text.
- * Here we can supply some information useful to userland.
- */
-
-#include <linux/uts.h>
-#include <linux/version.h>
-#include <linux/elfnote.h>
-
-ELFNOTE_START(Linux, 0, "a")
-       .long LINUX_VERSION_CODE
-ELFNOTE_END
diff --git a/arch/s390/kernel/vdso32/vdso32.lds.S b/arch/s390/kernel/vdso32/vdso32.lds.S
deleted file mode 100644 (file)
index 9630d58..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * This is the infamous ld script for the 64 bits vdso
- * library
- */
-
-#include <asm/page.h>
-#include <asm/vdso.h>
-#include <vdso/datapage.h>
-
-OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
-OUTPUT_ARCH(s390:31-bit)
-
-SECTIONS
-{
-       VDSO_VVAR_SYMS
-
-       . = SIZEOF_HEADERS;
-
-       .hash           : { *(.hash) }                  :text
-       .gnu.hash       : { *(.gnu.hash) }
-       .dynsym         : { *(.dynsym) }
-       .dynstr         : { *(.dynstr) }
-       .gnu.version    : { *(.gnu.version) }
-       .gnu.version_d  : { *(.gnu.version_d) }
-       .gnu.version_r  : { *(.gnu.version_r) }
-
-       .note           : { *(.note.*) }                :text   :note
-
-       . = ALIGN(16);
-       .text           : {
-               *(.text .stub .text.* .gnu.linkonce.t.*)
-       } :text
-       PROVIDE(__etext = .);
-       PROVIDE(_etext = .);
-       PROVIDE(etext = .);
-
-       /*
-        * Other stuff is appended to the text segment:
-        */
-       .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
-       .rodata1        : { *(.rodata1) }
-
-       .dynamic        : { *(.dynamic) }               :text   :dynamic
-
-       .eh_frame_hdr   : { *(.eh_frame_hdr) }          :text   :eh_frame_hdr
-       .eh_frame       : { KEEP (*(.eh_frame)) }       :text
-       .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
-
-       .rela.dyn ALIGN(8) : { *(.rela.dyn) }
-       .got ALIGN(8)   : { *(.got .toc) }
-       .got.plt ALIGN(8) : { *(.got.plt) }
-
-       _end = .;
-       PROVIDE(end = .);
-
-       /*
-        * Stabs debugging sections are here too.
-        */
-       .stab          0 : { *(.stab) }
-       .stabstr       0 : { *(.stabstr) }
-       .stab.excl     0 : { *(.stab.excl) }
-       .stab.exclstr  0 : { *(.stab.exclstr) }
-       .stab.index    0 : { *(.stab.index) }
-       .stab.indexstr 0 : { *(.stab.indexstr) }
-       .comment       0 : { *(.comment) }
-
-       /*
-        * DWARF debug sections.
-        * Symbols in the DWARF debugging sections are relative to the
-        * beginning of the section so we begin them at 0.
-        */
-       /* DWARF 1 */
-       .debug          0 : { *(.debug) }
-       .line           0 : { *(.line) }
-       /* GNU DWARF 1 extensions */
-       .debug_srcinfo  0 : { *(.debug_srcinfo) }
-       .debug_sfnames  0 : { *(.debug_sfnames) }
-       /* DWARF 1.1 and DWARF 2 */
-       .debug_aranges  0 : { *(.debug_aranges) }
-       .debug_pubnames 0 : { *(.debug_pubnames) }
-       /* DWARF 2 */
-       .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
-       .debug_abbrev   0 : { *(.debug_abbrev) }
-       .debug_line     0 : { *(.debug_line) }
-       .debug_frame    0 : { *(.debug_frame) }
-       .debug_str      0 : { *(.debug_str) }
-       .debug_loc      0 : { *(.debug_loc) }
-       .debug_macinfo  0 : { *(.debug_macinfo) }
-       /* SGI/MIPS DWARF 2 extensions */
-       .debug_weaknames 0 : { *(.debug_weaknames) }
-       .debug_funcnames 0 : { *(.debug_funcnames) }
-       .debug_typenames 0 : { *(.debug_typenames) }
-       .debug_varnames  0 : { *(.debug_varnames) }
-       /* DWARF 3 */
-       .debug_pubtypes 0 : { *(.debug_pubtypes) }
-       .debug_ranges   0 : { *(.debug_ranges) }
-       .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
-
-       /DISCARD/       : {
-               *(.note.GNU-stack)
-               *(.branch_lt)
-               *(.data .data.* .gnu.linkonce.d.* .sdata*)
-               *(.bss .sbss .dynbss .dynsbss)
-       }
-}
-
-/*
- * Very old versions of ld do not recognize this name token; use the constant.
- */
-#define PT_GNU_EH_FRAME        0x6474e550
-
-/*
- * We must supply the ELF program headers explicitly to get just one
- * PT_LOAD segment, and set the flags explicitly to make segments read-only.
- */
-PHDRS
-{
-       text            PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
-       dynamic         PT_DYNAMIC FLAGS(4);            /* PF_R */
-       note            PT_NOTE FLAGS(4);               /* PF_R */
-       eh_frame_hdr    PT_GNU_EH_FRAME;
-}
-
-/*
- * This controls what symbols we export from the DSO.
- */
-VERSION
-{
-       VDSO_VERSION_STRING {
-       global:
-               /*
-                * Has to be there for the kernel to find
-                */
-               __kernel_compat_restart_syscall;
-               __kernel_compat_rt_sigreturn;
-               __kernel_compat_sigreturn;
-       local: *;
-       };
-}
diff --git a/arch/s390/kernel/vdso32/vdso32_wrapper.S b/arch/s390/kernel/vdso32/vdso32_wrapper.S
deleted file mode 100644 (file)
index de2fb93..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <linux/init.h>
-#include <linux/linkage.h>
-#include <asm/page.h>
-
-       __PAGE_ALIGNED_DATA
-
-       .globl vdso32_start, vdso32_end
-       .balign PAGE_SIZE
-vdso32_start:
-       .incbin "arch/s390/kernel/vdso32/vdso32.so"
-       .balign PAGE_SIZE
-vdso32_end:
-
-       .previous
diff --git a/arch/s390/kernel/vdso32/vdso_user_wrapper.S b/arch/s390/kernel/vdso32/vdso_user_wrapper.S
deleted file mode 100644 (file)
index 2e64500..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#include <linux/linkage.h>
-#include <asm/unistd.h>
-#include <asm/dwarf.h>
-
-.macro vdso_syscall func,syscall
-       .globl __kernel_compat_\func
-       .type  __kernel_compat_\func,@function
-       __ALIGN
-__kernel_compat_\func:
-       CFI_STARTPROC
-       svc     \syscall
-       /* Make sure we notice when a syscall returns, which shouldn't happen */
-       .word   0
-       CFI_ENDPROC
-       .size   __kernel_compat_\func,.-__kernel_compat_\func
-.endm
-
-vdso_syscall restart_syscall,__NR_restart_syscall
-vdso_syscall sigreturn,__NR_sigreturn
-vdso_syscall rt_sigreturn,__NR_rt_sigreturn
index a8c9aeee632b0d18a54093979ca5fee104e09466..e2e13778c36a93183f9f37a100f6d4537961382b 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/ptrace.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
-#include <linux/compat.h>
 #include <linux/smp.h>
 #include <linux/kdebug.h>
 #include <linux/init.h>
index 197c1d9497a74cb1bab5c151aba7a1a491b10a63..2a222a7e14f48d7fef8dff00ccbd8688a5cbe459 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/sched/signal.h>
 #include <linux/sched/mm.h>
 #include <linux/random.h>
-#include <linux/compat.h>
 #include <linux/security.h>
 #include <linux/hugetlb.h>
 #include <asm/elf.h>
index 241f7251c8730ff0cd8228905125f752b3338731..02b73d4b6c7e8ea358c485a261474c94b98a8622 100644 (file)
@@ -9,7 +9,6 @@
 #define KMSG_COMPONENT "zpci"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
-#include <linux/compat.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
@@ -651,7 +650,7 @@ static long clp_misc_ioctl(struct file *filp, unsigned int cmd,
        if (cmd != CLP_SYNC)
                return -EINVAL;
 
-       argp = is_compat_task() ? compat_ptr(arg) : (void __user *) arg;
+       argp = (void __user *)arg;
        if (copy_from_user(&req, argp, sizeof(req)))
                return -EFAULT;
        if (req.r != 0)
@@ -669,7 +668,6 @@ static const struct file_operations clp_misc_fops = {
        .open = nonseekable_open,
        .release = clp_misc_release,
        .unlocked_ioctl = clp_misc_ioctl,
-       .compat_ioctl = clp_misc_ioctl,
 };
 
 static struct miscdevice clp_misc_device = {
index 7765e40f7ceac03c22ca6f3605f5bfe12b5f16c3..2f3039cca6f22054f31db016fc96f6003dc87575 100644 (file)
@@ -3350,7 +3350,6 @@ dasd_device_operations = {
        .open           = dasd_open,
        .release        = dasd_release,
        .ioctl          = dasd_ioctl,
-       .compat_ioctl   = dasd_ioctl,
        .getgeo         = dasd_getgeo,
        .set_read_only  = dasd_set_read_only,
 };
index 88fa17aea2ec843f8cec1e61a22867689c7ea226..6873967037881625240bc49eaea8ecba6bdb17e2 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/hdreg.h>       /* HDIO_GETGEO                      */
 #include <linux/bio.h>
 #include <linux/module.h>
-#include <linux/compat.h>
 #include <linux/init.h>
 #include <linux/seq_file.h>
 #include <linux/uaccess.h>
@@ -5389,16 +5388,6 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp)
        rc = -EFAULT;
        if (copy_from_user(&usrparm, argp, sizeof(usrparm)))
                goto out;
-       if (is_compat_task()) {
-               /* Make sure pointers are sane even on 31 bit. */
-               rc = -EINVAL;
-               if ((usrparm.psf_data >> 32) != 0)
-                       goto out;
-               if ((usrparm.rssd_result >> 32) != 0)
-                       goto out;
-               usrparm.psf_data &= 0x7fffffffULL;
-               usrparm.rssd_result &= 0x7fffffffULL;
-       }
        /* at least 2 bytes are accessed and should be allocated */
        if (usrparm.psf_data_len < 2) {
                DBF_DEV_EVENT(DBF_WARNING, device,
index 8308046a9f8fbfb2d56f190b864ef50c242e1454..f883990be6260b551cf7d6ba8abb84449e09a518 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <linux/interrupt.h>
-#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/major.h>
 #include <linux/fs.h>
@@ -616,10 +615,7 @@ int dasd_ioctl(struct block_device *bdev, blk_mode_t mode,
        void __user *argp;
        int rc;
 
-       if (is_compat_task())
-               argp = compat_ptr(arg);
-       else
-               argp = (void __user *)arg;
+       argp = (void __user *)arg;
 
        if ((_IOC_DIR(cmd) != _IOC_NONE) && !arg)
                return -EINVAL;
index 5a505972e5712df9bc3359e4a32ff62162026bcf..4a7c084e68a6b56cf94712ae8f26c702dda67ccb 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/reboot.h>
 #include <linux/slab.h>
 #include <linux/memblock.h>
-#include <linux/compat.h>
 
 #include <asm/machine.h>
 #include <asm/ccwdev.h>
@@ -1947,21 +1946,6 @@ static int tty3270_ioctl(struct tty_struct *tty, unsigned int cmd,
        return kbd_ioctl(tp->kbd, cmd, arg);
 }
 
-#ifdef CONFIG_COMPAT
-static long tty3270_compat_ioctl(struct tty_struct *tty,
-                                unsigned int cmd, unsigned long arg)
-{
-       struct tty3270 *tp;
-
-       tp = tty->driver_data;
-       if (!tp)
-               return -ENODEV;
-       if (tty_io_error(tty))
-               return -EIO;
-       return kbd_ioctl(tp->kbd, cmd, (unsigned long)compat_ptr(arg));
-}
-#endif
-
 static const struct tty_operations tty3270_ops = {
        .install = tty3270_install,
        .cleanup = tty3270_cleanup,
@@ -1976,9 +1960,6 @@ static const struct tty_operations tty3270_ops = {
        .hangup = tty3270_hangup,
        .wait_until_sent = tty3270_wait_until_sent,
        .ioctl = tty3270_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = tty3270_compat_ioctl,
-#endif
        .set_termios = tty3270_set_termios
 };
 
index cfe7efd5b5da97440faa64fbe364f84e4a43e547..73555dbe30d03d321fd19c80334dabeb62acd730 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/compat.h>
 #include <linux/sched/signal.h>
 #include <linux/module.h>
 #include <linux/list.h>
@@ -330,10 +329,7 @@ static long fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        fp = filp->private_data;
        if (!fp)
                return -ENODEV;
-       if (is_compat_task())
-               argp = compat_ptr(arg);
-       else
-               argp = (char __user *)arg;
+       argp = (char __user *)arg;
        rc = 0;
        mutex_lock(&fs3270_mutex);
        switch (cmd) {
@@ -512,7 +508,6 @@ static const struct file_operations fs3270_fops = {
        .read            = fs3270_read,         /* read */
        .write           = fs3270_write,        /* write */
        .unlocked_ioctl  = fs3270_ioctl,        /* ioctl */
-       .compat_ioctl    = fs3270_ioctl,        /* ioctl */
        .open            = fs3270_open,         /* open */
        .release         = fs3270_close,        /* release */
 };
index dd6051602070b4ac58e7346979cbaea6ed858456..e23a97359286b02db56ff32a5df19e3b1e76140c 100644 (file)
@@ -7,7 +7,6 @@
  * Author: Michael Holzheu <holzheu@linux.vnet.ibm.com>
  */
 
-#include <linux/compat.h>
 #include <linux/uaccess.h>
 #include <linux/miscdevice.h>
 #include <linux/gfp.h>
@@ -43,10 +42,7 @@ static int sclp_ctl_cmdw_supported(unsigned int cmdw)
 
 static void __user *u64_to_uptr(u64 value)
 {
-       if (is_compat_task())
-               return compat_ptr(value);
-       else
-               return (void __user *)(unsigned long)value;
+       return (void __user *)(unsigned long)value;
 }
 
 /*
@@ -95,10 +91,7 @@ static long sclp_ctl_ioctl(struct file *filp, unsigned int cmd,
 {
        void __user *argp;
 
-       if (is_compat_task())
-               argp = compat_ptr(arg);
-       else
-               argp = (void __user *) arg;
+       argp = (void __user *)arg;
        switch (cmd) {
        case SCLP_CTL_SCCB:
                return sclp_ctl_ioctl_sccb(argp);
@@ -114,7 +107,6 @@ static const struct file_operations sclp_ctl_fops = {
        .owner = THIS_MODULE,
        .open = nonseekable_open,
        .unlocked_ioctl = sclp_ctl_ioctl,
-       .compat_ioctl = sclp_ctl_ioctl,
 };
 
 /*
index 5bcb22d9e47a0dc24d8801819b1ebd88835ae24b..4f175474335ed69984cebad428cc8c5cd1a7c72f 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/types.h>
 #include <linux/proc_fs.h>
 #include <linux/mtio.h>
-#include <linux/compat.h>
 
 #include <linux/uaccess.h>
 
@@ -37,9 +36,6 @@ static ssize_t tapechar_write(struct file *, const char __user *, size_t, loff_t
 static int tapechar_open(struct inode *,struct file *);
 static int tapechar_release(struct inode *,struct file *);
 static long tapechar_ioctl(struct file *, unsigned int, unsigned long);
-#ifdef CONFIG_COMPAT
-static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long);
-#endif
 
 static const struct file_operations tape_fops =
 {
@@ -47,9 +43,6 @@ static const struct file_operations tape_fops =
        .read = tapechar_read,
        .write = tapechar_write,
        .unlocked_ioctl = tapechar_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl = tapechar_compat_ioctl,
-#endif
        .open = tapechar_open,
        .release = tapechar_release,
 };
@@ -441,25 +434,6 @@ tapechar_ioctl(struct file *filp, unsigned int no, unsigned long data)
        return rc;
 }
 
-#ifdef CONFIG_COMPAT
-static long
-tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data)
-{
-       struct tape_device *device = filp->private_data;
-       long rc;
-
-       if (no == MTIOCPOS32)
-               no = MTIOCPOS;
-       else if (no == MTIOCGET32)
-               no = MTIOCGET;
-
-       mutex_lock(&device->mutex);
-       rc = __tapechar_ioctl(device, no, compat_ptr(data));
-       mutex_unlock(&device->mutex);
-       return rc;
-}
-#endif /* CONFIG_COMPAT */
-
 /*
  * Initialize character device frontend.
  */
index 69899bb86b3ef029a1af89c6cd1423b7eb8a86f5..bde6c9e5916688d0d0a1bc5cf85685b9644152a8 100644 (file)
@@ -14,7 +14,6 @@
 
 #include <linux/fs.h>
 #include <linux/init.h>
-#include <linux/compat.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
@@ -204,10 +203,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        int __user *argp;
 
        session = file->private_data;
-       if (is_compat_task())
-               argp = compat_ptr(arg);
-       else
-               argp = (int __user *)arg;
+       argp = (int __user *)arg;
        if (mutex_lock_interruptible(&session->mutex))
                return -ERESTARTSYS;
        switch (cmd) {
@@ -241,7 +237,6 @@ static const struct file_operations vmcp_fops = {
        .read           = vmcp_read,
        .write          = vmcp_write,
        .unlocked_ioctl = vmcp_ioctl,
-       .compat_ioctl   = vmcp_ioctl,
 };
 
 static struct miscdevice vmcp_dev = {
index 1e58ee3cc87db1d69c5e326cfbb244011e677fc1..ce992b2107cb65d7496dfba414e2abbb39c4bf6c 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/slab.h>
-#include <linux/compat.h>
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/module.h>
@@ -845,10 +844,7 @@ static long chsc_ioctl(struct file *filp, unsigned int cmd,
        void __user *argp;
 
        CHSC_MSG(2, "chsc_ioctl called, cmd=%x\n", cmd);
-       if (is_compat_task())
-               argp = compat_ptr(arg);
-       else
-               argp = (void __user *)arg;
+       argp = (void __user *)arg;
        switch (cmd) {
        case CHSC_START:
                return chsc_ioctl_start(argp);
@@ -923,7 +919,6 @@ static const struct file_operations chsc_fops = {
        .open = chsc_open,
        .release = chsc_release,
        .unlocked_ioctl = chsc_ioctl,
-       .compat_ioctl = chsc_ioctl,
 };
 
 static struct miscdevice chsc_misc_device = {
index 2b67b6b02ad523137fa57f431c5d702e2128977e..351934f818dedce094d89cd4e4b756cf63aecff9 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/interrupt.h>
 #include <linux/miscdevice.h>
 #include <linux/fs.h>
-#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/atomic.h>
 #include <linux/uaccess.h>
@@ -1734,197 +1733,6 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd,
        }
 }
 
-#ifdef CONFIG_COMPAT
-/*
- * ioctl32 conversion routines
- */
-struct compat_ica_rsa_modexpo {
-       compat_uptr_t   inputdata;
-       unsigned int    inputdatalength;
-       compat_uptr_t   outputdata;
-       unsigned int    outputdatalength;
-       compat_uptr_t   b_key;
-       compat_uptr_t   n_modulus;
-};
-
-static long trans_modexpo32(struct ap_perms *perms, struct file *filp,
-                           unsigned int cmd, unsigned long arg)
-{
-       struct compat_ica_rsa_modexpo __user *umex32 = compat_ptr(arg);
-       struct compat_ica_rsa_modexpo mex32;
-       struct ica_rsa_modexpo mex64;
-       struct zcrypt_track tr;
-       long rc;
-
-       memset(&tr, 0, sizeof(tr));
-       if (copy_from_user(&mex32, umex32, sizeof(mex32)))
-               return -EFAULT;
-       mex64.inputdata = compat_ptr(mex32.inputdata);
-       mex64.inputdatalength = mex32.inputdatalength;
-       mex64.outputdata = compat_ptr(mex32.outputdata);
-       mex64.outputdatalength = mex32.outputdatalength;
-       mex64.b_key = compat_ptr(mex32.b_key);
-       mex64.n_modulus = compat_ptr(mex32.n_modulus);
-       do {
-               rc = zcrypt_rsa_modexpo(perms, &tr, &mex64);
-       } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX);
-
-       /* on ENODEV failure: retry once again after a requested rescan */
-       if (rc == -ENODEV && zcrypt_process_rescan())
-               do {
-                       rc = zcrypt_rsa_modexpo(perms, &tr, &mex64);
-               } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX);
-       if (rc == -EAGAIN && tr.again_counter >= TRACK_AGAIN_MAX)
-               rc = -EIO;
-       if (rc)
-               return rc;
-       return put_user(mex64.outputdatalength,
-                       &umex32->outputdatalength);
-}
-
-struct compat_ica_rsa_modexpo_crt {
-       compat_uptr_t   inputdata;
-       unsigned int    inputdatalength;
-       compat_uptr_t   outputdata;
-       unsigned int    outputdatalength;
-       compat_uptr_t   bp_key;
-       compat_uptr_t   bq_key;
-       compat_uptr_t   np_prime;
-       compat_uptr_t   nq_prime;
-       compat_uptr_t   u_mult_inv;
-};
-
-static long trans_modexpo_crt32(struct ap_perms *perms, struct file *filp,
-                               unsigned int cmd, unsigned long arg)
-{
-       struct compat_ica_rsa_modexpo_crt __user *ucrt32 = compat_ptr(arg);
-       struct compat_ica_rsa_modexpo_crt crt32;
-       struct ica_rsa_modexpo_crt crt64;
-       struct zcrypt_track tr;
-       long rc;
-
-       memset(&tr, 0, sizeof(tr));
-       if (copy_from_user(&crt32, ucrt32, sizeof(crt32)))
-               return -EFAULT;
-       crt64.inputdata = compat_ptr(crt32.inputdata);
-       crt64.inputdatalength = crt32.inputdatalength;
-       crt64.outputdata = compat_ptr(crt32.outputdata);
-       crt64.outputdatalength = crt32.outputdatalength;
-       crt64.bp_key = compat_ptr(crt32.bp_key);
-       crt64.bq_key = compat_ptr(crt32.bq_key);
-       crt64.np_prime = compat_ptr(crt32.np_prime);
-       crt64.nq_prime = compat_ptr(crt32.nq_prime);
-       crt64.u_mult_inv = compat_ptr(crt32.u_mult_inv);
-       do {
-               rc = zcrypt_rsa_crt(perms, &tr, &crt64);
-       } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX);
-
-       /* on ENODEV failure: retry once again after a requested rescan */
-       if (rc == -ENODEV && zcrypt_process_rescan())
-               do {
-                       rc = zcrypt_rsa_crt(perms, &tr, &crt64);
-               } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX);
-       if (rc == -EAGAIN && tr.again_counter >= TRACK_AGAIN_MAX)
-               rc = -EIO;
-       if (rc)
-               return rc;
-       return put_user(crt64.outputdatalength,
-                       &ucrt32->outputdatalength);
-}
-
-struct compat_ica_xcrb {
-       unsigned short  agent_ID;
-       unsigned int    user_defined;
-       unsigned short  request_ID;
-       unsigned int    request_control_blk_length;
-       unsigned char   padding1[16 - sizeof(compat_uptr_t)];
-       compat_uptr_t   request_control_blk_addr;
-       unsigned int    request_data_length;
-       char            padding2[16 - sizeof(compat_uptr_t)];
-       compat_uptr_t   request_data_address;
-       unsigned int    reply_control_blk_length;
-       char            padding3[16 - sizeof(compat_uptr_t)];
-       compat_uptr_t   reply_control_blk_addr;
-       unsigned int    reply_data_length;
-       char            padding4[16 - sizeof(compat_uptr_t)];
-       compat_uptr_t   reply_data_addr;
-       unsigned short  priority_window;
-       unsigned int    status;
-} __packed;
-
-static long trans_xcrb32(struct ap_perms *perms, struct file *filp,
-                        unsigned int cmd, unsigned long arg)
-{
-       struct compat_ica_xcrb __user *uxcrb32 = compat_ptr(arg);
-       u32 xflags = ZCRYPT_XFLAG_USERSPACE;
-       struct compat_ica_xcrb xcrb32;
-       struct zcrypt_track tr;
-       struct ica_xcRB xcrb64;
-       long rc;
-
-       memset(&tr, 0, sizeof(tr));
-       if (copy_from_user(&xcrb32, uxcrb32, sizeof(xcrb32)))
-               return -EFAULT;
-       xcrb64.agent_ID = xcrb32.agent_ID;
-       xcrb64.user_defined = xcrb32.user_defined;
-       xcrb64.request_ID = xcrb32.request_ID;
-       xcrb64.request_control_blk_length =
-               xcrb32.request_control_blk_length;
-       xcrb64.request_control_blk_addr =
-               compat_ptr(xcrb32.request_control_blk_addr);
-       xcrb64.request_data_length =
-               xcrb32.request_data_length;
-       xcrb64.request_data_address =
-               compat_ptr(xcrb32.request_data_address);
-       xcrb64.reply_control_blk_length =
-               xcrb32.reply_control_blk_length;
-       xcrb64.reply_control_blk_addr =
-               compat_ptr(xcrb32.reply_control_blk_addr);
-       xcrb64.reply_data_length = xcrb32.reply_data_length;
-       xcrb64.reply_data_addr =
-               compat_ptr(xcrb32.reply_data_addr);
-       xcrb64.priority_window = xcrb32.priority_window;
-       xcrb64.status = xcrb32.status;
-       do {
-               rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb64);
-       } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX);
-
-       /* on ENODEV failure: retry once again after a requested rescan */
-       if (rc == -ENODEV && zcrypt_process_rescan())
-               do {
-                       rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb64);
-               } while (rc == -EAGAIN && ++tr.again_counter < TRACK_AGAIN_MAX);
-       if (rc == -EAGAIN && tr.again_counter >= TRACK_AGAIN_MAX)
-               rc = -EIO;
-       xcrb32.reply_control_blk_length = xcrb64.reply_control_blk_length;
-       xcrb32.reply_data_length = xcrb64.reply_data_length;
-       xcrb32.status = xcrb64.status;
-       if (copy_to_user(uxcrb32, &xcrb32, sizeof(xcrb32)))
-               return -EFAULT;
-       return rc;
-}
-
-static long zcrypt_compat_ioctl(struct file *filp, unsigned int cmd,
-                               unsigned long arg)
-{
-       int rc;
-       struct ap_perms *perms =
-               (struct ap_perms *)filp->private_data;
-
-       rc = zcrypt_check_ioctl(perms, cmd);
-       if (rc)
-               return rc;
-
-       if (cmd == ICARSAMODEXPO)
-               return trans_modexpo32(perms, filp, cmd, arg);
-       if (cmd == ICARSACRT)
-               return trans_modexpo_crt32(perms, filp, cmd, arg);
-       if (cmd == ZSECSENDCPRB)
-               return trans_xcrb32(perms, filp, cmd, arg);
-       return zcrypt_unlocked_ioctl(filp, cmd, arg);
-}
-#endif
-
 /*
  * Misc device file operations.
  */
@@ -1933,9 +1741,6 @@ static const struct file_operations zcrypt_fops = {
        .read           = zcrypt_read,
        .write          = zcrypt_write,
        .unlocked_ioctl = zcrypt_unlocked_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = zcrypt_compat_ioctl,
-#endif
        .open           = zcrypt_open,
        .release        = zcrypt_release,
 };
index aa2c8ff2740eff6e06ebb7f99a1cbfcaecd5b5e6..6dea702a5cac993599ddf4f5405796ce70d63bfb 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/atomic.h>
 #include <linux/uaccess.h>
index 76a8678bdad6574a1f718a0569b026a442d4559b..a173d32eb6e829efe13ae6639aaae8c3bd23c9d2 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/atomic.h>
 #include <linux/uaccess.h>
index edc0bcd46923cd6203bcf6f9cd39a82340bdcdd7..6d415e9d5c9f73c75767139b7f592c807942ba87 100644 (file)
@@ -10,7 +10,6 @@
 #define KMSG_COMPONENT "qeth"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
-#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -4805,8 +4804,7 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata)
 
        rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_query_oat_cb, &priv);
        if (!rc) {
-               tmp = is_compat_task() ? compat_ptr(oat_data.ptr) :
-                                        u64_to_user_ptr(oat_data.ptr);
+               tmp = u64_to_user_ptr(oat_data.ptr);
                oat_data.response_len = priv.response_len;
 
                if (copy_to_user(tmp, priv.buffer, priv.response_len) ||