Commit d195ce46 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc: copy_thread don't set _TIF_RESTOREALL

In the kernel user thread path, don't set _TIF_RESTOREALL because
the thread is required to call kernel_execve() before it returns,
which will set _TIF_RESTOREALL if necessary via start_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-8-npiggin@gmail.com
parent b504b6aa
...@@ -748,6 +748,11 @@ _GLOBAL(ret_from_kernel_user_thread) ...@@ -748,6 +748,11 @@ _GLOBAL(ret_from_kernel_user_thread)
#endif #endif
bctrl bctrl
li r3,0 li r3,0
/*
* It does not matter whether this returns via the scv or sc path
* because it returns as execve() and therefore has no calling ABI
* (i.e., it sets registers according to the exec()ed entry point).
*/
b .Lsyscall_exit b .Lsyscall_exit
_GLOBAL(start_kernel_thread) _GLOBAL(start_kernel_thread)
......
...@@ -1745,7 +1745,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) ...@@ -1745,7 +1745,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
extern void start_kernel_thread(void); extern void start_kernel_thread(void);
void (*f)(void); void (*f)(void);
unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE; unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
struct thread_info *ti = task_thread_info(p);
#ifdef CONFIG_HAVE_HW_BREAKPOINT #ifdef CONFIG_HAVE_HW_BREAKPOINT
int i; int i;
#endif #endif
...@@ -1784,7 +1783,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) ...@@ -1784,7 +1783,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
childregs->softe = IRQS_ENABLED; childregs->softe = IRQS_ENABLED;
#endif #endif
ti->flags |= _TIF_RESTOREALL;
f = ret_from_kernel_user_thread; f = ret_from_kernel_user_thread;
} else { } else {
struct pt_regs *regs = current_pt_regs(); struct pt_regs *regs = current_pt_regs();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment