Skip to content

Commit 1b04822

Browse files
npigginmpe
authored andcommitted
powerpc/64s/interrupt: preserve regs->softe for NMI interrupts
If an NMI interrupt hits in an implicit soft-masked region, regs->softe is modified to reflect that. This may not be necessary for correctness at the moment, but it is less surprising and it's unhelpful when debugging or adding checks. Make sure this is changed back to how it was found before returning. Fixes: 4ec5fee ("powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled") Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 325678f commit 1b04822

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/powerpc/include/asm/interrupt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ struct interrupt_nmi_state {
227227
u8 irq_soft_mask;
228228
u8 irq_happened;
229229
u8 ftrace_enabled;
230+
u64 softe;
230231
#endif
231232
};
232233

@@ -252,6 +253,7 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
252253
#ifdef CONFIG_PPC64
253254
state->irq_soft_mask = local_paca->irq_soft_mask;
254255
state->irq_happened = local_paca->irq_happened;
256+
state->softe = regs->softe;
255257

256258
/*
257259
* Set IRQS_ALL_DISABLED unconditionally so irqs_disabled() does
@@ -311,6 +313,7 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
311313

312314
/* Check we didn't change the pending interrupt mask. */
313315
WARN_ON_ONCE((state->irq_happened | PACA_IRQ_HARD_DIS) != local_paca->irq_happened);
316+
regs->softe = state->softe;
314317
local_paca->irq_happened = state->irq_happened;
315318
local_paca->irq_soft_mask = state->irq_soft_mask;
316319
#endif

0 commit comments

Comments
 (0)