OSDN Git Service

powerpc: differentiate kthread from user kernel thread start
authorNicholas Piggin <npiggin@gmail.com>
Sat, 25 Mar 2023 12:29:02 +0000 (22:29 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 11 Apr 2023 13:13:33 +0000 (23:13 +1000)
commitb504b6aade0403eaffa9ce51b8207d710705beaf
tree37f8f021c4feda6cb362d01a1ae2a7b5244f15a0
parenteed7c420aac7fde5e5915d2747c3ebbbda225835
powerpc: differentiate kthread from user kernel thread start

Kernel created user threads start similarly to kernel threads in that
they call a kernel function after first returning from _switch, so
they share ret_from_kernel_thread for this. Kernel threads never return
from that function though, whereas user threads often do (although some
don't, e.g., IO threads).

Split these startup functions in two, and catch kernel threads that
improperly return from their function. This is intended to make the
complicated code a little bit easier to understand.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230325122904.2375060-7-npiggin@gmail.com
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/interrupt_64.S
arch/powerpc/kernel/process.c