Skip to contentSkip to conversation

s390: Remove compat support

RFC PATCH In review Heiko Carstens 2 participants 14 messages Nov 10, 2025 – Nov 11, 2025

Subsystems (22)
lore
Share & tools
lore

Heiko Carstens

author maintainer
#0 lore raw

cover s390: Remove compat support

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

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

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

Arnd, we talked about this two weeks ago. I would appreciate if you could have a look at this series, especially the last patch of this series.

Patches 1-3 are just some random cleanups / preparations. Patches 4-6 remove compat support.
Patches 7-8 switch s390 to generic system call table generation

Thanks,
Heiko

Heiko Carstens (8):
s390/ptrace: Rename psw_t32 to psw32_t
s390/kvm: Use psw32_t instead of psw_compat_t
s390/syscalls: Add pt_regs parameter to SYSCALL_DEFINE0() syscall wrapper
tools: Remove s390 compat support
s390: Remove compat support
s390/uapi: Remove 31 bit support from uapi header files s390/syscalls: Remove system call table pointer from thread_struct s390/syscalls: Switch to generic system call table generation

 arch/s390/Kconfig                             |  16 -
 arch/s390/Makefile                            |   6 +-
 arch/s390/boot/ipl_data.c                     |   3 +-
 arch/s390/configs/compat.config               |   3 -
 arch/s390/hypfs/hypfs_sprp.c                  |   6 +-
 arch/s390/include/asm/compat.h                | 140 ---
 arch/s390/include/asm/elf.h                   |  47 +-
 arch/s390/include/asm/ftrace.h                |  19 +-
 arch/s390/include/asm/processor.h             |  13 +-
 arch/s390/include/asm/ptrace.h                |   2 +-
 arch/s390/include/asm/seccomp.h               |   5 -
 arch/s390/include/asm/syscall.h               |  19 +-
 arch/s390/include/asm/syscall_wrapper.h       |  95 +-
 arch/s390/include/asm/thread_info.h           |   2 -
 arch/s390/include/asm/unistd.h                |   8 +-
 arch/s390/include/asm/vdso-symbols.h          |   8 -
 arch/s390/include/uapi/asm/bitsperlong.h      |   4 -
 arch/s390/include/uapi/asm/ipcbuf.h           |   3 -
 arch/s390/include/uapi/asm/posix_types.h      |  13 -
 arch/s390/include/uapi/asm/ptrace.h           | 124 ---
 arch/s390/include/uapi/asm/sigcontext.h       |  15 -
 arch/s390/include/uapi/asm/stat.h             |  70 --
 arch/s390/include/uapi/asm/unistd.h           |   4 -
 arch/s390/kernel/Makefile                     |   4 -
 arch/s390/kernel/audit.c                      |  16 -
 arch/s390/kernel/audit.h                      |  16 -
 arch/s390/kernel/compat_audit.c               |  48 -
 arch/s390/kernel/compat_linux.c               | 289 ------
 arch/s390/kernel/compat_linux.h               | 101 ---
 arch/s390/kernel/compat_ptrace.h              |  64 --
 arch/s390/kernel/compat_signal.c              | 420 ---------
 arch/s390/kernel/entry.S                      |  17 -
 arch/s390/kernel/perf_cpum_cf.c               |   1 -
 arch/s390/kernel/perf_event.c                 |   1 -
 arch/s390/kernel/perf_regs.c                  |   3 -
 arch/s390/kernel/process.c                    |   9 +-
 arch/s390/kernel/ptrace.c                     | 524 -----------
 arch/s390/kernel/setup.c                      |   1 -
 arch/s390/kernel/signal.c                     |  23 +-
 arch/s390/kernel/stacktrace.c                 |   3 -
 arch/s390/kernel/syscall.c                    |  12 +-
 arch/s390/kernel/syscalls/Makefile            |  58 +-
 arch/s390/kernel/syscalls/syscall.tbl         | 856 ++++++++----------
 arch/s390/kernel/syscalls/syscalltbl          | 232 -----
 arch/s390/kernel/uprobes.c                    |   6 +-
 arch/s390/kernel/vdso.c                       |  26 +-
 arch/s390/kernel/vdso32/.gitignore            |   2 -
 arch/s390/kernel/vdso32/Makefile              |  64 --
 arch/s390/kernel/vdso32/gen_vdso_offsets.sh   |  15 -
 arch/s390/kernel/vdso32/note.S                |  13 -
 arch/s390/kernel/vdso32/vdso32.lds.S          | 140 ---
 arch/s390/kernel/vdso32/vdso32_wrapper.S      |  15 -
 arch/s390/kernel/vdso32/vdso_user_wrapper.S   |  22 -
 arch/s390/kvm/priv.c                          |   2 +-
 arch/s390/mm/fault.c                          |   1 -
 arch/s390/mm/mmap.c                           |   1 -
 arch/s390/pci/pci_clp.c                       |   4 +-
 drivers/s390/block/dasd.c                     |   1 -
 drivers/s390/block/dasd_eckd.c                |  11 -
 drivers/s390/block/dasd_ioctl.c               |   6 +-
 drivers/s390/char/con3270.c                   |  19 -
 drivers/s390/char/fs3270.c                    |   7 +-
 drivers/s390/char/sclp_ctl.c                  |  12 +-
 drivers/s390/char/tape_char.c                 |  26 -
 drivers/s390/char/vmcp.c                      |   7 +-
 drivers/s390/cio/chsc_sch.c                   |   7 +-
 drivers/s390/crypto/zcrypt_api.c              | 195 ----
 drivers/s390/crypto/zcrypt_card.c             |   1 -
 drivers/s390/crypto/zcrypt_queue.c            |   1 -
 drivers/s390/net/qeth_core_main.c             |   4 +-
 .../arch/s390/include/uapi/asm/bitsperlong.h  |   4 -
 tools/build/feature/test-bpf.c                |   2 +-
 tools/include/asm/barrier.h                   |   2 +-
 tools/include/nolibc/arch-s390.h              |   5 -
 tools/include/nolibc/arch.h                   |   2 +-
 tools/include/uapi/asm/bitsperlong.h          |   2 +-
 tools/include/uapi/asm/bpf_perf_event.h       |   2 +-
 tools/lib/bpf/bpf.c                           |   2 +-
 tools/lib/bpf/bpf_tracing.h                   |   2 +-
 tools/lib/bpf/libbpf.c                        |   4 -
 tools/lib/bpf/usdt.c                          |   2 -
 tools/perf/util/header.c                      |   2 +-
 tools/testing/selftests/bpf/sdt.h             |   2 +-
 tools/testing/selftests/bpf/usdt.h            |   2 +-
 .../selftests/ptrace/set_syscall_info.c       |   2 +-
 tools/testing/selftests/rseq/param_test.c     |   2 +-
 tools/testing/selftests/rseq/rseq-s390.h      |  39 -
 tools/testing/selftests/rseq/rseq.h           |   2 +-
 .../selftests/rseq/syscall_errors_test.c      |   2 +-
 tools/testing/selftests/seccomp/seccomp_bpf.c |   4 +-
 tools/testing/selftests/vDSO/vdso_config.h    |   4 -
 91 files changed, 476 insertions(+), 3545 deletions(-)
 delete mode 100644 arch/s390/configs/compat.config
 delete mode 100644 arch/s390/include/asm/compat.h
 delete mode 100644 arch/s390/kernel/audit.h
 delete mode 100644 arch/s390/kernel/compat_audit.c
 delete mode 100644 arch/s390/kernel/compat_linux.c
 delete mode 100644 arch/s390/kernel/compat_linux.h
 delete mode 100644 arch/s390/kernel/compat_ptrace.h
 delete mode 100644 arch/s390/kernel/compat_signal.c
 delete mode 100755 arch/s390/kernel/syscalls/syscalltbl
 delete mode 100644 arch/s390/kernel/vdso32/.gitignore
 delete mode 100644 arch/s390/kernel/vdso32/Makefile
 delete mode 100755 arch/s390/kernel/vdso32/gen_vdso_offsets.sh
 delete mode 100644 arch/s390/kernel/vdso32/note.S
 delete mode 100644 arch/s390/kernel/vdso32/vdso32.lds.S
 delete mode 100644 arch/s390/kernel/vdso32/vdso32_wrapper.S
 delete mode 100644 arch/s390/kernel/vdso32/vdso_user_wrapper.S
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

RFC PATCH 1/8 s390/ptrace: Rename psw_t32 to psw32_t

Use a standard "_t" suffix for psw_t32 and rename it to psw32_t.

---
 arch/s390/boot/ipl_data.c       | 2 +-
 arch/s390/include/asm/ptrace.h  | 2 +-
 arch/s390/kernel/compat_linux.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/s390/boot/ipl_data.c +1 -1
index c4130a80b058..7957cc6554e7 100644
@@ -12,7 +12,7 @@
 #define PSW_MASK_DISABLED (PSW_MASK_WAIT | PSW_MASK_EA | PSW_MASK_BA)
 
 struct ipl_lowcore {
-	psw_t32		ipl_psw;			/* 0x0000 */
+	psw32_t		ipl_psw;			/* 0x0000 */
 	struct ccw0	ccwpgm[2];			/* 0x0008 */
 	u8		fill[56];			/* 0x0018 */
 	struct ccw0	ccwpgmcc[20];			/* 0x0050 */
arch/s390/include/asm/ptrace.h +1 -1
index dfa770b15fad..f2ecc013a48a 100644
@@ -99,7 +99,7 @@ enum {
 typedef struct {
 	unsigned int mask;
 	unsigned int addr;
-} psw_t32 __aligned(8);
+} psw32_t __aligned(8);
 
 #define PGM_INT_CODE_MASK	0x7f
 #define PGM_INT_CODE_PER	0x80
arch/s390/kernel/compat_linux.h +1 -1
index ef23739b277c..133f22b5deeb 100644
@@ -33,7 +33,7 @@ typedef struct {
 } _s390_fp_regs32;
 
 typedef struct {
-	psw_t32		psw;
+	psw32_t		psw;
 	__u32		gprs[__NUM_GPRS];
 	__u32		acrs[__NUM_ACRS];
 } _s390_regs_common32;
Signature · 1 line
2.48.1
author maintainer
#3 lore raw

RFC PATCH 3/8 s390/syscalls: Add pt_regs parameter to SYSCALL_DEFINE0() syscall wrapper

In reply to Heiko Carstens

All system call wrappers should match the sys_call_ptr_t type. This is not the case for system calls without parameters. Add the missing pt_regs parameter there too.

Note: this is currently not a problem, since the parameter is unused. However it prevents to create a correctly typed system call table in C. With the current assembler implementation this works because of missing type checking.

---
 arch/s390/include/asm/syscall_wrapper.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/s390/include/asm/syscall_wrapper.h +8 -8
index 35c1d1b860d8..bf1ff5e9242d 100644
@@ -38,22 +38,22 @@
  * named __s390x_sys_*()
  */
 #define COMPAT_SYSCALL_DEFINE0(sname)					\
-	long __s390_compat_sys_##sname(void);				\
+	long __s390_compat_sys_##sname(struct pt_regs *__unused);	\
 	ALLOW_ERROR_INJECTION(__s390_compat_sys_##sname, ERRNO);	\
-	long __s390_compat_sys_##sname(void)
+	long __s390_compat_sys_##sname(struct pt_regs *__unused)
 
 #define SYSCALL_DEFINE0(sname)						\
 	SYSCALL_METADATA(_##sname, 0);					\
-	long __s390_sys_##sname(void);					\
+	long __s390_sys_##sname(struct pt_regs *__unused);		\
 	ALLOW_ERROR_INJECTION(__s390_sys_##sname, ERRNO);		\
-	long __s390x_sys_##sname(void);					\
+	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(void)					\
+	long __s390_sys_##sname(struct pt_regs *__unused)		\
 	{								\
 		return __do_sys_##sname();				\
 	}								\
-	long __s390x_sys_##sname(void)					\
+	long __s390x_sys_##sname(struct pt_regs *__unused)		\
 	{								\
 		return __do_sys_##sname();				\
 	}								\
@@ -104,10 +104,10 @@
 
 #define SYSCALL_DEFINE0(sname)						\
 	SYSCALL_METADATA(_##sname, 0);					\
-	long __s390x_sys_##sname(void);					\
+	long __s390x_sys_##sname(struct pt_regs *__unused);		\
 	ALLOW_ERROR_INJECTION(__s390x_sys_##sname, ERRNO);		\
 	static inline long __do_sys_##sname(void);			\
-	long __s390x_sys_##sname(void)					\
+	long __s390x_sys_##sname(struct pt_regs *__unused)		\
 	{								\
 		return __do_sys_##sname();				\
 	}								\
Signature · 1 line
2.48.1
author maintainer
#2 lore raw

RFC PATCH 2/8 s390/kvm: Use psw32_t instead of psw_compat_t

In reply to Heiko Carstens

kvm_s390_handle_lpsw() make use of the psw_compat_t type even though the code has nothing to do with CONFIG_COMPAT, for which the type is supposed to be used. Use psw32_t instead.

---
 arch/s390/kvm/priv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/priv.c +1 -1
index 9a71b6e00948..0b14d894f38a 100644
@@ -754,7 +754,7 @@ int is_valid_psw(psw_t *psw)
 int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
 {
 	psw_t *gpsw = &vcpu->arch.sie_block->gpsw;
-	psw_compat_t new_psw;
+	psw32_t new_psw;
 	u64 addr;
 	int rc;
 	u8 ar;
Signature · 1 line
2.48.1
author maintainer
#4 lore raw

RFC PATCH 4/8 tools: Remove s390 compat support

In reply to Heiko Carstens

Remove s390 compat support from everything within tools, since s390 compat support will be removed from the kernel.

While removing s390 compat code replace __s390__ ifdef guards with __s390x__ everywhere. Even though this is not strictly required this makes it easier to spot s390 compat code support leftovers.

---
 .../arch/s390/include/uapi/asm/bitsperlong.h  |  4 --
 tools/build/feature/test-bpf.c                |  2 +-
 tools/include/asm/barrier.h                   |  2 +-
 tools/include/nolibc/arch-s390.h              |  5 ---
 tools/include/nolibc/arch.h                   |  2 +-
 tools/include/uapi/asm/bitsperlong.h          |  2 +-
 tools/include/uapi/asm/bpf_perf_event.h       |  2 +-
 tools/lib/bpf/bpf.c                           |  2 +-
 tools/lib/bpf/bpf_tracing.h                   |  2 +-
 tools/lib/bpf/libbpf.c                        |  4 --
 tools/lib/bpf/usdt.c                          |  2 -
 tools/perf/util/header.c                      |  2 +-
 tools/testing/selftests/bpf/sdt.h             |  2 +-
 tools/testing/selftests/bpf/usdt.h            |  2 +-
 .../selftests/ptrace/set_syscall_info.c       |  2 +-
 tools/testing/selftests/rseq/param_test.c     |  2 +-
 tools/testing/selftests/rseq/rseq-s390.h      | 39 -------------------
 tools/testing/selftests/rseq/rseq.h           |  2 +-
 .../selftests/rseq/syscall_errors_test.c      |  2 +-
 tools/testing/selftests/seccomp/seccomp_bpf.c |  4 +-
 tools/testing/selftests/vDSO/vdso_config.h    |  4 --
 21 files changed, 16 insertions(+), 74 deletions(-)
tools/arch/s390/include/uapi/asm/bitsperlong.h +0 -4
index d2bb620119bf..a226a1686a53 100644
@@ -2,11 +2,7 @@
 #ifndef __ASM_S390_BITSPERLONG_H
 #define __ASM_S390_BITSPERLONG_H
 
-#ifndef __s390x__
-#define __BITS_PER_LONG 32
-#else
 #define __BITS_PER_LONG 64
-#endif
 
 #include <asm-generic/bitsperlong.h>
 
tools/build/feature/test-bpf.c +1 -1
index e7a405f83af6..dcde234ea9ba 100644
@@ -12,7 +12,7 @@
 #  define __NR_bpf 280
 # elif defined(__sparc__)
 #  define __NR_bpf 349
-# elif defined(__s390__)
+# elif defined(__s390x__)
 #  define __NR_bpf 351
 # elif defined(__mips__) && defined(_ABIO32)
 #  define __NR_bpf 4355
tools/include/asm/barrier.h +1 -1
index 0c21678ac5e6..c8bebfadaf74 100644
@@ -10,7 +10,7 @@
 #include "../../arch/powerpc/include/asm/barrier.h"
 #elif defined(__riscv)
 #include "../../arch/riscv/include/asm/barrier.h"
-#elif defined(__s390__)
+#elif defined(__s390x__)
 #include "../../arch/s390/include/asm/barrier.h"
 #elif defined(__sh__)
 #include "../../arch/sh/include/asm/barrier.h"
tools/include/nolibc/arch-s390.h +0 -5
index df4c3cc713ac..0a39bee261b9 100644
@@ -143,13 +143,8 @@
 void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protector _start(void)
 {
 	__asm__ volatile (
-#ifdef __s390x__
 		"lgr	%r2, %r15\n"          /* save stack pointer to %r2, as arg1 of _start_c */
 		"aghi	%r15, -160\n"         /* allocate new stackframe                        */
-#else
-		"lr	%r2, %r15\n"
-		"ahi	%r15, -96\n"
-#endif
 		"xc	0(8,%r15), 0(%r15)\n" /* clear backchain                                */
 		"brasl	%r14, _start_c\n"     /* transfer to c runtime                          */
 	);
tools/include/nolibc/arch.h +1 -1
index 426c89198135..ef4743aad188 100644
@@ -27,7 +27,7 @@
 #include "arch-powerpc.h"
 #elif defined(__riscv)
 #include "arch-riscv.h"
-#elif defined(__s390x__) || defined(__s390__)
+#elif defined(__s390x__)
 #include "arch-s390.h"
 #elif defined(__loongarch__)
 #include "arch-loongarch.h"
tools/include/uapi/asm/bitsperlong.h +1 -1
index c65267afc341..ca59a4fee942 100644
@@ -3,7 +3,7 @@
 #include "../../../arch/x86/include/uapi/asm/bitsperlong.h"
 #elif defined(__powerpc__)
 #include "../../../arch/powerpc/include/uapi/asm/bitsperlong.h"
-#elif defined(__s390__)
+#elif defined(__s390x__)
 #include "../../../arch/s390/include/uapi/asm/bitsperlong.h"
 #elif defined(__sparc__)
 #include "../../../arch/sparc/include/uapi/asm/bitsperlong.h"
tools/include/uapi/asm/bpf_perf_event.h +1 -1
index ff52668abf8c..7b28fa03c835 100644
@@ -2,7 +2,7 @@
 #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h"
 #elif defined(__arc__)
 #include "../../arch/arc/include/uapi/asm/bpf_perf_event.h"
-#elif defined(__s390__)
+#elif defined(__s390x__)
 #include "../../arch/s390/include/uapi/asm/bpf_perf_event.h"
 #elif defined(__riscv)
 #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h"
tools/lib/bpf/bpf.c +1 -1
index 339b19797237..61927c28e080 100644
@@ -49,7 +49,7 @@
 #  define __NR_bpf 280
 # elif defined(__sparc__)
 #  define __NR_bpf 349
-# elif defined(__s390__)
+# elif defined(__s390x__)
 #  define __NR_bpf 351
 # elif defined(__arc__)
 #  define __NR_bpf 280
tools/lib/bpf/bpf_tracing.h +1 -1
index dbe32a5d02cd..5facada4c5e9 100644
@@ -41,7 +41,7 @@
 #if defined(__x86_64__)
 	#define bpf_target_x86
 	#define bpf_target_defined
-#elif defined(__s390__)
+#elif defined(__s390x__)
 	#define bpf_target_s390
 	#define bpf_target_defined
 #elif defined(__arm__)
tools/lib/bpf/libbpf.c +0 -4
index dd3b2f57082d..85abc357da31 100644
@@ -11325,8 +11325,6 @@ static const char *arch_specific_syscall_pfx(void)
 	return "ia32";
 #elif defined(__s390x__)
 	return "s390x";
-#elif defined(__s390__)
-	return "s390";
 #elif defined(__arm__)
 	return "arm";
 #elif defined(__aarch64__)
@@ -12113,8 +12111,6 @@ static const char *arch_specific_lib_paths(void)
 	return "/lib/i386-linux-gnu";
 #elif defined(__s390x__)
 	return "/lib/s390x-linux-gnu";
-#elif defined(__s390__)
-	return "/lib/s390-linux-gnu";
 #elif defined(__arm__) && defined(__SOFTFP__)
 	return "/lib/arm-linux-gnueabi";
 #elif defined(__arm__) && !defined(__SOFTFP__)
tools/lib/bpf/usdt.c +0 -2
index c174b4086673..d1524f6f54ae 100644
@@ -1376,8 +1376,6 @@ static int parse_usdt_arg(const char *arg_str, int arg_num, struct usdt_arg_spec
 
 #elif defined(__s390x__)
 
-/* Do not support __s390__ for now, since user_pt_regs is broken with -m31. */
-
 static int parse_usdt_arg(const char *arg_str, int arg_num, struct usdt_arg_spec *arg, int *arg_sz)
 {
 	unsigned int reg;
tools/perf/util/header.c +1 -1
index 4f2a6e10ed5c..611f807ff8b8 100644
@@ -445,7 +445,7 @@ static int write_cpudesc(struct feat_fd *ff,
 {
 #if defined(__powerpc__) || defined(__hppa__) || defined(__sparc__)
 #define CPUINFO_PROC	{ "cpu", }
-#elif defined(__s390__)
+#elif defined(__s390x__)
 #define CPUINFO_PROC	{ "vendor_id", }
 #elif defined(__sh__)
 #define CPUINFO_PROC	{ "cpu type", }
tools/testing/selftests/bpf/sdt.h +1 -1
index 1fcfa5160231..2389ab0f9e48 100644
@@ -230,7 +230,7 @@ __extension__ extern unsigned long long __sdt_unsp;
 #endif
 
 /* The ia64 and s390 nop instructions take an argument. */
-#if defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+#if defined(__ia64__) || defined(__s390x__)
 #define _SDT_NOP	nop 0
 #else
 #define _SDT_NOP	nop
tools/testing/selftests/bpf/usdt.h +1 -1
index 549d1f774810..2a4b756c6c43 100644
@@ -310,7 +310,7 @@ struct usdt_sema { volatile unsigned short active; };
 #endif /* USDT_ARG_CONSTRAINT */
 
 #ifndef USDT_NOP
-#if defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+#if defined(__ia64__) || defined(__s390x__)
 #define USDT_NOP			nop 0
 #else
 #define USDT_NOP			nop
tools/testing/selftests/ptrace/set_syscall_info.c +1 -1
index 4198248ef874..2a4549c30540 100644
@@ -72,7 +72,7 @@ check_psi_entry(struct __test_metadata *_metadata,
 {
 	unsigned int i;
 	int exp_nr = exp_entry->nr;
-#if defined __s390__ || defined __s390x__
+#ifdef __s390x__
 	/* s390 is the only architecture that has 16-bit syscall numbers */
 	exp_nr &= 0xffff;
 #endif
tools/testing/selftests/rseq/param_test.c +1 -1
index 05d03e679e06..ce62684bc178 100644
@@ -90,7 +90,7 @@ unsigned int yield_mod_cnt, nr_abort;
 	"jnz 222b\n\t" \
 	"333:\n\t"
 
-#elif defined(__s390__)
+#elif defined(__s390x__)
 
 #define RSEQ_INJECT_INPUT \
 	, [loop_cnt_1]"m"(loop_cnt[1]) \
tools/testing/selftests/rseq/rseq-s390.h +0 -39
index 33baaa9f9997..e7b858cd3736 100644
@@ -28,8 +28,6 @@ do {									\
 	RSEQ_WRITE_ONCE(*(p), v);					\
 } while (0)
 
-#ifdef __s390x__
-
 #define LONG_L			"lg"
 #define LONG_S			"stg"
 #define LONG_LT_R		"ltgr"
@@ -63,43 +61,6 @@ do {									\
 		".quad " __rseq_str(start_ip) ", " __rseq_str(exit_ip) "\n\t" \
 		".popsection\n\t"
 
-#elif __s390__
-
-#define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,			\
-				start_ip, post_commit_offset, abort_ip)	\
-		".pushsection __rseq_cs, \"aw\"\n\t"			\
-		".balign 32\n\t"					\
-		__rseq_str(label) ":\n\t"				\
-		".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
-		".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) "\n\t" \
-		".popsection\n\t"					\
-		".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"		\
-		".long 0x0, " __rseq_str(label) "b\n\t"			\
-		".popsection\n\t"
-
-/*
- * Exit points of a rseq critical section consist of all instructions outside
- * of the critical section where a critical section can either branch to or
- * reach through the normal course of its execution. The abort IP and the
- * post-commit IP are already part of the __rseq_cs section and should not be
- * explicitly defined as additional exit points. Knowing all exit points is
- * useful to assist debuggers stepping over the critical section.
- */
-#define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)			\
-		".pushsection __rseq_exit_point_array, \"aw\"\n\t"	\
-		".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(exit_ip) "\n\t" \
-		".popsection\n\t"
-
-#define LONG_L			"l"
-#define LONG_S			"st"
-#define LONG_LT_R		"ltr"
-#define LONG_CMP		"c"
-#define LONG_CMP_R		"cr"
-#define LONG_ADDI		"ahi"
-#define LONG_ADD_R		"ar"
-
-#endif
-
 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \
 	__RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip,		\
 				(post_commit_ip - start_ip), abort_ip)
tools/testing/selftests/rseq/rseq.h +1 -1
index f51a5fdb0444..342ac4957208 100644
@@ -125,7 +125,7 @@ static inline struct rseq_abi *rseq_get_abi(void)
 #include <rseq-ppc.h>
 #elif defined(__mips__)
 #include <rseq-mips.h>
-#elif defined(__s390__)
+#elif defined(__s390x__)
 #include <rseq-s390.h>
 #elif defined(__riscv)
 #include <rseq-riscv.h>
tools/testing/selftests/rseq/syscall_errors_test.c +1 -1
index a5d9e1f8a2dc..9c00ea750e07 100644
@@ -59,7 +59,7 @@ int main(void)
 		goto error;
 
 
-#if defined(__LP64__) && (!defined(__s390__) && !defined(__s390x__))
+#if defined(__LP64__) && !defined(__s390x__)
 	/*
 	 * We haven't found a reliable way to find an invalid address when
 	 * running a 32bit userspace on a 64bit kernel, so only run this test
tools/testing/selftests/seccomp/seccomp_bpf.c +2 -2
index 874f17763536..07bdf8580818 100644
@@ -150,7 +150,7 @@ struct seccomp_data {
 #  define __NR_seccomp 338
 # elif defined(__powerpc__)
 #  define __NR_seccomp 358
-# elif defined(__s390__)
+# elif defined(__s390x__)
 #  define __NR_seccomp 348
 # elif defined(__xtensa__)
 #  define __NR_seccomp 337
@@ -1822,7 +1822,7 @@ TEST_F(TRACE_poke, getpid_runs_normally)
 		}						\
 	} while (0)
 # define SYSCALL_RET_SET_ON_PTRACE_EXIT
-#elif defined(__s390__)
+#elif defined(__s390x__)
 # define ARCH_REGS		s390_regs
 # define SYSCALL_NUM(_regs)	(_regs).gprs[2]
 # define SYSCALL_RET_SET(_regs, _val)			\
tools/testing/selftests/vDSO/vdso_config.h +0 -4
index 5fdd0f362337..50c261005111 100644
@@ -25,10 +25,6 @@
 #define VDSO_VERSION		1
 #define VDSO_NAMES		0
 #define VDSO_32BIT		1
-#elif defined (__s390__) && !defined(__s390x__)
-#define VDSO_VERSION		2
-#define VDSO_NAMES		0
-#define VDSO_32BIT		1
 #elif defined (__s390x__)
 #define VDSO_VERSION		2
 #define VDSO_NAMES		0
Signature · 1 line
2.48.1
author maintainer
#8 lore raw

RFC PATCH 6/8 s390/uapi: Remove 31 bit support from uapi header files

In reply to Heiko Carstens

Since the kernel does not support running 31 bit / compat binaries anymore, remove also the corresponding 31 bit support from uapi header files.

---
 arch/s390/include/uapi/asm/bitsperlong.h |   4 -
 arch/s390/include/uapi/asm/ipcbuf.h      |   3 -
 arch/s390/include/uapi/asm/posix_types.h |  13 ---
 arch/s390/include/uapi/asm/ptrace.h      | 124 -----------------------
 arch/s390/include/uapi/asm/sigcontext.h  |  15 ---
 arch/s390/include/uapi/asm/stat.h        |  70 -------------
 arch/s390/include/uapi/asm/unistd.h      |   4 -
 7 files changed, 233 deletions(-)
arch/s390/include/uapi/asm/bitsperlong.h +0 -4
index cceaf47b021a..7af27a985f25 100644
@@ -2,11 +2,7 @@
 #ifndef __ASM_S390_BITSPERLONG_H
 #define __ASM_S390_BITSPERLONG_H
 
-#ifndef __s390x__
-#define __BITS_PER_LONG 32
-#else
 #define __BITS_PER_LONG 64
-#endif
 
 #include <asm-generic/bitsperlong.h>
 
arch/s390/include/uapi/asm/ipcbuf.h +0 -3
index 1030cd186899..9277e76d6d72 100644
@@ -24,9 +24,6 @@ struct ipc64_perm
 	__kernel_mode_t		mode;
 	unsigned short		__pad1;
 	unsigned short		seq;
-#ifndef __s390x__
-	unsigned short		__pad2;
-#endif /* ! __s390x__ */
 	unsigned long		__unused1;
 	unsigned long		__unused2;
 };
arch/s390/include/uapi/asm/posix_types.h +0 -13
index 1913613e71b6..ad5ab940d192 100644
@@ -26,17 +26,6 @@ typedef unsigned short __kernel_old_gid_t;
 #define __kernel_old_uid_t __kernel_old_uid_t
 #endif
 
-#ifndef __s390x__
-
-typedef unsigned long   __kernel_ino_t;
-typedef unsigned short  __kernel_mode_t;
-typedef unsigned short  __kernel_ipc_pid_t;
-typedef unsigned short  __kernel_uid_t;
-typedef unsigned short  __kernel_gid_t;
-typedef int             __kernel_ptrdiff_t;
-
-#else /* __s390x__ */
-
 typedef unsigned int    __kernel_ino_t;
 typedef unsigned int    __kernel_mode_t;
 typedef int             __kernel_ipc_pid_t;
@@ -45,8 +34,6 @@ typedef unsigned int    __kernel_gid_t;
 typedef long            __kernel_ptrdiff_t;
 typedef unsigned long   __kernel_sigset_t;      /* at least 32 bits */
 
-#endif /* __s390x__ */
-
 #define __kernel_ino_t  __kernel_ino_t
 #define __kernel_mode_t __kernel_mode_t
 #define __kernel_ipc_pid_t __kernel_ipc_pid_t
arch/s390/include/uapi/asm/ptrace.h +0 -124

149 lines not on this page · raw message

arch/s390/include/uapi/asm/sigcontext.h +0 -15
index 8b35033334c4..7c90b30c50fd 100644
@@ -17,24 +17,12 @@
 #define __NUM_VXRS_LOW		16
 #define __NUM_VXRS_HIGH		16
 
-#ifndef __s390x__
-
-/* Has to be at least _NSIG_WORDS from asm/signal.h */
-#define _SIGCONTEXT_NSIG	64
-#define _SIGCONTEXT_NSIG_BPW	32
-/* Size of stack frame allocated when calling signal handler. */
-#define __SIGNAL_FRAMESIZE	96
-
-#else /* __s390x__ */
-
 /* Has to be at least _NSIG_WORDS from asm/signal.h */
 #define _SIGCONTEXT_NSIG	64
 #define _SIGCONTEXT_NSIG_BPW	64 
 /* Size of stack frame allocated when calling signal handler. */
 #define __SIGNAL_FRAMESIZE	160
 
-#endif /* __s390x__ */
-
 #define _SIGCONTEXT_NSIG_WORDS	(_SIGCONTEXT_NSIG / _SIGCONTEXT_NSIG_BPW)
 #define _SIGMASK_COPY_SIZE	(sizeof(unsigned long)*_SIGCONTEXT_NSIG_WORDS)
 
@@ -66,9 +54,6 @@ typedef struct
 
 typedef struct
 {
-#ifndef __s390x__
-	unsigned long gprs_high[__NUM_GPRS];
-#endif
 	unsigned long long vxrs_low[__NUM_VXRS_LOW];
 	__vector128 vxrs_high[__NUM_VXRS_HIGH];
 	unsigned char __reserved[128];
arch/s390/include/uapi/asm/stat.h +0 -70

82 lines not on this page · raw message

arch/s390/include/uapi/asm/unistd.h +0 -4
index 01b5fe8b9db6..b0c5afe19db2 100644
@@ -8,10 +8,6 @@
 #ifndef _UAPI_ASM_S390_UNISTD_H_
 #define _UAPI_ASM_S390_UNISTD_H_
 
-#ifdef __s390x__
 #include <asm/unistd_64.h>
-#else
-#include <asm/unistd_32.h>
-#endif
 
 #endif /* _UAPI_ASM_S390_UNISTD_H_ */
Signature · 1 line
2.48.1
author maintainer
#9 lore raw

RFC PATCH 7/8 s390/syscalls: Remove system call table pointer from thread_struct

In reply to Heiko Carstens

With compat support gone there is only one system call table left. Therefore remove the sys_call_table pointer from thread_struct and use the sys_call_table directly.

---
 arch/s390/include/asm/elf.h       | 1 -
 arch/s390/include/asm/processor.h | 1 -
 arch/s390/kernel/syscall.c        | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)
arch/s390/include/asm/elf.h +0 -1
index 2b6ab483b1ca..bb63fa4d20bb 100644
@@ -217,7 +217,6 @@ extern char elf_platform[];
 do {								\
 	set_personality(PER_LINUX |				\
 		(current->personality & (~PER_MASK)));		\
-	current->thread.sys_call_table = sys_call_table;	\
 } while (0)
 
 /*
arch/s390/include/asm/processor.h +0 -1
index e3e3230aaf11..44d558fb8422 100644
@@ -175,7 +175,6 @@ struct thread_struct {
 	unsigned long system_timer;		/* task cputime in kernel space */
 	unsigned long hardirq_timer;		/* task cputime in hardirq context */
 	unsigned long softirq_timer;		/* task cputime in softirq context */
-	const sys_call_ptr_t *sys_call_table;	/* system call table address */
 	union teid gmap_teid;			/* address and flags of last gmap fault */
 	unsigned int gmap_int_code;		/* int code of last gmap fault */
 	int ufpu_flags;				/* user fpu flags */
arch/s390/kernel/syscall.c +1 -1
index 4fee74553ca2..3b7ea1ef468a 100644
@@ -122,7 +122,7 @@ void noinstr __do_syscall(struct pt_regs *regs, int per_trap)
 		goto out;
 	regs->gprs[2] = -ENOSYS;
 	if (likely(nr < NR_syscalls))
-		regs->gprs[2] = current->thread.sys_call_table[nr](regs);
+		regs->gprs[2] = sys_call_table[nr](regs);
 out:
 	syscall_exit_to_user_mode(regs);
 }
Signature · 1 line
2.48.1
author maintainer
#10 lore raw

RFC PATCH 8/8 s390/syscalls: Switch to generic system call table generation

In reply to Heiko Carstens

The s390 syscall.tbl format differs slightly from most others, and therefore requires an s390 specific system call table generation script.

With compat support gone use the opportunity to switch to generic system call table generation. The abi for all 64 bit system calls is now common, since there is no need to specify if system call entry points are only for 64 bit anymore.

Furthermore create the system call table in C instead of assembler code in order to get type checking for all system call functions contained within the table.

---
 arch/s390/Makefile                    |   3 +-
 arch/s390/include/asm/unistd.h        |   3 +-
 arch/s390/kernel/entry.S              |   8 -
 arch/s390/kernel/syscall.c            |  10 +
 arch/s390/kernel/syscalls/Makefile    |  58 +-
 arch/s390/kernel/syscalls/syscall.tbl | 856 ++++++++++++--------------
 arch/s390/kernel/syscalls/syscalltbl  | 232 -------
 7 files changed, 424 insertions(+), 746 deletions(-)
 delete mode 100755 arch/s390/kernel/syscalls/syscalltbl
arch/s390/Makefile +1 -2
index f41b8c5c4e56..bf53e7d1487a 100644
@@ -134,10 +134,9 @@ zfcpdump:
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 archheaders:
-	$(Q)$(MAKE) $(build)=$(syscalls) uapi
+	$(Q)$(MAKE) $(build)=$(syscalls) all
 
 archprepare:
-	$(Q)$(MAKE) $(build)=$(syscalls) kapi
 	$(Q)$(MAKE) $(build)=$(tools) kapi $(extra_tools)
 ifeq ($(KBUILD_EXTMOD),)
 # We need to generate vdso-offsets.h before compiling certain files in kernel/.
arch/s390/include/asm/unistd.h +2 -1
index 252d7ac7a6b2..921c3fb3586b 100644
@@ -8,7 +8,8 @@
 #define _ASM_S390_UNISTD_H_
 
 #include <uapi/asm/unistd.h>
-#include <asm/unistd_nr.h>
+
+#define NR_syscalls (__NR_syscalls)
 
 #define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_OLD_READDIR
arch/s390/kernel/entry.S +0 -8
index 3c7f183a945d..1e266c0eae2c 100644
@@ -606,11 +606,3 @@ SYM_DATA_START_LOCAL(daton_psw)
 	.quad	PSW_KERNEL_BITS
 	.quad	.Ldaton
 SYM_DATA_END(daton_psw)
-
-	.section .rodata, "a"
-	.balign	8
-#define SYSCALL(esame,emu)	.quad __s390x_ ## esame
-SYM_DATA_START(sys_call_table)
-#include <asm/syscall_table.h>
-SYM_DATA_END(sys_call_table)
-#undef SYSCALL
arch/s390/kernel/syscall.c +10 -0
index 3b7ea1ef468a..795b6cca74c9 100644
@@ -39,6 +39,16 @@
 
 #include "entry.h"
 
+#define __SYSCALL(nr, sym) long __s390x_##sym(struct pt_regs *);
+#include <asm/syscall_table.h>
+#undef __SYSCALL
+
+#define __SYSCALL(nr, sym) [nr] = (__s390x_##sym),
+const sys_call_ptr_t sys_call_table[__NR_syscalls] = {
+#include <asm/syscall_table.h>
+};
+#undef __SYSCALL
+
 #ifdef CONFIG_SYSVIPC
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls.
arch/s390/kernel/syscalls/Makefile +21 -37

69 lines not on this page · raw message

arch/s390/kernel/syscalls/syscall.tbl +390 -466

862 lines not on this page · raw message

arch/s390/kernel/syscalls/syscalltbl deleted +0 -232

232 lines not on this page · raw message

Signature · 1 line
2.48.1
author maintainer
#5 lore raw

RFC PATCH 5/8 s390: Remove compat support

In reply to Heiko Carstens

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.

---
 arch/s390/Kconfig                           |  16 -
 arch/s390/Makefile                          |   3 -
 arch/s390/boot/ipl_data.c                   |   1 -
 arch/s390/configs/compat.config             |   3 -
 arch/s390/hypfs/hypfs_sprp.c                |   6 +-
 arch/s390/include/asm/compat.h              | 140 ------
 arch/s390/include/asm/elf.h                 |  46 +-
 arch/s390/include/asm/ftrace.h              |  19 +-
 arch/s390/include/asm/processor.h           |  12 +-
 arch/s390/include/asm/seccomp.h             |   5 -
 arch/s390/include/asm/syscall.h             |  19 +-
 arch/s390/include/asm/syscall_wrapper.h     |  91 ----
 arch/s390/include/asm/thread_info.h         |   2 -
 arch/s390/include/asm/unistd.h              |   5 -
 arch/s390/include/asm/vdso-symbols.h        |   8 -
 arch/s390/kernel/Makefile                   |   4 -
 arch/s390/kernel/audit.c                    |  16 -
 arch/s390/kernel/audit.h                    |  16 -
 arch/s390/kernel/compat_audit.c             |  48 --
 arch/s390/kernel/compat_linux.c             | 289 -----------
 arch/s390/kernel/compat_linux.h             | 101 ----
 arch/s390/kernel/compat_ptrace.h            |  64 ---
 arch/s390/kernel/compat_signal.c            | 420 ----------------
 arch/s390/kernel/entry.S                    |   9 -
 arch/s390/kernel/perf_cpum_cf.c             |   1 -
 arch/s390/kernel/perf_event.c               |   1 -
 arch/s390/kernel/perf_regs.c                |   3 -
 arch/s390/kernel/process.c                  |   9 +-
 arch/s390/kernel/ptrace.c                   | 524 --------------------
 arch/s390/kernel/setup.c                    |   1 -
 arch/s390/kernel/signal.c                   |  23 +-
 arch/s390/kernel/stacktrace.c               |   3 -
 arch/s390/kernel/uprobes.c                  |   6 +-
 arch/s390/kernel/vdso.c                     |  26 +-
 arch/s390/kernel/vdso32/.gitignore          |   2 -
 arch/s390/kernel/vdso32/Makefile            |  64 ---
 arch/s390/kernel/vdso32/gen_vdso_offsets.sh |  15 -
 arch/s390/kernel/vdso32/note.S              |  13 -
 arch/s390/kernel/vdso32/vdso32.lds.S        | 140 ------
 arch/s390/kernel/vdso32/vdso32_wrapper.S    |  15 -
 arch/s390/kernel/vdso32/vdso_user_wrapper.S |  22 -
 arch/s390/mm/fault.c                        |   1 -
 arch/s390/mm/mmap.c                         |   1 -
 arch/s390/pci/pci_clp.c                     |   4 +-
 drivers/s390/block/dasd.c                   |   1 -
 drivers/s390/block/dasd_eckd.c              |  11 -
 drivers/s390/block/dasd_ioctl.c             |   6 +-
 drivers/s390/char/con3270.c                 |  19 -
 drivers/s390/char/fs3270.c                  |   7 +-
 drivers/s390/char/sclp_ctl.c                |  12 +-
 drivers/s390/char/tape_char.c               |  26 -
 drivers/s390/char/vmcp.c                    |   7 +-
 drivers/s390/cio/chsc_sch.c                 |   7 +-
 drivers/s390/crypto/zcrypt_api.c            | 195 --------
 drivers/s390/crypto/zcrypt_card.c           |   1 -
 drivers/s390/crypto/zcrypt_queue.c          |   1 -
 drivers/s390/net/qeth_core_main.c           |   4 +-
 57 files changed, 30 insertions(+), 2484 deletions(-)
 delete mode 100644 arch/s390/configs/compat.config
 delete mode 100644 arch/s390/include/asm/compat.h
 delete mode 100644 arch/s390/kernel/audit.h
 delete mode 100644 arch/s390/kernel/compat_audit.c
 delete mode 100644 arch/s390/kernel/compat_linux.c
 delete mode 100644 arch/s390/kernel/compat_linux.h
 delete mode 100644 arch/s390/kernel/compat_ptrace.h
 delete mode 100644 arch/s390/kernel/compat_signal.c
 delete mode 100644 arch/s390/kernel/vdso32/.gitignore
 delete mode 100644 arch/s390/kernel/vdso32/Makefile
 delete mode 100755 arch/s390/kernel/vdso32/gen_vdso_offsets.sh
 delete mode 100644 arch/s390/kernel/vdso32/note.S
 delete mode 100644 arch/s390/kernel/vdso32/vdso32.lds.S
 delete mode 100644 arch/s390/kernel/vdso32/vdso32_wrapper.S
 delete mode 100644 arch/s390/kernel/vdso32/vdso_user_wrapper.S
arch/s390/Kconfig +0 -16
index df22b10d9141..778ce20d3404 100644
@@ -504,22 +504,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
 
arch/s390/Makefile +0 -3
index b4769241332b..f41b8c5c4e56 100644
@@ -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
 
arch/s390/boot/ipl_data.c +0 -1
index 7957cc6554e7..b0fd8a526b42 100644
@@ -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>
arch/s390/configs/compat.config deleted +0 -3
deleted file mode 100644
index 6fd051453ae8..000000000000
@@ -1,3 +0,0 @@
-# Help: Enable compat support
-CONFIG_COMPAT=y
-CONFIG_COMPAT_32BIT_TIME=y
arch/s390/hypfs/hypfs_sprp.c +1 -5
index a2952ed5518b..a72576221cab 100644
@@ -7,7 +7,6 @@
  *    Author(s): Martin Schwidefsky <[email protected]>
  */
 
-#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);
arch/s390/include/asm/compat.h deleted +0 -140

140 lines not on this page · raw message

arch/s390/include/asm/elf.h +7 -39

86 lines not on this page · raw message

arch/s390/include/asm/ftrace.h +1 -18
index bee2d16c2951..692c484ec163 100644
@@ -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);
 }
 
arch/s390/include/asm/processor.h +3 -9
index 93e1034485d7..e3e3230aaf11 100644
@@ -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)
 
arch/s390/include/asm/seccomp.h +0 -5
index 71d46f0ba97b..f904b674fee0 100644
@@ -19,10 +19,5 @@
 #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 */
arch/s390/include/asm/syscall.h +1 -18
index 10ce5c4ccbd6..4271e4169f45 100644
@@ -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;
 }
 
arch/s390/include/asm/syscall_wrapper.h +0 -91

103 lines not on this page · raw message

arch/s390/include/asm/thread_info.h +0 -2
index 7878e9bfbf07..6a548a819400 100644
@@ -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)
arch/s390/include/asm/unistd.h +0 -5
index 70fc671397da..252d7ac7a6b2 100644
@@ -27,11 +27,6 @@
 #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
arch/s390/include/asm/vdso-symbols.h +0 -8
index 0df17574d788..205da2c565c2 100644
@@ -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__ */
arch/s390/kernel/Makefile +0 -4
index eb06ff888314..c949ed394e72 100644
@@ -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/
arch/s390/kernel/audit.c +0 -16
index 02051a596b87..7897d9411e13 100644
@@ -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);
arch/s390/kernel/audit.h deleted +0 -16
deleted file mode 100644
index 4d4b596412ec..000000000000
@@ -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 */
arch/s390/kernel/compat_audit.c deleted +0 -48

48 lines not on this page · raw message

arch/s390/kernel/compat_linux.c deleted +0 -289

289 lines not on this page · raw message

arch/s390/kernel/compat_linux.h deleted +0 -101

101 lines not on this page · raw message

arch/s390/kernel/compat_ptrace.h deleted +0 -64

64 lines not on this page · raw message

arch/s390/kernel/compat_signal.c deleted +0 -420

420 lines not on this page · raw message

arch/s390/kernel/entry.S +0 -9
index 75b0fbb236d0..3c7f183a945d 100644
@@ -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
arch/s390/kernel/perf_cpum_cf.c +0 -1
index 04457d88e589..b7fa9712ee1e 100644
@@ -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 = {
arch/s390/kernel/perf_event.c +0 -1
index 91b8716c883a..2de1574d95b2 100644
@@ -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>
arch/s390/kernel/perf_regs.c +0 -3
index a6b058ee4a36..7b305f1456f8 100644
@@ -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;
 }
 
arch/s390/kernel/process.c +2 -7
index b107dbca4ed7..0df95dcb2101 100644
@@ -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
arch/s390/kernel/ptrace.c +0 -524

550 lines not on this page · raw message

arch/s390/kernel/setup.c +0 -1
index 892fce2b7549..3c50246dc8c5 100644
@@ -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>
arch/s390/kernel/signal.c +2 -21
index e48013cd832c..e7775d121fa1 100644
@@ -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;
arch/s390/kernel/stacktrace.c +0 -3
index b153a395f46d..3aae7f70e6ab 100644
@@ -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);
arch/s390/kernel/uprobes.c +2 -4
index 5b0633ea8d93..baa462fae622 100644
@@ -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;
@@ -373,8 +372,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;
arch/s390/kernel/vdso.c +3 -23
index 430feb1a5013..83cc67cf21c8 100644
@@ -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);
arch/s390/kernel/vdso32/.gitignore deleted +0 -2
deleted file mode 100644
index 5167384843b9..000000000000
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-vdso32.lds
arch/s390/kernel/vdso32/Makefile deleted +0 -64

64 lines not on this page · raw message

arch/s390/kernel/vdso32/gen_vdso_offsets.sh deleted +0 -15
deleted file mode 100755
index 9c4f951e227d..000000000000
@@ -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'
arch/s390/kernel/vdso32/note.S deleted +0 -13
deleted file mode 100644
index db19d0680a0a..000000000000
@@ -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
arch/s390/kernel/vdso32/vdso32.lds.S deleted +0 -140

140 lines not on this page · raw message

arch/s390/kernel/vdso32/vdso32_wrapper.S deleted +0 -15
deleted file mode 100644
index de2fb930471a..000000000000
@@ -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
arch/s390/kernel/vdso32/vdso_user_wrapper.S deleted +0 -22
deleted file mode 100644
index 2e645003fdaf..000000000000
@@ -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
arch/s390/mm/fault.c +0 -1
index e1ad05bfd28a..4f6345f3c39a 100644
@@ -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>
arch/s390/mm/mmap.c +0 -1
index 197c1d9497a7..2a222a7e14f4 100644
@@ -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>
arch/s390/pci/pci_clp.c +1 -3
index 241f7251c873..02b73d4b6c7e 100644
@@ -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 = {
drivers/s390/block/dasd.c +0 -1
index 7765e40f7cea..2f3039cca6f2 100644
@@ -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,
 };
drivers/s390/block/dasd_eckd.c +0 -11
index 88fa17aea2ec..687396703788 100644
@@ -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,
drivers/s390/block/dasd_ioctl.c +1 -5
index 8308046a9f8f..f883990be626 100644
@@ -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;
drivers/s390/char/con3270.c +0 -19
index a367f95c7c53..bf3333231ab8 100644
@@ -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
 };
 
drivers/s390/char/fs3270.c +1 -6
index cfe7efd5b5da..73555dbe30d0 100644
@@ -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 */
 };
drivers/s390/char/sclp_ctl.c +2 -10
index dd6051602070..e23a97359286 100644
@@ -7,7 +7,6 @@
  * Author: Michael Holzheu <[email protected]>
  */
 
-#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,
 };
 
 /*
drivers/s390/char/tape_char.c +0 -26
index 89778d922d9f..195e247a74f5 100644
@@ -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,
 };
@@ -442,25 +435,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.
  */
drivers/s390/char/vmcp.c +1 -6
index 69899bb86b3e..bde6c9e59166 100644
@@ -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 = {
drivers/s390/cio/chsc_sch.c +1 -6
index 1e58ee3cc87d..ce992b2107cb 100644
@@ -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 = {
drivers/s390/crypto/zcrypt_api.c +0 -195

158 lines not on this page · raw message

drivers/s390/crypto/zcrypt_card.c +0 -1
index aa2c8ff2740e..6dea702a5cac 100644

Lines of this file are not shown. View the raw message.

drivers/s390/crypto/zcrypt_queue.c +0 -1
index 76a8678bdad6..a173d32eb6e8 100644

Lines of this file are not shown. View the raw message.

drivers/s390/net/qeth_core_main.c +1 -3
index edc0bcd46923..6d415e9d5c9f 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.48.1

Part of the diff is not shown here. View the raw message.

#11 lore raw

Re: [RFC PATCH 8/8] s390/syscalls: Switch to generic system call table generation

In reply to Heiko Carstens
Quoted 4 lines · Heiko Carstens

The s390 syscall.tbl format differs slightly from most others, and therefore requires an s390 specific system call table generation script.

Quoted 8 lines

With compat support gone use the opportunity to switch to generic system call table generation. The abi for all 64 bit system calls is now common, since there is no need to specify if system call entry points are only for 64 bit anymore.

Furthermore create the system call table in C instead of assembler code in order to get type checking for all system call functions contained within the table.

Thanks a lot for taking care of this!

I had a good look at the patch and checked that there are no stale syscalls that are no longer needed, the formatting, and the way this interfaces with the perf code that parses the same table. Everything looks good as far as I can see.

Quoted 7 lines

+161 common sched_rr_get_interval sys_sched_rr_get_interval
+162 common nanosleep sys_nanosleep
+163 common mremap sys_mremap
+167 common query_module
+168 common poll sys_poll
+169 common nfsservctl
+172 common prctl sys_prctl

Nothing wrong with your patch, but while reading through this, I noticed that we are somewhat inconsistent about syscalls that are gone, with three possible methods:

# 167 was query_module
167 common query_module sys_ni_syscall
167 common query_module

You use the third one now, which is the same as x86 but nothing else. The second one using an explicit 'sys_ni_syscall' is the most common and has the same effect, so maybe use that as well.

Eventually we may want to convert everything to the first method and drop the syscall macros, but that would be visible in user-space and might cause regression, so it should be a separate series across all architectures if we want to go there.

I believe we just chickened out when we did the conversion to syscall.tbl format originally and just left whatever was in the unistd.h headers at the time.

Arnd

#6 lore raw
In reply to Heiko Carstens

arch/s390/configs/compat.config line 3

Quoted 9 lines · Heiko Carstens
arch/s390/configs/compat.config deleted +0 -3
deleted file mode 100644
index 6fd051453ae8..000000000000
@@ -1,3 +0,0 @@
-# Help: Enable compat support
-CONFIG_COMPAT=y
-CONFIG_COMPAT_32BIT_TIME=y

I think you missed a reference to this file at

tools/testing/selftests/nolibc/Makefile.nolibc:DEFCONFIG_s390 = defconfig compat.config

arch/s390/configs/compat.config

Quoted 12 lines
arch/s390/configs/compat.config deleted +0 -12
-/*
- * 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)

This opens an interesting question: since compat_ptr() now doesn't do anything interesting any more, do we still require drivers to use it for correctness, or do we stop using it?

The cheri/morello code was repurposed compat_ptr() to support both 64-bit and 128-bit pointers in userland, and that has a chance of coming back in the future, but that's not getting merged and it isn't clear if any other 128-bit pointer support in the future would need a similar trick.

Arnd

author maintainer
#7 lore raw
Quoted 14 lines · Arnd Bergmann

arch/s390/configs/compat.config line 3

Quoted 9 lines · Heiko Carstens
arch/s390/configs/compat.config deleted +0 -3
deleted file mode 100644
index 6fd051453ae8..000000000000
@@ -1,3 +0,0 @@
-# Help: Enable compat support
-CONFIG_COMPAT=y
-CONFIG_COMPAT_32BIT_TIME=y

I think you missed a reference to this file at

Quoted 1 line

tools/testing/selftests/nolibc/Makefile.nolibc:DEFCONFIG_s390 = defconfig compat.config

Yes, and there is quite a bit more s390 specific compat stuff in nolibc which I missed. Will address that - thanks!

author maintainer
#12 lore raw

Re: [RFC PATCH 8/8] s390/syscalls: Switch to generic system call table generation

In reply to Arnd Bergmann
Quoted 13 lines · Arnd Bergmann
Quoted 7 lines · Heiko Carstens

+161 common sched_rr_get_interval sys_sched_rr_get_interval
+162 common nanosleep sys_nanosleep
+163 common mremap sys_mremap
+167 common query_module
+168 common poll sys_poll
+169 common nfsservctl
+172 common prctl sys_prctl

Nothing wrong with your patch, but while reading through this, I noticed that we are somewhat inconsistent about syscalls that are gone, with three possible methods:

Quoted 7 lines

# 167 was query_module
167 common query_module sys_ni_syscall
167 common query_module

You use the third one now, which is the same as x86 but nothing else. The second one using an explicit 'sys_ni_syscall' is the most common and has the same effect, so maybe use that as well.

Ok, will change.

Quoted 4 lines

Eventually we may want to convert everything to the first method and drop the syscall macros, but that would be visible in user-space and might cause regression, so it should be a separate series across all architectures if we want to go there.

Yes, I thought about to remove them, but this is user space visible. Therefore I kept it for now.

Reviewed-by on the v1 series
#13 lore raw
In reply to Heiko Carstens
Quoted 13 lines · Heiko Carstens

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

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

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

Quoted 6 lines

Arnd, we talked about this two weeks ago. I would appreciate if you could have a look at this series, especially the last patch of this series.

Patches 1-3 are just some random cleanups / preparations. Patches 4-6 remove compat support.
Patches 7-8 switch s390 to generic system call table generation

Loooks good to me overall,

I agree it's rather unlikely that anyone is still using 31-bit binaries, it was only really from 2000 to 2002 that commercial distros were missing s390x support. Debian moved to 64-bit-only much later than the others, but had both fewer user and fewer third-party applications that might require old binaries.

Arnd