Skip to content

Commit acb1fea

Browse files
npigginmpe
authored andcommitted
powerpc/64: Don't trace irqs-off at interrupt return to soft-disabled context
When an interrupt is returning to a soft-disabled context (which can happen for non-maskable interrupts or synchronous interrupts), it goes through the motions of soft-disabling again, including calling TRACE_DISABLE_INTS (i.e., trace_hardirqs_off()). This is not necessary, because we must already be soft-disabled in the interrupt context, it also may be causing crashes in the irq tracing code to re-enter as an nmi. Replace it with a warning to ensure that soft-interrupts are still disabled. Fixes: 7c0482e ("powerpc/irq: Fix another case of lazy IRQ state getting out of sync") Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 7813043 commit acb1fea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arch/powerpc/kernel/entry_64.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
911911
beq 1f
912912
rlwinm r7,r7,0,~PACA_IRQ_HARD_DIS
913913
stb r7,PACAIRQHAPPENED(r13)
914-
1: li r0,0
915-
stb r0,PACASOFTIRQEN(r13);
916-
TRACE_DISABLE_INTS
914+
1:
915+
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_BUG)
916+
/* The interrupt should not have soft enabled. */
917+
lbz r7,PACASOFTIRQEN(r13)
918+
1: tdnei r7,0
919+
EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,BUGFLAG_WARNING
920+
#endif
917921
b .Ldo_restore
918922

919923
/*

0 commit comments

Comments
 (0)