summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2023-03-25 15:28:58 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2023-04-11 16:13:32 +0300
commit959791e45fd2a580403e03611a5aefb9e7abcfc0 (patch)
tree66c0c6ac3eb35ece6149688028fe08a72b2b8c0f /arch/powerpc/kernel
parentc013e9f2bbe1d2be5e1c7f4a84216cd10837f20d (diff)
downloadlinux-959791e45fd2a580403e03611a5aefb9e7abcfc0.tar.xz
powerpc: copy_thread make ret_from_fork register setup consistent
The ret_from_fork code for 64e and 32-bit set r3 for syscall_exit_prepare the same way that 64s does, so there should be no need to special-case them in copy_thread. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230325122904.2375060-3-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/entry_32.S2
-rw-r--r--arch/powerpc/kernel/process.c3
2 files changed, 1 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 5604c9a1ac22..755408c63be8 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -183,7 +183,7 @@ syscall_exit_finish:
ret_from_fork:
REST_NVGPRS(r1)
bl schedule_tail
- li r3,0
+ li r3,0 /* fork() return value */
b ret_from_syscall
.globl ret_from_kernel_thread
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 7fe700309151..18f697112193 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1784,9 +1784,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
childregs->gpr[1] = usp;
((unsigned long *)sp)[0] = childregs->gpr[1];
p->thread.regs = childregs;
- /* 64s sets this in ret_from_fork */
- if (!IS_ENABLED(CONFIG_PPC_BOOK3S_64))
- childregs->gpr[3] = 0; /* Result from fork() */
if (clone_flags & CLONE_SETTLS) {
if (!is_32bit_task())
childregs->gpr[13] = tls;