summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/entry64.S
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-09-10 18:03:41 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-30 23:03:03 -0400
commit37fe5d41f6403b0ea84c1586548bf1b03f834af0 (patch)
tree37e404af54f246a686dba85099187415591cde9d /arch/s390/kernel/entry64.S
parent65f22a906e154e8086ed561904d09c3586de85f4 (diff)
downloadop-kernel-dev-37fe5d41f6403b0ea84c1586548bf1b03f834af0.zip
op-kernel-dev-37fe5d41f6403b0ea84c1586548bf1b03f834af0.tar.gz
s390: fold kernel_thread_helper() into ret_from_fork()
... and don't bother with syscall return path in case of kernel threads. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/s390/kernel/entry64.S')
-rw-r--r--arch/s390/kernel/entry64.S16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 1f776f2..39c84e6 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -352,12 +352,22 @@ ENTRY(ret_from_fork)
la %r11,STACK_FRAME_OVERHEAD(%r15)
lg %r12,__LC_THREAD_INFO
tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
- jo 0f
- stg %r15,__PT_R15(%r11) # store stack pointer for new kthread
-0: brasl %r14,schedule_tail
+ je 1f
+ brasl %r14,schedule_tail
TRACE_IRQS_ON
ssm __LC_SVC_NEW_PSW # reenable interrupts
j sysc_tracenogo
+1: # it's a kernel thread
+ stg %r15,__PT_R15(%r11) # store stack pointer for new kthread
+ brasl %r14,schedule_tail
+ TRACE_IRQS_ON
+ ssm __LC_SVC_NEW_PSW # reenable interrupts
+ lmg %r9,%r11,__PT_R9(%r11) # load gprs
+ENTRY(kernel_thread_starter)
+ la %r2,0(%r10)
+ basr %r14,%r9
+ la %r2,0
+ br %r11 # do_exit
#
# kernel_execve function needs to deal with pt_regs that is not
OpenPOWER on IntegriCloud