OSDN Git Service

MIPS: Switch to the irq_stack in interrupts
authorMatt Redfearn <matt.redfearn@imgtec.com>
Mon, 19 Dec 2016 14:20:59 +0000 (14:20 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 3 Jan 2017 15:34:34 +0000 (16:34 +0100)
commitdda45f701c9d7ad4ac0bb446e3a96f6df9a468d9
tree818b1a02bbd1fb07f399053935d5bd51f0ec701c
parent510d86362a27577f5ee23f46cfb354ad49731e61
MIPS: Switch to the irq_stack in interrupts

When enterring interrupt context via handle_int or except_vec_vi, switch
to the irq_stack of the current CPU if it is not already in use.

The current stack pointer is masked with the thread size and compared to
the base or the irq stack. If it does not match then the stack pointer
is set to the top of that stack, otherwise this is a nested irq being
handled on the irq stack so the stack pointer should be left as it was.

The in-use stack pointer is placed in the callee saved register s1. It
will be saved to the stack when plat_irq_dispatch is invoked and can be
restored once control returns here.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Acked-by: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14743/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/genex.S