]> git.baikalelectronics.ru Git - kernel.git/commitdiff
s390/signal: remove sigreturn on stack
authorSven Schnelle <svens@linux.ibm.com>
Fri, 25 Jun 2021 13:06:06 +0000 (15:06 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Jul 2021 20:12:17 +0000 (22:12 +0200)
{rt_}sigreturn is now called from the vdso, so we no longer
need the svc on the stack, and therefore no hack to support that
mechanism on machines with non-executable stack.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/entry-common.h
arch/s390/kernel/syscall.c
arch/s390/kernel/traps.c
arch/s390/mm/fault.c

index baa8005090c30914dc2a3c58076bbb58395c81ad..17aead80aadbabab62ae4f7f530cb3d299626e2d 100644 (file)
@@ -14,7 +14,6 @@
 #define ARCH_EXIT_TO_USER_MODE_WORK (_TIF_GUARDED_STORAGE | _TIF_PER_TRAP)
 
 void do_per_trap(struct pt_regs *regs);
-void do_syscall(struct pt_regs *regs);
 
 #ifdef CONFIG_DEBUG_ENTRY
 static __always_inline void arch_check_user_regs(struct pt_regs *regs)
index c6b99da0738b12e1f6d1a45aa2dbdc3a8aad7c66..ec73d2c61e58ad808724e340ff366c00495cbf56 100644 (file)
@@ -108,7 +108,7 @@ SYSCALL_DEFINE0(ni_syscall)
        return -ENOSYS;
 }
 
-void do_syscall(struct pt_regs *regs)
+static void do_syscall(struct pt_regs *regs)
 {
        unsigned long nr;
 
index 3a6d08d6df6f0da88f0ac3652968c42a47d6a770..76947275fe8bd1c21b58e1f353d27b9adde1c72f 100644 (file)
@@ -301,10 +301,9 @@ static void (*pgm_check_table[128])(struct pt_regs *regs);
 void noinstr __do_pgm_check(struct pt_regs *regs)
 {
        unsigned long last_break = S390_lowcore.breaking_event_addr;
-       unsigned int trapnr, syscall_redirect = 0;
+       unsigned int trapnr;
        irqentry_state_t state;
 
-       add_random_kstack_offset();
        regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc;
        regs->int_parm_long = S390_lowcore.trans_exc_code;
 
@@ -346,18 +345,9 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
        trapnr = regs->int_code & PGM_INT_CODE_MASK;
        if (trapnr)
                pgm_check_table[trapnr](regs);
-       syscall_redirect = user_mode(regs) && test_pt_regs_flag(regs, PIF_SYSCALL);
 out:
        local_irq_disable();
        irqentry_exit(regs, state);
-
-       if (syscall_redirect) {
-               enter_from_user_mode(regs);
-               local_irq_enable();
-               regs->orig_gpr2 = regs->gprs[2];
-               do_syscall(regs);
-               exit_to_user_mode();
-       }
 }
 
 /*
index 18b6212bd449f65d07ac221d0b0cede06f47e3f2..e33c43b38afe0e5b6566b1696cfb85dd3c4d1124 100644 (file)
@@ -285,26 +285,6 @@ static noinline void do_sigbus(struct pt_regs *regs)
                        (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
 }
 
-static noinline int signal_return(struct pt_regs *regs)
-{
-       u16 instruction;
-       int rc;
-
-       rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
-       if (rc)
-               return rc;
-       if (instruction == 0x0a77) {
-               set_pt_regs_flag(regs, PIF_SYSCALL);
-               regs->int_code = 0x00040077;
-               return 0;
-       } else if (instruction == 0x0aad) {
-               set_pt_regs_flag(regs, PIF_SYSCALL);
-               regs->int_code = 0x000400ad;
-               return 0;
-       }
-       return -EACCES;
-}
-
 static noinline void do_fault_error(struct pt_regs *regs, int access,
                                        vm_fault_t fault)
 {
@@ -312,9 +292,6 @@ static noinline void do_fault_error(struct pt_regs *regs, int access,
 
        switch (fault) {
        case VM_FAULT_BADACCESS:
-               if (access == VM_EXEC && signal_return(regs) == 0)
-                       break;
-               fallthrough;
        case VM_FAULT_BADMAP:
                /* Bad memory access. Check if it is kernel or user space. */
                if (user_mode(regs)) {