LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: paulus@samba.org,
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] ppc32: remove secondary_ti
Date: Sun, 16 Nov 2008 15:43:45 -0600	[thread overview]
Message-ID: <31226871825643c98694.1714636915.miltonm@bga.com> (raw)

Instead of copying current_set[cpu] to secondary_ti, directly index into
current_set by the cpu number like head_64.S.  In addition to removing
the variable, a slow to respond cpu will not clobber another cpus
stack.

---
grep found no other reference in arch/powerpc.   compile tested but I have
no 32bit smp hardware.

Index: next.git/arch/powerpc/kernel/head_32.S
===================================================================
--- next.git.orig/arch/powerpc/kernel/head_32.S	2008-11-16 01:36:45.000000000 -0600
+++ next.git/arch/powerpc/kernel/head_32.S	2008-11-16 01:42:02.000000000 -0600
@@ -906,10 +906,11 @@ __secondary_start:
 	bl	init_idle_6xx
 #endif /* CONFIG_6xx */
 
-	/* get current_thread_info and current */
-	lis	r1,secondary_ti@ha
+	/* get current_thread_info (current_set[cpu]) and current =  */
+	slwi	r1,r24,2
+	addis	r1,r1,current_set@ha
 	tophys(r1,r1)
-	lwz	r1,secondary_ti@l(r1)
+	lwz	r1,current_set@l(r1)
 	tophys(r2,r1)
 	lwz	r2,TI_TASK(r2)
 
Index: next.git/arch/powerpc/kernel/smp.c
===================================================================
--- next.git.orig/arch/powerpc/kernel/smp.c	2008-11-16 01:36:05.000000000 -0600
+++ next.git/arch/powerpc/kernel/smp.c	2008-11-16 01:36:22.000000000 -0600
@@ -58,7 +58,6 @@
 #endif
 
 int smp_hw_index[NR_CPUS];
-struct thread_info *secondary_ti;
 
 cpumask_t cpu_possible_map = CPU_MASK_NONE;
 cpumask_t cpu_online_map = CPU_MASK_NONE;
@@ -320,7 +319,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
 {
 	int c;
 
-	secondary_ti = current_set[cpu];
 	if (!cpu_enable(cpu))
 		return 0;
 

             reply	other threads:[~2008-11-16 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 21:43 Milton Miller [this message]
2008-11-16 20:26 ` [PATCH] ppc32: remove secondary_ti Benjamin Herrenschmidt
2008-11-17  7:46   ` Milton Miller

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=31226871825643c98694.1714636915.miltonm@bga.com \
    --to=miltonm@bga.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox