powerpc/fsl_booke: ensure SPEFloatingPointException() reenables interrupts
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 30 Apr 2019 12:38:57 +0000 (12:38 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 2 May 2019 15:20:27 +0000 (01:20 +1000)
SPEFloatingPointException() is the only exception handler which 'forgets' to
re-enable interrupts. This patch makes sure it does.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/traps.c

index 1fd45a8650e1762f6f6e736fc8fc8ba6ee6f3101..665f294725cb281bd8edc97a30cf82abac08bd64 100644 (file)
@@ -2088,6 +2088,10 @@ void SPEFloatingPointException(struct pt_regs *regs)
        int code = FPE_FLTUNK;
        int err;
 
+       /* We restore the interrupt state now */
+       if (!arch_irq_disabled_regs(regs))
+               local_irq_enable();
+
        flush_spe_to_thread(current);
 
        spefscr = current->thread.spefscr;
@@ -2133,6 +2137,10 @@ void SPEFloatingPointRoundException(struct pt_regs *regs)
        extern int speround_handler(struct pt_regs *regs);
        int err;
 
+       /* We restore the interrupt state now */
+       if (!arch_irq_disabled_regs(regs))
+               local_irq_enable();
+
        preempt_disable();
        if (regs->msr & MSR_SPE)
                giveup_spe(current);