Commit 959791e4 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

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: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230325122904.2375060-3-npiggin@gmail.com
parent c013e9f2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+0 −3
Original line number Diff line number Diff line
@@ -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;