]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64/interrupt: Reconcile soft-mask state in NMI and fix false BUG
authorNicholas Piggin <npiggin@gmail.com>
Mon, 4 Oct 2021 14:56:41 +0000 (00:56 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 7 Oct 2021 08:54:55 +0000 (19:54 +1100)
commit4f50495d736ed8b8eceda70224af3d146440efe0
treef2c12ed1c9e28d67818d167fd6fe6e010b0c6043
parent7ad4b29baaa7ccc1b0732d1bfba60f5f7a75f699
powerpc/64/interrupt: Reconcile soft-mask state in NMI and fix false BUG

If a NMI hits early in an interrupt handler before the irq soft-mask
state is reconciled, that can cause a false-positive BUG with a
CONFIG_PPC_IRQ_SOFT_MASK_DEBUG assertion.

Remove that assertion and instead check the case that if regs->msr has
EE clear, then regs->softe should be marked as disabled so the irq state
looks correct to NMI handlers, the same as how it's fixed up in the
case it was implicit soft-masked.

This doesn't fix a known problem -- the change that was fixed by commit
43225c098156a ("powerpc/64s: Make NMI record implicitly soft-masked code
as irqs disabled") was the addition of a warning in the soft-nmi
watchdog interrupt which can never actually fire when MSR[EE]=0. However
it may be important if NMI handlers grow more code, and it's less
surprising to anything using 'regs' - (I tripped over this when working
in the area).

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