diff options
author | Anton Blanchard <anton@samba.org> | 2006-03-25 01:25:17 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-26 22:48:48 -0500 |
commit | 4df20460a3ff0d60280738b094945c56cb5567a5 (patch) | |
tree | 39f831cf5f778b14a08b3453a8f798b2b8be8813 /arch/powerpc/kernel/setup_64.c | |
parent | b4f382a3e5e20ba867e7aa5b01189a3fd40eea2c (diff) |
[PATCH] powerpc: Allow non zero boot cpuids
We currently have a hack to flip the boot cpu and its secondary thread
to logical cpuid 0 and 1. This means the logical - physical mapping will
differ depending on which cpu is boot cpu. This is most apparent on
kexec, where we might kexec on any cpu and therefore change the mapping
from boot to boot.
The patch below does a first pass early on to work out the logical cpuid
of the boot thread. We then fix up some paca structures to match.
Ive also removed the boot_cpuid_phys variable for ppc64, to be
consistent we use get_hard_smp_processor_id(boot_cpuid) everywhere.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 2f3fdad35594..6c9b093c23a5 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -73,7 +73,6 @@ | |||
73 | 73 | ||
74 | int have_of = 1; | 74 | int have_of = 1; |
75 | int boot_cpuid = 0; | 75 | int boot_cpuid = 0; |
76 | int boot_cpuid_phys = 0; | ||
77 | dev_t boot_dev; | 76 | dev_t boot_dev; |
78 | u64 ppc64_pft_size; | 77 | u64 ppc64_pft_size; |
79 | 78 | ||
@@ -208,7 +207,6 @@ static struct machdep_calls __initdata *machines[] = { | |||
208 | 207 | ||
209 | void __init early_setup(unsigned long dt_ptr) | 208 | void __init early_setup(unsigned long dt_ptr) |
210 | { | 209 | { |
211 | struct paca_struct *lpaca = get_paca(); | ||
212 | static struct machdep_calls **mach; | 210 | static struct machdep_calls **mach; |
213 | 211 | ||
214 | /* Enable early debugging if any specified (see udbg.h) */ | 212 | /* Enable early debugging if any specified (see udbg.h) */ |
@@ -223,6 +221,14 @@ void __init early_setup(unsigned long dt_ptr) | |||
223 | */ | 221 | */ |
224 | early_init_devtree(__va(dt_ptr)); | 222 | early_init_devtree(__va(dt_ptr)); |
225 | 223 | ||
224 | /* Now we know the logical id of our boot cpu, setup the paca. */ | ||
225 | setup_boot_paca(); | ||
226 | |||
227 | /* Fix up paca fields required for the boot cpu */ | ||
228 | get_paca()->cpu_start = 1; | ||
229 | get_paca()->stab_real = __pa((u64)&initial_stab); | ||
230 | get_paca()->stab_addr = (u64)&initial_stab; | ||
231 | |||
226 | /* | 232 | /* |
227 | * Iterate all ppc_md structures until we find the proper | 233 | * Iterate all ppc_md structures until we find the proper |
228 | * one for the current machine type | 234 | * one for the current machine type |
@@ -260,7 +266,7 @@ void __init early_setup(unsigned long dt_ptr) | |||
260 | if (cpu_has_feature(CPU_FTR_SLB)) | 266 | if (cpu_has_feature(CPU_FTR_SLB)) |
261 | slb_initialize(); | 267 | slb_initialize(); |
262 | else | 268 | else |
263 | stab_initialize(lpaca->stab_real); | 269 | stab_initialize(get_paca()->stab_real); |
264 | } | 270 | } |
265 | 271 | ||
266 | DBG(" <- early_setup()\n"); | 272 | DBG(" <- early_setup()\n"); |