Skip to content

Commit 2b43dd7

Browse files
npigginmpe
authored andcommitted
powerpc/64: enable MSR[EE] in irq replay pt_regs
Similar to commit 2b48e96 ("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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1b04822 commit 2b43dd7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arch/powerpc/include/asm/interrupt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
173173
BUG_ON(search_kernel_restart_table(regs->nip));
174174
#endif
175175
}
176+
if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
177+
BUG_ON(!arch_irq_disabled_regs(regs) && !(regs->msr & MSR_EE));
176178
#endif
177179

178180
booke_restore_dbcr0();
@@ -268,6 +270,8 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
268270
// arch_irq_disabled_regs(regs) behaves as expected.
269271
regs->softe = IRQS_ALL_DISABLED;
270272
}
273+
if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
274+
BUG_ON(!arch_irq_disabled_regs(regs) && !(regs->msr & MSR_EE));
271275

272276
/* Don't do any per-CPU operations until interrupt state is fixed */
273277

arch/powerpc/kernel/irq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ void replay_soft_interrupts(void)
121121

122122
ppc_save_regs(&regs);
123123
regs.softe = IRQS_ENABLED;
124+
regs.msr |= MSR_EE;
124125

125126
again:
126127
if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))

0 commit comments

Comments
 (0)