powerpc/book3e: initialize crit/mc/dbg kernel stack pointers
authorTiejun Chen <tiejun.chen@windriver.com>
Wed, 23 Oct 2013 09:31:21 +0000 (17:31 +0800)
committerScott Wood <scottwood@freescale.com>
Thu, 20 Mar 2014 00:57:09 +0000 (19:57 -0500)
We already allocated critical/machine/debug check exceptions, but
we also should initialize those associated kernel stack pointers
for use by special exceptions in the PACA.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
arch/powerpc/kernel/setup_64.c

index f5f11a7d30e5502637d58656b7c587b37001ea81..da9c42f53bb137107bcaa243e01a183e30d0642a 100644 (file)
@@ -552,14 +552,20 @@ static void __init irqstack_early_init(void)
 static void __init exc_lvl_early_init(void)
 {
        unsigned int i;
+       unsigned long sp;
 
        for_each_possible_cpu(i) {
-               critirq_ctx[i] = (struct thread_info *)
-                       __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
-               dbgirq_ctx[i] = (struct thread_info *)
-                       __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
-               mcheckirq_ctx[i] = (struct thread_info *)
-                       __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+               sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
+               critirq_ctx[i] = (struct thread_info *)__va(sp);
+               paca[i].crit_kstack = __va(sp + THREAD_SIZE);
+
+               sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
+               dbgirq_ctx[i] = (struct thread_info *)__va(sp);
+               paca[i].dbg_kstack = __va(sp + THREAD_SIZE);
+
+               sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
+               mcheckirq_ctx[i] = (struct thread_info *)__va(sp);
+               paca[i].mc_kstack = __va(sp + THREAD_SIZE);
        }
 
        if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC))