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/paca.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/paca.c')
-rw-r--r-- | arch/powerpc/kernel/paca.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 5d1b708086bd..f505a8827e3e 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
@@ -56,14 +56,11 @@ struct lppaca lppaca[] = { | |||
56 | * processors. The processor VPD array needs one entry per physical | 56 | * processors. The processor VPD array needs one entry per physical |
57 | * processor (not thread). | 57 | * processor (not thread). |
58 | */ | 58 | */ |
59 | #define PACA_INIT_COMMON(number, start, asrr, asrv) \ | 59 | #define PACA_INIT_COMMON(number) \ |
60 | .lppaca_ptr = &lppaca[number], \ | 60 | .lppaca_ptr = &lppaca[number], \ |
61 | .lock_token = 0x8000, \ | 61 | .lock_token = 0x8000, \ |
62 | .paca_index = (number), /* Paca Index */ \ | 62 | .paca_index = (number), /* Paca Index */ \ |
63 | .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ | 63 | .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ |
64 | .stab_real = (asrr), /* Real pointer to segment table */ \ | ||
65 | .stab_addr = (asrv), /* Virt pointer to segment table */ \ | ||
66 | .cpu_start = (start), /* Processor start */ \ | ||
67 | .hw_cpu_id = 0xffff, | 64 | .hw_cpu_id = 0xffff, |
68 | 65 | ||
69 | #ifdef CONFIG_PPC_ISERIES | 66 | #ifdef CONFIG_PPC_ISERIES |
@@ -72,30 +69,20 @@ struct lppaca lppaca[] = { | |||
72 | 69 | ||
73 | #define PACA_INIT(number) \ | 70 | #define PACA_INIT(number) \ |
74 | { \ | 71 | { \ |
75 | PACA_INIT_COMMON(number, 0, 0, 0) \ | 72 | PACA_INIT_COMMON(number) \ |
76 | PACA_INIT_ISERIES(number) \ | ||
77 | } | ||
78 | |||
79 | #define BOOTCPU_PACA_INIT(number) \ | ||
80 | { \ | ||
81 | PACA_INIT_COMMON(number, 1, 0, (u64)&initial_stab) \ | ||
82 | PACA_INIT_ISERIES(number) \ | 73 | PACA_INIT_ISERIES(number) \ |
83 | } | 74 | } |
84 | 75 | ||
85 | #else | 76 | #else |
86 | #define PACA_INIT(number) \ | 77 | #define PACA_INIT(number) \ |
87 | { \ | 78 | { \ |
88 | PACA_INIT_COMMON(number, 0, 0, 0) \ | 79 | PACA_INIT_COMMON(number) \ |
89 | } | 80 | } |
90 | 81 | ||
91 | #define BOOTCPU_PACA_INIT(number) \ | ||
92 | { \ | ||
93 | PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, (u64)&initial_stab) \ | ||
94 | } | ||
95 | #endif | 82 | #endif |
96 | 83 | ||
97 | struct paca_struct paca[] = { | 84 | struct paca_struct paca[] = { |
98 | BOOTCPU_PACA_INIT(0), | 85 | PACA_INIT(0), |
99 | #if NR_CPUS > 1 | 86 | #if NR_CPUS > 1 |
100 | PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3), | 87 | PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3), |
101 | #if NR_CPUS > 4 | 88 | #if NR_CPUS > 4 |