linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, Arnd Bergmann <arnd.bergmann@de.ibm.com>
Subject: [PATCH] Assume we're on cpu 0 in early boot
Date: Tue, 27 Jun 2006 14:00:37 +1000	[thread overview]
Message-ID: <20060627040036.469B767B28@ozlabs.org> (raw)
In-Reply-To: <787248AD-2E47-454E-9F56-7E5350A9F184@watson.ibm.com>

There's a small period early in boot where we don't know which cpu we're
running on. That's ok, except that it means we have no paca, or more
correctly that our paca pointer points somewhere random.

So that we can safely call things like smp_processor_id(), we need a paca,
so just assume we're on cpu 0. No code should _write_ to the paca before
we've set the correct one up.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/head_64.S |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Index: to-merge/arch/powerpc/kernel/head_64.S
===================================================================
--- to-merge.orig/arch/powerpc/kernel/head_64.S
+++ to-merge/arch/powerpc/kernel/head_64.S
@@ -1583,9 +1583,6 @@ _GLOBAL(__start_initialization_multiplat
 	/* Setup some critical 970 SPRs before switching MMU off */
 	bl	.__970_cpu_preinit
 
-	/* cpu # */
-	li	r24,0
-
 	/* Switch off MMU if not already */
 	LOAD_REG_IMMEDIATE(r4, .__after_prom_start - KERNELBASE)
 	add	r4,r4,r30
@@ -1908,6 +1905,13 @@ _STATIC(start_here_multiplatform)
 	bl	.__save_cpu_setup
 	sync
 
+	/* Assume we're on cpu 0 for now, we don't actually know yet.
+	 * The early setup code should not write to any paca fields until
+	 * after we've setup the correct paca. See early_setup() */
+	li	r24,0
+	li	r3,0
+	bl	.setup_paca
+
 	/* Do very early kernel initializations, including initial hash table,
 	 * stab and slb setup before we turn on relocation.	*/
 

  reply	other threads:[~2006-06-27  4:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23  8:20 [PATCH 2/8] Assume we're on cpu 0 in early boot Michael Ellerman
2006-06-23 10:03 ` Jimi Xenidis
2006-06-27  4:00   ` Michael Ellerman [this message]
2006-06-28  1:42     ` [PATCH] " Paul Mackerras
2006-06-28  2:11       ` Michael Ellerman
2006-06-28  3:18       ` 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=20060627040036.469B767B28@ozlabs.org \
    --to=michael@ellerman.id.au \
    --cc=arnd.bergmann@de.ibm.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;
as well as URLs for NNTP newsgroup(s).