From 33dbcf72f607f5da791402e161feaf1ccf5d5be4 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 28 Jun 2006 13:18:53 +1000 Subject: [POWERPC] Make sure smp_processor_id works very early in boot 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. We setup the proper paca after we've scanned the flat device tree in early_setup(), so there's no need to do it again in start_here_common. Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/setup_64.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/powerpc/kernel/setup_64.c') diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index a2fb2e627aad..175539c9afa0 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -177,6 +177,9 @@ void __init setup_paca(int cpu) void __init early_setup(unsigned long dt_ptr) { + /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ + setup_paca(0); + /* Enable early debugging if any specified (see udbg.h) */ udbg_early_init(); -- cgit v1.2.3-59-g8ed1b