s390: convert to generic kernel_execve()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Sep 2012 21:08:47 +0000 (17:08 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 1 Oct 2012 03:03:04 +0000 (23:03 -0400)
same situation as with alpha and arm - only massage needed

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/s390/include/asm/unistd.h
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S

index 9afacff38edc434d764ddb4979735ab7ead97d90..3c500174459a9d4d5793474729d0217b0c077f7e 100644 (file)
 #   define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
 # endif
 #define __ARCH_WANT_SYS_EXECVE
+#define __ARCH_WANT_KERNEL_EXECVE
 
 /*
  * "Conditional" syscalls
index 24de1cd3754be18ead732700cd5833ed23fa4c01..ef46f66bc0d6bdf0caa0dc4ecaae4225f3d3b1ef 100644 (file)
@@ -355,30 +355,13 @@ ENTRY(kernel_thread_starter)
 # kernel_execve function needs to deal with pt_regs that is not
 # at the usual place
 #
-ENTRY(kernel_execve)
-       stm     %r12,%r15,48(%r15)
-       lr      %r14,%r15
-       l       %r13,__LC_SVC_NEW_PSW+4
-       ahi     %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
-       st      %r14,__SF_BACKCHAIN(%r15)
-       la      %r12,STACK_FRAME_OVERHEAD(%r15)
-       xc      0(__PT_SIZE,%r12),0(%r12)
-       l       %r1,BASED(.Ldo_execve)
-       lr      %r5,%r12
-       basr    %r14,%r1                # call do_execve
-       ltr     %r2,%r2
-       je      0f
-       ahi     %r15,(STACK_FRAME_OVERHEAD + __PT_SIZE)
-       lm      %r12,%r15,48(%r15)
-       br      %r14
-       # execve succeeded.
-0:     ssm     __LC_PGM_NEW_PSW        # disable I/O and ext. interrupts
-       l       %r15,__LC_KERNEL_STACK  # load ksp
-       ahi     %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
-       la      %r11,STACK_FRAME_OVERHEAD(%r15)
-       mvc     0(__PT_SIZE,%r11),0(%r12)       # copy pt_regs
-       l       %r12,__LC_THREAD_INFO
+ENTRY(ret_from_kernel_execve)
+       ssm     __LC_PGM_NEW_PSW        # disable I/O and ext. interrupts
+       lr      %r15,%r2
+       lr      %r11,%r2
+       ahi     %r15,-STACK_FRAME_OVERHEAD
        xc      __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15)
+       l       %r12,__LC_THREAD_INFO
        ssm     __LC_SVC_NEW_PSW        # reenable interrupts
        j       sysc_return
 
@@ -941,7 +924,6 @@ cleanup_idle_wait:
 .Ldo_signal:           .long   do_signal
 .Ldo_notify_resume:    .long   do_notify_resume
 .Ldo_per_trap:         .long   do_per_trap
-.Ldo_execve:           .long   do_execve
 .Ljump_table:          .long   pgm_check_table
 .Lschedule:            .long   schedule
 #ifdef CONFIG_PREEMPT
index 39c84e65f74f584f8507baaadf4e98111b757024..3d188f74d4c05c4d11b2f60704c9e789bb1b0592 100644 (file)
@@ -369,32 +369,13 @@ ENTRY(kernel_thread_starter)
        la      %r2,0
        br      %r11                    # do_exit
 
-#
-# kernel_execve function needs to deal with pt_regs that is not
-# at the usual place
-#
-ENTRY(kernel_execve)
-       stmg    %r12,%r15,96(%r15)
-       lgr     %r14,%r15
-       aghi    %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
-       stg     %r14,__SF_BACKCHAIN(%r15)
-       la      %r12,STACK_FRAME_OVERHEAD(%r15)
-       xc      0(__PT_SIZE,%r12),0(%r12)
-       lgr     %r5,%r12
-       brasl   %r14,do_execve
-       ltgfr   %r2,%r2
-       je      0f
-       aghi    %r15,(STACK_FRAME_OVERHEAD + __PT_SIZE)
-       lmg     %r12,%r15,96(%r15)
-       br      %r14
-       # execve succeeded.
-0:     ssm     __LC_PGM_NEW_PSW        # disable I/O and ext. interrupts
-       lg      %r15,__LC_KERNEL_STACK  # load ksp
-       aghi    %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE)
-       la      %r11,STACK_FRAME_OVERHEAD(%r15)
-       mvc     0(__PT_SIZE,%r11),0(%r12)       # copy pt_regs
-       lg      %r12,__LC_THREAD_INFO
+ENTRY(ret_from_kernel_execve)
+       ssm     __LC_PGM_NEW_PSW        # disable I/O and ext. interrupts
+       lgr     %r15,%r2
+       lgr     %r11,%r2
+       aghi    %r15,-STACK_FRAME_OVERHEAD
        xc      __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
+       lg      %r12,__LC_THREAD_INFO
        ssm     __LC_SVC_NEW_PSW        # reenable interrupts
        j       sysc_return