From: James Hogan Subject: [PATCH 1/2] metag: SMP: Fix 4KiB stack setup on secondary CPUs Date: Thu, 29 Oct 2015 23:19:40 +0000 Message-ID: <1446160781-12548-2-git-send-email-james.hogan@imgtec.com> References: <1446160781-12548-1-git-send-email-james.hogan@imgtec.com> Mime-Version: 1.0 Return-path: In-Reply-To: <1446160781-12548-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org> Sender: linux-metag-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: James Hogan Back in early 2008, 4KiB stack support was added to reduce memory consumption on workloads with lots of threads, using a separate IRQ stack per CPU to alleviate stack pressure. However the SMP code added a year and a half later didn't set up the IRQ stack when bringing up secondary CPUs, resulting in a crash when SMP is configured with 4KiB stacks, as soon as the first interrupt arrived on a secondary CPU. Fix with calls to irq_ctx_exit()/irq_ctx_exit() when bringing up/down a CPU. Signed-off-by: James Hogan Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --- arch/metag/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c index ac3a199e33e7..c3c6f0864881 100644 --- a/arch/metag/kernel/smp.c +++ b/arch/metag/kernel/smp.c @@ -312,6 +312,7 @@ void cpu_die(void) { local_irq_disable(); idle_task_exit(); + irq_ctx_exit(smp_processor_id()); (void)cpu_report_death(); @@ -366,6 +367,7 @@ asmlinkage void secondary_start_kernel(void) panic("No TBI found!"); per_cpu_trap_init(cpu); + irq_ctx_init(cpu); preempt_disable(); -- 2.4.10