All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@ozlabs.org
Cc: npiggin@gmail.com
Subject: [PATCH v16 18/21] powerpc: 'current_set' is now a table of task_struct pointers
Date: Tue,  5 Feb 2019 22:32:16 +1100	[thread overview]
Message-ID: <20190205113219.17903-19-mpe@ellerman.id.au> (raw)
In-Reply-To: <20190205113219.17903-1-mpe@ellerman.id.au>

From: Christophe Leroy <christophe.leroy@c-s.fr>

The table of pointers 'current_set' has been used for retrieving
the stack and current. They used to be thread_info pointers as
they were pointing to the stack and current was taken from the
'task' field of the thread_info.

Now, the pointers of 'current_set' table are now both pointers
to task_struct and pointers to thread_info.

As they are used to get current, and the stack pointer is
retrieved from current's stack field, this patch changes
their type to task_struct, and renames secondary_ti to
secondary_current.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/include/asm/asm-prototypes.h |  4 ++--
 arch/powerpc/kernel/head_32.S             |  6 +++---
 arch/powerpc/kernel/head_44x.S            |  4 ++--
 arch/powerpc/kernel/head_fsl_booke.S      |  4 ++--
 arch/powerpc/kernel/smp.c                 | 10 ++++------
 5 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
index 1d911f68a23b..1484df6779ab 100644
--- a/arch/powerpc/include/asm/asm-prototypes.h
+++ b/arch/powerpc/include/asm/asm-prototypes.h
@@ -23,8 +23,8 @@
 #include <uapi/asm/ucontext.h>
 
 /* SMP */
-extern struct thread_info *current_set[NR_CPUS];
-extern struct thread_info *secondary_ti;
+extern struct task_struct *current_set[NR_CPUS];
+extern struct task_struct *secondary_current;
 void start_secondary(void *unused);
 
 /* kexec */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 309a45779ad5..146385b1c2da 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -846,9 +846,9 @@ _ENTRY(copy_and_flush)
 #endif /* CONFIG_PPC_BOOK3S_32 */
 
 	/* get current's stack and current */
-	lis	r1,secondary_ti@ha
-	tophys(r1,r1)
-	lwz	r2,secondary_ti@l(r1)
+	lis	r2,secondary_current@ha
+	tophys(r2,r2)
+	lwz	r2,secondary_current@l(r2)
 	tophys(r1,r2)
 	lwz	r1,TASK_STACK(r1)
 
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index f94a93b6c2f2..37117ab11584 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -1020,8 +1020,8 @@ _GLOBAL(start_secondary_47x)
 	/* Now we can get our task struct and real stack pointer */
 
 	/* Get current's stack and current */
-	lis	r1,secondary_ti@ha
-	lwz	r2,secondary_ti@l(r1)
+	lis	r2,secondary_current@ha
+	lwz	r2,secondary_current@l(r2)
 	lwz	r1,TASK_STACK(r2)
 
 	/* Current stack pointer */
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 11f38adbe020..4ed2a7c8e89b 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -1091,8 +1091,8 @@ _GLOBAL(set_context)
 	bl	call_setup_cpu
 
 	/* get current's stack and current */
-	lis	r1,secondary_ti@ha
-	lwz	r2,secondary_ti@l(r1)
+	lis	r2,secondary_current@ha
+	lwz	r2,secondary_current@l(r2)
 	lwz	r1,TASK_STACK(r2)
 
 	/* stack */
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index aa4517686f90..a41fa8924004 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -76,7 +76,7 @@
 static DEFINE_PER_CPU(int, cpu_state) = { 0 };
 #endif
 
-struct thread_info *secondary_ti;
+struct task_struct *secondary_current;
 bool has_big_cores;
 
 DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map);
@@ -664,7 +664,7 @@ void smp_send_stop(void)
 }
 #endif /* CONFIG_NMI_IPI */
 
-struct thread_info *current_set[NR_CPUS];
+struct task_struct *current_set[NR_CPUS];
 
 static void smp_store_cpu_info(int id)
 {
@@ -929,7 +929,7 @@ void smp_prepare_boot_cpu(void)
 	paca_ptrs[boot_cpuid]->__current = current;
 #endif
 	set_numa_node(numa_cpu_lookup_table[boot_cpuid]);
-	current_set[boot_cpuid] = task_thread_info(current);
+	current_set[boot_cpuid] = current;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -1014,15 +1014,13 @@ static bool secondaries_inhibited(void)
 
 static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle)
 {
-	struct thread_info *ti = task_thread_info(idle);
-
 #ifdef CONFIG_PPC64
 	paca_ptrs[cpu]->__current = idle;
 	paca_ptrs[cpu]->kstack = (unsigned long)task_stack_page(idle) +
 				 THREAD_SIZE - STACK_FRAME_OVERHEAD;
 #endif
 	idle->cpu = cpu;
-	secondary_ti = current_set[cpu] = ti;
+	secondary_current = current_set[cpu] = idle;
 }
 
 int __cpu_up(unsigned int cpu, struct task_struct *tidle)
-- 
2.20.1


  parent reply	other threads:[~2019-02-05 12:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 11:31 [PATCH v16 00/21] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK Michael Ellerman
2019-02-05 11:31 ` [PATCH v16 01/21] powerpc/irq: use memblock functions returning virtual address Michael Ellerman
2019-02-07  3:54   ` Nicholas Piggin
2019-02-26  3:27   ` [v16, " Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 02/21] powerpc/32: Fix CONFIG_VIRT_CPU_ACCOUNTING_NATIVE for 40x/booke Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 03/21] powerpc: Avoid circular header inclusion in mmu-hash.h Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 04/21] powerpc: Only use task_struct 'cpu' field on SMP Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 05/21] powerpc: prep stack walkers for THREAD_INFO_IN_TASK Michael Ellerman
2019-02-07  4:05   ` Nicholas Piggin
2019-02-23 11:31   ` Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 06/21] powerpc: Rename THREAD_INFO to TASK_STACK Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 07/21] powerpc: call_do_[soft]irq() takes a pointer to the stack Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 08/21] powerpc: Don't use CURRENT_THREAD_INFO to find " Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 09/21] powerpc: Replace current_thread_info()->task with current Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 10/21] powerpc: Update comments in preparation for THREAD_INFO_IN_TASK Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 11/21] powerpc/64: Use task_stack_page() to initialise paca->kstack Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 12/21] powerpc: Use sizeof(struct thread_info) in INIT_SP_LIMIT Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 13/21] powerpc: Use linux/thread_info.h in processor.h Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 14/21] powerpc: Use task_stack_page() in current_pt_regs() Michael Ellerman
2019-02-07  4:13   ` Nicholas Piggin
2019-02-05 11:32 ` [PATCH v16 15/21] powerpc/idle/6xx: Use r1 with CURRENT_THREAD_INFO() Michael Ellerman
2019-02-05 11:32 ` [PATCH v16 16/21] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK Michael Ellerman
2019-02-07  4:44   ` Nicholas Piggin
2019-02-07  4:53   ` Nicholas Piggin
2019-02-07  6:07     ` Christophe Leroy
2019-02-05 11:32 ` [PATCH v16 17/21] powerpc: regain entire stack space Michael Ellerman
2019-02-05 11:32 ` Michael Ellerman [this message]
2019-02-05 11:32 ` [PATCH v16 19/21] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU Michael Ellerman
2019-02-07  0:10   ` Michael Ellerman
2019-02-07  4:27   ` Nicholas Piggin
2019-02-07  4:41     ` Nicholas Piggin
2019-02-05 11:32 ` [PATCH v16 20/21] powerpc/64: Replace CURRENT_THREAD_INFO with PACA_CURRENT_TI Michael Ellerman
2019-02-07  4:24   ` Nicholas Piggin
2019-02-05 11:32 ` [PATCH v16 21/21] powerpc: clean stack pointers naming Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190205113219.17903-19-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.