Commit 30dcb099 authored by Al Viro's avatar Al Viro

s390: switch to saner kernel_execve() semantics

Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ddffeb8c
...@@ -136,6 +136,7 @@ config S390 ...@@ -136,6 +136,7 @@ config S390
select KTIME_SCALAR if 32BIT select KTIME_SCALAR if 32BIT
select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_SECCOMP_FILTER
select GENERIC_KERNEL_THREAD select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND # define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
# endif # endif
#define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_KERNEL_EXECVE
/* /*
* "Conditional" syscalls * "Conditional" syscalls
......
...@@ -330,40 +330,18 @@ ENTRY(ret_from_fork) ...@@ -330,40 +330,18 @@ ENTRY(ret_from_fork)
la %r11,STACK_FRAME_OVERHEAD(%r15) la %r11,STACK_FRAME_OVERHEAD(%r15)
l %r12,__LC_THREAD_INFO l %r12,__LC_THREAD_INFO
l %r13,__LC_SVC_NEW_PSW+4 l %r13,__LC_SVC_NEW_PSW+4
tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
je 1f
l %r1,BASED(.Lschedule_tail) l %r1,BASED(.Lschedule_tail)
basr %r14,%r1 # call schedule_tail basr %r14,%r1 # call schedule_tail
TRACE_IRQS_ON TRACE_IRQS_ON
ssm __LC_SVC_NEW_PSW # reenable interrupts ssm __LC_SVC_NEW_PSW # reenable interrupts
j sysc_tracenogo tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
jne sysc_tracenogo
1: # it's a kernel thread # it's a kernel thread
st %r15,__PT_R15(%r11) # store stack pointer for new kthread lm %r9,%r10,__PT_R9(%r11) # load gprs
l %r1,BASED(.Lschedule_tail)
basr %r14,%r1 # call schedule_tail
TRACE_IRQS_ON
ssm __LC_SVC_NEW_PSW # reenable interrupts
lm %r9,%r11,__PT_R9(%r11) # load gprs
ENTRY(kernel_thread_starter) ENTRY(kernel_thread_starter)
la %r2,0(%r10) la %r2,0(%r10)
basr %r14,%r9 basr %r14,%r9
la %r2,0 j sysc_tracenogo
br %r11 # do_exit
#
# kernel_execve function needs to deal with pt_regs that is not
# at the usual place
#
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
/* /*
* Program check handler routine * Program check handler routine
......
...@@ -352,33 +352,17 @@ sysc_tracenogo: ...@@ -352,33 +352,17 @@ sysc_tracenogo:
ENTRY(ret_from_fork) ENTRY(ret_from_fork)
la %r11,STACK_FRAME_OVERHEAD(%r15) la %r11,STACK_FRAME_OVERHEAD(%r15)
lg %r12,__LC_THREAD_INFO lg %r12,__LC_THREAD_INFO
tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
je 1f
brasl %r14,schedule_tail brasl %r14,schedule_tail
TRACE_IRQS_ON TRACE_IRQS_ON
ssm __LC_SVC_NEW_PSW # reenable interrupts ssm __LC_SVC_NEW_PSW # reenable interrupts
j sysc_tracenogo tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
1: # it's a kernel thread jne sysc_tracenogo
stg %r15,__PT_R15(%r11) # store stack pointer for new kthread # it's a kernel thread
brasl %r14,schedule_tail lmg %r9,%r10,__PT_R9(%r11) # load gprs
TRACE_IRQS_ON
ssm __LC_SVC_NEW_PSW # reenable interrupts
lmg %r9,%r11,__PT_R9(%r11) # load gprs
ENTRY(kernel_thread_starter) ENTRY(kernel_thread_starter)
la %r2,0(%r10) la %r2,0(%r10)
basr %r14,%r9 basr %r14,%r9
la %r2,0 j sysc_tracenogo
br %r11 # do_exit
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
/* /*
* Program check handler routine * Program check handler routine
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment