Skip to content

Commit 174cb82

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390: Remove 2k vs 4k page table leftovers
Since commit d08d4e7 ("s390/mm: use full 4KB page for 2KB PTE") always 4k page tables are allocated, however there is still some (now) obsolete code left which deals with switching from 2k to 4k page tables for qemu/kvm processes. Reviewed-by: Alexander Gordeev <[email protected]> Remove the not needed code. Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 9291ea0 commit 174cb82

File tree

9 files changed

+1
-59
lines changed

9 files changed

+1
-59
lines changed

arch/s390/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ config S390
7373
imply IMA_SECURE_AND_OR_TRUSTED_BOOT
7474
select ALTERNATE_USER_ADDRESS_SPACE
7575
select ARCH_32BIT_USTAT_F_TINODE
76-
select ARCH_BINFMT_ELF_STATE
7776
select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
7877
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
7978
select ARCH_ENABLE_MEMORY_HOTREMOVE

arch/s390/include/asm/elf.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ enum {
158158
#define ELF_DATA ELFDATA2MSB
159159
#define ELF_ARCH EM_S390
160160

161-
/* s390 specific phdr types */
162-
#define PT_S390_PGSTE 0x70000000
163-
164161
/*
165162
* ELF register definitions..
166163
*/
@@ -191,35 +188,6 @@ typedef s390_compat_regs compat_elf_gregset_t;
191188
&& (x)->e_ident[EI_CLASS] == ELF_CLASS)
192189
#define compat_start_thread start_thread31
193190

194-
struct arch_elf_state {
195-
int rc;
196-
};
197-
198-
#define INIT_ARCH_ELF_STATE { .rc = 0 }
199-
200-
#define arch_check_elf(ehdr, interp, interp_ehdr, state) (0)
201-
#ifdef CONFIG_PGSTE
202-
#define arch_elf_pt_proc(ehdr, phdr, elf, interp, state) \
203-
({ \
204-
struct arch_elf_state *_state = state; \
205-
if ((phdr)->p_type == PT_S390_PGSTE && \
206-
!page_table_allocate_pgste && \
207-
!test_thread_flag(TIF_PGSTE) && \
208-
!current->mm->context.alloc_pgste) { \
209-
set_thread_flag(TIF_PGSTE); \
210-
set_pt_regs_flag(task_pt_regs(current), \
211-
PIF_EXECVE_PGSTE_RESTART); \
212-
_state->rc = -EAGAIN; \
213-
} \
214-
_state->rc; \
215-
})
216-
#else
217-
#define arch_elf_pt_proc(ehdr, phdr, elf, interp, state) \
218-
({ \
219-
(state)->rc; \
220-
})
221-
#endif
222-
223191
/* For SVR4/S390 the function pointer to be registered with `atexit` is
224192
passed in R14. */
225193
#define ELF_PLAT_INIT(_r, load_addr) \

arch/s390/include/asm/mmu.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ typedef struct {
2222
* The following bitfields need a down_write on the mm
2323
* semaphore when they are written to. As they are only
2424
* written once, they can be read without a lock.
25-
*
26-
* The mmu context allocates 4K page tables.
2725
*/
28-
unsigned int alloc_pgste:1;
2926
/* The mmu context uses extended page tables. */
3027
unsigned int has_pgste:1;
3128
/* The mmu context uses storage keys. */

arch/s390/include/asm/mmu_context.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ static inline int init_new_context(struct task_struct *tsk,
2929
mm->context.gmap_asce = 0;
3030
mm->context.flush_mm = 0;
3131
#ifdef CONFIG_PGSTE
32-
mm->context.alloc_pgste = page_table_allocate_pgste ||
33-
test_thread_flag(TIF_PGSTE) ||
34-
(current->mm && current->mm->context.alloc_pgste);
3532
mm->context.has_pgste = 0;
3633
mm->context.uses_skeys = 0;
3734
mm->context.uses_cmm = 0;

arch/s390/include/asm/pgtable.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,6 @@ static inline int mm_is_protected(struct mm_struct *mm)
584584
return 0;
585585
}
586586

587-
static inline int mm_alloc_pgste(struct mm_struct *mm)
588-
{
589-
#ifdef CONFIG_PGSTE
590-
if (unlikely(mm->context.alloc_pgste))
591-
return 1;
592-
#endif
593-
return 0;
594-
}
595-
596587
static inline pgste_t clear_pgste_bit(pgste_t pgste, unsigned long mask)
597588
{
598589
return __pgste(pgste_val(pgste) & ~mask);

arch/s390/include/asm/ptrace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
#include <asm/tpi.h>
1313

1414
#define PIF_SYSCALL 0 /* inside a system call */
15-
#define PIF_EXECVE_PGSTE_RESTART 1 /* restart execve for PGSTE binaries */
1615
#define PIF_SYSCALL_RET_SET 2 /* return value was set via ptrace */
1716
#define PIF_GUEST_FAULT 3 /* indicates program check in sie64a */
1817
#define PIF_FTRACE_FULL_REGS 4 /* all register contents valid (ftrace) */
1918

2019
#define _PIF_SYSCALL BIT(PIF_SYSCALL)
21-
#define _PIF_EXECVE_PGSTE_RESTART BIT(PIF_EXECVE_PGSTE_RESTART)
2220
#define _PIF_SYSCALL_RET_SET BIT(PIF_SYSCALL_RET_SET)
2321
#define _PIF_GUEST_FAULT BIT(PIF_GUEST_FAULT)
2422
#define _PIF_FTRACE_FULL_REGS BIT(PIF_FTRACE_FULL_REGS)

arch/s390/include/asm/thread_info.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ void arch_setup_new_exec(void);
6767
#define TIF_NEED_RESCHED_LAZY 3 /* lazy rescheduling needed */
6868
#define TIF_UPROBE 4 /* breakpointed or single-stepping */
6969
#define TIF_PATCH_PENDING 5 /* pending live patching update */
70-
#define TIF_PGSTE 6 /* New mm's will use 4K page tables */
7170
#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */
7271
#define TIF_GUARDED_STORAGE 8 /* load guarded storage control block */
7372
#define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */
@@ -89,7 +88,6 @@ void arch_setup_new_exec(void);
8988
#define _TIF_NEED_RESCHED_LAZY BIT(TIF_NEED_RESCHED_LAZY)
9089
#define _TIF_UPROBE BIT(TIF_UPROBE)
9190
#define _TIF_PATCH_PENDING BIT(TIF_PATCH_PENDING)
92-
#define _TIF_PGSTE BIT(TIF_PGSTE)
9391
#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)
9492
#define _TIF_GUARDED_STORAGE BIT(TIF_GUARDED_STORAGE)
9593
#define _TIF_ISOLATE_BP_GUEST BIT(TIF_ISOLATE_BP_GUEST)

arch/s390/kernel/syscall.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ void noinstr __do_syscall(struct pt_regs *regs, int per_trap)
121121
if (unlikely(test_and_clear_pt_regs_flag(regs, PIF_SYSCALL_RET_SET)))
122122
goto out;
123123
regs->gprs[2] = -ENOSYS;
124-
if (unlikely(nr >= NR_syscalls))
125-
goto out;
126-
do {
124+
if (likely(nr < NR_syscalls))
127125
regs->gprs[2] = current->thread.sys_call_table[nr](regs);
128-
} while (test_and_clear_pt_regs_flag(regs, PIF_EXECVE_PGSTE_RESTART));
129126
out:
130127
syscall_exit_to_user_mode(regs);
131128
}

arch/s390/mm/gmap.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,9 +2260,6 @@ int s390_enable_sie(void)
22602260
/* Do we have pgstes? if yes, we are done */
22612261
if (mm_has_pgste(mm))
22622262
return 0;
2263-
/* Fail if the page tables are 2K */
2264-
if (!mm_alloc_pgste(mm))
2265-
return -EINVAL;
22662263
mmap_write_lock(mm);
22672264
mm->context.has_pgste = 1;
22682265
/* split thp mappings and disable thp for future mappings */

0 commit comments

Comments
 (0)