powerpc/64: Use task_stack_page() to initialise paca->kstack
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 17 Jan 2019 12:26:56 +0000 (23:26 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 23 Feb 2019 11:31:40 +0000 (22:31 +1100)
Rather than using the thread info use task_stack_page() to initialise
paca->kstack, that way it will work with THREAD_INFO_IN_TASK.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Split out of larger patch]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/smp.c

index 5366d9e7bed40a3643ce98a693790a9769ca61d1..829ef5411b50b93a998a43db6c3d286310e514fa 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/export.h>
 #include <linux/sched/mm.h>
+#include <linux/sched/task_stack.h>
 #include <linux/sched/topology.h>
 #include <linux/smp.h>
 #include <linux/interrupt.h>
@@ -984,7 +985,8 @@ static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle)
 
 #ifdef CONFIG_PPC64
        paca_ptrs[cpu]->__current = idle;
-       paca_ptrs[cpu]->kstack = (unsigned long)ti + THREAD_SIZE - STACK_FRAME_OVERHEAD;
+       paca_ptrs[cpu]->kstack = (unsigned long)task_stack_page(idle) +
+                                THREAD_SIZE - STACK_FRAME_OVERHEAD;
 #endif
        ti->cpu = cpu;
        secondary_ti = current_set[cpu] = ti;