powerpc: use switch frame for ret_from_kernel_thread parameters
authorNicholas Piggin <npiggin@gmail.com>
Sat, 25 Mar 2023 12:28:59 +0000 (22:28 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 11 Apr 2023 13:13:32 +0000 (23:13 +1000)
commitaf5ca9d5c8b45244b237d7a5534e1ec2d01cce8e
treeeb23a6cd9966f8b18a903abbb9d7338b4194f4f7
parent959791e45fd2a580403e03611a5aefb9e7abcfc0
powerpc: use switch frame for ret_from_kernel_thread parameters

The kernel thread path in copy_thread creates a user interrupt frame on
stack and stores the function and arg parameters there, and
ret_from_kernel_thread loads them. This is a slightly confusing way to
overload that frame. Non-volatile registers are loaded from the switch
frame, so the parameters can be stored there. The user interrupt frame
is now only used by user threads when they return to user.

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