powerpc/64: enable MSR[EE] in irq replay pt_regs
authorNicholas Piggin <npiggin@gmail.com>
Wed, 30 Jun 2021 07:46:18 +0000 (17:46 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 30 Jun 2021 12:21:20 +0000 (22:21 +1000)
Similar to commit 2b48e96be2f9f ("powerpc/64: fix irq replay
pt_regs->softe value"), enable MSR_EE in pt_regs->msr. This makes the
regs look more normal. It also allows some extra debug checks to be
added to interrupt handler entry.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210630074621.2109197-7-npiggin@gmail.com
arch/powerpc/include/asm/interrupt.h
arch/powerpc/kernel/irq.c

index 789311d1e283208235738b997e72c25c939e3fe0..d4bdf7d274ac1492e703370ad20b64c6ce7a8a2d 100644 (file)
@@ -173,6 +173,8 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
                        BUG_ON(search_kernel_restart_table(regs->nip));
 #endif
        }
+       if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
+               BUG_ON(!arch_irq_disabled_regs(regs) && !(regs->msr & MSR_EE));
 #endif
 
        booke_restore_dbcr0();
@@ -268,6 +270,8 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
                // arch_irq_disabled_regs(regs) behaves as expected.
                regs->softe = IRQS_ALL_DISABLED;
        }
+       if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
+               BUG_ON(!arch_irq_disabled_regs(regs) && !(regs->msr & MSR_EE));
 
        /* Don't do any per-CPU operations until interrupt state is fixed */
 
index 8428caf3194e5d8d30b0f8c1d1aee32a1954be13..91e63eac4e8fac47e6cf6cad85e93c9a53d016d6 100644 (file)
@@ -121,6 +121,7 @@ void replay_soft_interrupts(void)
 
        ppc_save_regs(&regs);
        regs.softe = IRQS_ENABLED;
+       regs.msr |= MSR_EE;
 
 again:
        if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))