diff options
author | Matt Evans <matt@ozlabs.org> | 2010-06-07 17:38:18 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-06-15 01:02:33 -0400 |
commit | b636f1379eefe6eba931deaa386605bc7ac623e7 (patch) | |
tree | 482289c45853b5f86f264dd8f98b0f70c94fa4d5 /arch/powerpc | |
parent | 65cf840ff4b63852d34d577d559978ccfc554a6c (diff) |
powerpc/kexec: Wait for online/possible CPUs only.
kexec_perpare_cpus_wait() iterates i through NR_CPUS to check
paca[i].kexec_state of each to make sure they have quiesced.
However now we have dynamic PACA allocation, paca[NR_CPUS] is not necessarily
valid and we overrun the array; spurious "cpu is not possible, ignoring"
errors result. This patch iterates for_each_online_cpu so stays
within the bounds of paca[] -- and every CPU is now 'possible'.
Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/machine_kexec_64.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index 26f9900f773c..ed31a29c4ff7 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -182,28 +182,12 @@ static void kexec_prepare_cpus_wait(int wait_state) | |||
182 | 182 | ||
183 | my_cpu = get_cpu(); | 183 | my_cpu = get_cpu(); |
184 | /* Make sure each CPU has atleast made it to the state we need */ | 184 | /* Make sure each CPU has atleast made it to the state we need */ |
185 | for (i=0; i < NR_CPUS; i++) { | 185 | for_each_online_cpu(i) { |
186 | if (i == my_cpu) | 186 | if (i == my_cpu) |
187 | continue; | 187 | continue; |
188 | 188 | ||
189 | while (paca[i].kexec_state < wait_state) { | 189 | while (paca[i].kexec_state < wait_state) { |
190 | barrier(); | 190 | barrier(); |
191 | if (!cpu_possible(i)) { | ||
192 | printk("kexec: cpu %d hw_cpu_id %d is not" | ||
193 | " possible, ignoring\n", | ||
194 | i, paca[i].hw_cpu_id); | ||
195 | break; | ||
196 | } | ||
197 | if (!cpu_online(i)) { | ||
198 | /* Fixme: this can be spinning in | ||
199 | * pSeries_secondary_wait with a paca | ||
200 | * waiting for it to go online. | ||
201 | */ | ||
202 | printk("kexec: cpu %d hw_cpu_id %d is not" | ||
203 | " online, ignoring\n", | ||
204 | i, paca[i].hw_cpu_id); | ||
205 | break; | ||
206 | } | ||
207 | if (i != notified) { | 191 | if (i != notified) { |
208 | printk( "kexec: waiting for cpu %d (physical" | 192 | printk( "kexec: waiting for cpu %d (physical" |
209 | " %d) to enter %i state\n", | 193 | " %d) to enter %i state\n", |