Skip to content

Commit 0d79aff

Browse files
committed
Merge branch 'compat-removal'
Heiko Carstens says: ==================== Remove s390 compat support to allow for code simplification and especially reduced test effort. To the best of our knowledge there aren't any 31 bit binaries out in the world anymore that would matter for newer kernels or newer distributions. Distributions do not provide compat packages since quite some time or even have CONFIG_COMPAT disabled. Instead of adding deprecation warnings to config option, or adding kernel messages, just remove the code. Deprecation warnings haven't proven to be useful. If it turns out there is still a reason to keep the compat support this series can be reverted at any time in the future. ==================== Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2 parents 52a1f73 + 4ac286c commit 0d79aff

79 files changed

Lines changed: 462 additions & 3540 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/s390/Kconfig

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -505,22 +505,6 @@ config COMMAND_LINE_SIZE
505505
This allows you to specify the maximum length of the kernel command
506506
line.
507507

508-
config COMPAT
509-
def_bool n
510-
prompt "Kernel support for 31 bit emulation"
511-
select ARCH_WANT_OLD_COMPAT_IPC
512-
select COMPAT_OLD_SIGACTION
513-
select HAVE_UID16
514-
depends on MULTIUSER
515-
depends on !CC_IS_CLANG && !LD_IS_LLD
516-
help
517-
Select this option if you want to enable your system kernel to
518-
handle system-calls from ELF binaries for 31 bit ESA. This option
519-
(and some other stuff like libraries and such) is needed for
520-
executing 31 bit applications.
521-
522-
If unsure say N.
523-
524508
config SMP
525509
def_bool y
526510

arch/s390/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ zfcpdump:
134134
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
135135

136136
archheaders:
137-
$(Q)$(MAKE) $(build)=$(syscalls) uapi
137+
$(Q)$(MAKE) $(build)=$(syscalls) all
138138

139139
archprepare:
140-
$(Q)$(MAKE) $(build)=$(syscalls) kapi
141140
$(Q)$(MAKE) $(build)=$(tools) kapi $(extra_tools)
142141
ifeq ($(KBUILD_EXTMOD),)
143142
# We need to generate vdso-offsets.h before compiling certain files in kernel/.
@@ -149,11 +148,8 @@ ifeq ($(KBUILD_EXTMOD),)
149148
prepare: vdso_prepare
150149
vdso_prepare: prepare0
151150
$(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h
152-
$(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
153-
$(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h)
154151

155152
vdso-install-y += arch/s390/kernel/vdso64/vdso64.so.dbg
156-
vdso-install-$(CONFIG_COMPAT) += arch/s390/kernel/vdso32/vdso32.so.dbg
157153

158154
endif
159155

arch/s390/boot/ipl_data.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3-
#include <linux/compat.h>
43
#include <linux/ptrace.h>
54
#include <asm/cio.h>
65
#include <asm/asm-offsets.h>
@@ -12,7 +11,7 @@
1211
#define PSW_MASK_DISABLED (PSW_MASK_WAIT | PSW_MASK_EA | PSW_MASK_BA)
1312

1413
struct ipl_lowcore {
15-
psw_t32 ipl_psw; /* 0x0000 */
14+
psw32_t ipl_psw; /* 0x0000 */
1615
struct ccw0 ccwpgm[2]; /* 0x0008 */
1716
u8 fill[56]; /* 0x0018 */
1817
struct ccw0 ccwpgmcc[20]; /* 0x0050 */

arch/s390/configs/compat.config

Lines changed: 0 additions & 3 deletions
This file was deleted.

arch/s390/hypfs/hypfs_sprp.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
88
*/
99

10-
#include <linux/compat.h>
1110
#include <linux/errno.h>
1211
#include <linux/gfp.h>
1312
#include <linux/string.h>
@@ -116,10 +115,7 @@ static long hypfs_sprp_ioctl(struct file *file, unsigned int cmd,
116115

117116
if (!capable(CAP_SYS_ADMIN))
118117
return -EACCES;
119-
if (is_compat_task())
120-
argp = compat_ptr(arg);
121-
else
122-
argp = (void __user *) arg;
118+
argp = (void __user *)arg;
123119
switch (cmd) {
124120
case HYPFS_DIAG304:
125121
return __hypfs_sprp_ioctl(argp);

arch/s390/include/asm/compat.h

Lines changed: 0 additions & 140 deletions
This file was deleted.

arch/s390/include/asm/elf.h

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,13 @@ enum {
162162
* ELF register definitions..
163163
*/
164164

165-
#include <linux/compat.h>
166-
167165
#include <asm/ptrace.h>
168166
#include <asm/syscall.h>
169167
#include <asm/user.h>
170168

171169
typedef s390_fp_regs elf_fpregset_t;
172170
typedef s390_regs elf_gregset_t;
173171

174-
typedef s390_fp_regs compat_elf_fpregset_t;
175-
typedef s390_compat_regs compat_elf_gregset_t;
176-
177172
#include <linux/sched/mm.h> /* for task_struct */
178173
#include <asm/mmu_context.h>
179174

@@ -183,10 +178,6 @@ typedef s390_compat_regs compat_elf_gregset_t;
183178
#define elf_check_arch(x) \
184179
(((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \
185180
&& (x)->e_ident[EI_CLASS] == ELF_CLASS)
186-
#define compat_elf_check_arch(x) \
187-
(((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \
188-
&& (x)->e_ident[EI_CLASS] == ELF_CLASS)
189-
#define compat_start_thread start_thread31
190181

191182
/* For SVR4/S390 the function pointer to be registered with `atexit` is
192183
passed in R14. */
@@ -203,9 +194,7 @@ typedef s390_compat_regs compat_elf_gregset_t;
203194
the loader. We need to make sure that it is out of the way of the program
204195
that it will "exec", and that there is sufficient room for the brk. 64-bit
205196
tasks are aligned to 4GB. */
206-
#define ELF_ET_DYN_BASE (is_compat_task() ? \
207-
(STACK_TOP / 3 * 2) : \
208-
(STACK_TOP / 3 * 2) & ~((1UL << 32) - 1))
197+
#define ELF_ET_DYN_BASE ((STACK_TOP / 3 * 2) & ~((1UL << 32) - 1))
209198

210199
/* This yields a mask that user programs can use to figure out what
211200
instruction set this CPU supports. */
@@ -224,43 +213,21 @@ extern unsigned long elf_hwcap;
224213
extern char elf_platform[];
225214
#define ELF_PLATFORM (elf_platform)
226215

227-
#ifndef CONFIG_COMPAT
228216
#define SET_PERSONALITY(ex) \
229217
do { \
230218
set_personality(PER_LINUX | \
231219
(current->personality & (~PER_MASK))); \
232-
current->thread.sys_call_table = sys_call_table; \
233-
} while (0)
234-
#else /* CONFIG_COMPAT */
235-
#define SET_PERSONALITY(ex) \
236-
do { \
237-
if (personality(current->personality) != PER_LINUX32) \
238-
set_personality(PER_LINUX | \
239-
(current->personality & ~PER_MASK)); \
240-
if ((ex).e_ident[EI_CLASS] == ELFCLASS32) { \
241-
set_thread_flag(TIF_31BIT); \
242-
current->thread.sys_call_table = \
243-
sys_call_table_emu; \
244-
} else { \
245-
clear_thread_flag(TIF_31BIT); \
246-
current->thread.sys_call_table = \
247-
sys_call_table; \
248-
} \
249220
} while (0)
250-
#endif /* CONFIG_COMPAT */
251221

252222
/*
253223
* Cache aliasing on the latest machines calls for a mapping granularity
254-
* of 512KB for the anonymous mapping base. For 64-bit processes use a
255-
* 512KB alignment and a randomization of up to 1GB. For 31-bit processes
256-
* the virtual address space is limited, use no alignment and limit the
257-
* randomization to 8MB.
258-
* For the additional randomization of the program break use 32MB for
259-
* 64-bit and 8MB for 31-bit.
224+
* of 512KB for the anonymous mapping base. Use a 512KB alignment and a
225+
* randomization of up to 1GB.
226+
* For the additional randomization of the program break use 32MB.
260227
*/
261-
#define BRK_RND_MASK (is_compat_task() ? 0x7ffUL : 0x1fffUL)
262-
#define MMAP_RND_MASK (is_compat_task() ? 0x7ffUL : 0x3ff80UL)
263-
#define MMAP_ALIGN_MASK (is_compat_task() ? 0 : 0x7fUL)
228+
#define BRK_RND_MASK (0x1fffUL)
229+
#define MMAP_RND_MASK (0x3ff80UL)
230+
#define MMAP_ALIGN_MASK (0x7fUL)
264231
#define STACK_RND_MASK MMAP_RND_MASK
265232

266233
/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */

arch/s390/include/asm/ftrace.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,28 +105,11 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsi
105105
}
106106
#endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
107107

108-
/*
109-
* Even though the system call numbers are identical for s390/s390x a
110-
* different system call table is used for compat tasks. This may lead
111-
* to e.g. incorrect or missing trace event sysfs files.
112-
* Therefore simply do not trace compat system calls at all.
113-
* See kernel/trace/trace_syscalls.c.
114-
*/
115-
#define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS
116-
static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
117-
{
118-
return is_compat_task();
119-
}
120-
121108
#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
122109
static inline bool arch_syscall_match_sym_name(const char *sym,
123110
const char *name)
124111
{
125-
/*
126-
* Skip __s390_ and __s390x_ prefix - due to compat wrappers
127-
* and aliasing some symbols of 64 bit system call functions
128-
* may get the __s390_ prefix instead of the __s390x_ prefix.
129-
*/
112+
/* Skip the __s390x_ prefix. */
130113
return !strcmp(sym + 7, name) || !strcmp(sym + 8, name);
131114
}
132115

arch/s390/include/asm/processor.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,12 @@ extern void execve_tail(void);
119119
unsigned long vdso_text_size(void);
120120
unsigned long vdso_size(void);
121121

122-
/*
123-
* User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit.
124-
*/
125-
126-
#define TASK_SIZE (test_thread_flag(TIF_31BIT) ? \
127-
_REGION3_SIZE : TASK_SIZE_MAX)
128-
#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
129-
(_REGION3_SIZE >> 1) : (_REGION2_SIZE >> 1))
122+
#define TASK_SIZE (TASK_SIZE_MAX)
123+
#define TASK_UNMAPPED_BASE (_REGION2_SIZE >> 1)
130124
#define TASK_SIZE_MAX (-PAGE_SIZE)
131125

132126
#define VDSO_BASE (STACK_TOP + PAGE_SIZE)
133-
#define VDSO_LIMIT (test_thread_flag(TIF_31BIT) ? _REGION3_SIZE : _REGION2_SIZE)
127+
#define VDSO_LIMIT (_REGION2_SIZE)
134128
#define STACK_TOP (VDSO_LIMIT - vdso_size() - PAGE_SIZE)
135129
#define STACK_TOP_MAX (_REGION2_SIZE - vdso_size() - PAGE_SIZE)
136130

@@ -181,7 +175,6 @@ struct thread_struct {
181175
unsigned long system_timer; /* task cputime in kernel space */
182176
unsigned long hardirq_timer; /* task cputime in hardirq context */
183177
unsigned long softirq_timer; /* task cputime in softirq context */
184-
const sys_call_ptr_t *sys_call_table; /* system call table address */
185178
union teid gmap_teid; /* address and flags of last gmap fault */
186179
unsigned int gmap_int_code; /* int code of last gmap fault */
187180
int ufpu_flags; /* user fpu flags */

arch/s390/include/asm/ptrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ enum {
102102
typedef struct {
103103
unsigned int mask;
104104
unsigned int addr;
105-
} psw_t32 __aligned(8);
105+
} psw32_t __aligned(8);
106106

107107
#define PGM_INT_CODE_MASK 0x7f
108108
#define PGM_INT_CODE_PER 0x80

0 commit comments

Comments
 (0)