Commit 3e7f45ad authored by Dave Kleikamp's avatar Dave Kleikamp Committed by Josh Boyer

powerpc/4xx: Index interrupt stacks by physical cpu

The interrupt stacks need to be indexed by the physical cpu since the
critical, debug and machine check handlers use the contents of SPRN_PIR to
index the critirq_ctx, dbgirq_ctx, and mcheckirq_ctx arrays.
Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
parent 66477466
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/udbg.h> #include <asm/udbg.h>
#include <asm/dbell.h> #include <asm/dbell.h>
#include <asm/smp.h>
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
#include <asm/paca.h> #include <asm/paca.h>
...@@ -446,22 +447,23 @@ struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly; ...@@ -446,22 +447,23 @@ struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
void exc_lvl_ctx_init(void) void exc_lvl_ctx_init(void)
{ {
struct thread_info *tp; struct thread_info *tp;
int i; int i, hw_cpu;
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
memset((void *)critirq_ctx[i], 0, THREAD_SIZE); hw_cpu = get_hard_smp_processor_id(i);
tp = critirq_ctx[i]; memset((void *)critirq_ctx[hw_cpu], 0, THREAD_SIZE);
tp = critirq_ctx[hw_cpu];
tp->cpu = i; tp->cpu = i;
tp->preempt_count = 0; tp->preempt_count = 0;
#ifdef CONFIG_BOOKE #ifdef CONFIG_BOOKE
memset((void *)dbgirq_ctx[i], 0, THREAD_SIZE); memset((void *)dbgirq_ctx[hw_cpu], 0, THREAD_SIZE);
tp = dbgirq_ctx[i]; tp = dbgirq_ctx[hw_cpu];
tp->cpu = i; tp->cpu = i;
tp->preempt_count = 0; tp->preempt_count = 0;
memset((void *)mcheckirq_ctx[i], 0, THREAD_SIZE); memset((void *)mcheckirq_ctx[hw_cpu], 0, THREAD_SIZE);
tp = mcheckirq_ctx[i]; tp = mcheckirq_ctx[hw_cpu];
tp->cpu = i; tp->cpu = i;
tp->preempt_count = HARDIRQ_OFFSET; tp->preempt_count = HARDIRQ_OFFSET;
#endif #endif
......
...@@ -258,17 +258,18 @@ static void __init irqstack_early_init(void) ...@@ -258,17 +258,18 @@ static void __init irqstack_early_init(void)
#if defined(CONFIG_BOOKE) || defined(CONFIG_40x) #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
static void __init exc_lvl_early_init(void) static void __init exc_lvl_early_init(void)
{ {
unsigned int i; unsigned int i, hw_cpu;
/* interrupt stacks must be in lowmem, we get that for free on ppc32 /* interrupt stacks must be in lowmem, we get that for free on ppc32
* as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */ * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
critirq_ctx[i] = (struct thread_info *) hw_cpu = get_hard_smp_processor_id(i);
critirq_ctx[hw_cpu] = (struct thread_info *)
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
#ifdef CONFIG_BOOKE #ifdef CONFIG_BOOKE
dbgirq_ctx[i] = (struct thread_info *) dbgirq_ctx[hw_cpu] = (struct thread_info *)
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
mcheckirq_ctx[i] = (struct thread_info *) mcheckirq_ctx[hw_cpu] = (struct thread_info *)
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment