diff options
author | Kevin Hao <haokexin@gmail.com> | 2014-01-29 05:24:54 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-02-10 19:24:52 -0500 |
commit | 04a341138da55daf47551308660a5fcc6b5b9077 (patch) | |
tree | 978ef5b7e571284ed25a263354a7ee41de089e60 /arch/powerpc/kernel | |
parent | d2b496e5e1fa7a6796534e435440eb9d3ed184dd (diff) |
powerpc/ppc32: Fix the bug in the init of non-base exception stack for UP
We would allocate one specific exception stack for each kind of
non-base exceptions for every CPU. For ppc32 the CPU hard ID is
used as the subscript to get the specific exception stack for
one CPU. But for an UP kernel, there is only one element in the
each kind of exception stack array. We would get stuck if the
CPU hard ID is not equal to '0'. So in this case we should use the
subscript '0' no matter what the CPU hard ID is.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_32.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 9729b23bfb0a..1d0848bba049 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -559,8 +559,13 @@ void exc_lvl_ctx_init(void) | |||
559 | #ifdef CONFIG_PPC64 | 559 | #ifdef CONFIG_PPC64 |
560 | cpu_nr = i; | 560 | cpu_nr = i; |
561 | #else | 561 | #else |
562 | #ifdef CONFIG_SMP | ||
562 | cpu_nr = get_hard_smp_processor_id(i); | 563 | cpu_nr = get_hard_smp_processor_id(i); |
564 | #else | ||
565 | cpu_nr = 0; | ||
563 | #endif | 566 | #endif |
567 | #endif | ||
568 | |||
564 | memset((void *)critirq_ctx[cpu_nr], 0, THREAD_SIZE); | 569 | memset((void *)critirq_ctx[cpu_nr], 0, THREAD_SIZE); |
565 | tp = critirq_ctx[cpu_nr]; | 570 | tp = critirq_ctx[cpu_nr]; |
566 | tp->cpu = cpu_nr; | 571 | tp->cpu = cpu_nr; |
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 2b0da27eaee4..04cc4fcca78b 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -247,7 +247,12 @@ static void __init exc_lvl_early_init(void) | |||
247 | /* interrupt stacks must be in lowmem, we get that for free on ppc32 | 247 | /* interrupt stacks must be in lowmem, we get that for free on ppc32 |
248 | * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */ | 248 | * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */ |
249 | for_each_possible_cpu(i) { | 249 | for_each_possible_cpu(i) { |
250 | #ifdef CONFIG_SMP | ||
250 | hw_cpu = get_hard_smp_processor_id(i); | 251 | hw_cpu = get_hard_smp_processor_id(i); |
252 | #else | ||
253 | hw_cpu = 0; | ||
254 | #endif | ||
255 | |||
251 | critirq_ctx[hw_cpu] = (struct thread_info *) | 256 | critirq_ctx[hw_cpu] = (struct thread_info *) |
252 | __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); | 257 | __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); |
253 | #ifdef CONFIG_BOOKE | 258 | #ifdef CONFIG_BOOKE |