]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Fix may_hard_irq_enable() for PMI soft masking
authorNicholas Piggin <npiggin@gmail.com>
Sat, 3 Feb 2018 07:17:50 +0000 (17:17 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 8 Feb 2018 12:56:10 +0000 (23:56 +1100)
commit2cb427e4128982e7018ba5efe3062e54edd518e2
tree05bbb665ea70b6ddec598b1c3dd53aa139c1f911
parentaaa27f6a116e0aeadc2b3f61ef8e19c0bbeca83c
powerpc/64s: Fix may_hard_irq_enable() for PMI soft masking

The soft IRQ masking code has to hard-disable interrupts in cases
where the exception is not cleared by the masked handler. External
interrupts used this approach for soft masking. Now recently PMU
interrupts do the same thing.

The soft IRQ masking code additionally allowed for interrupt handlers
to hard-enable interrupts after soft-disabling them. The idea is to
allow PMU interrupts through to profile interrupt handlers.

So when interrupts are being replayed when there is a pending
interrupt that requires hard-disabling, there is a test to prevent
those handlers from hard-enabling them if there is a pending external
interrupt. may_hard_irq_enable() handles this.

After ef0d1fc33f ("powerpc/64s: Add support to mask perf interrupts
and replay them"), may_hard_irq_enable() could prematurely enable
MSR[EE] when a PMU exception exists, which would result in the
interrupt firing again while masked, and MSR[EE] being disabled again.

I haven't seen that this could cause a serious problem, but it's
more consistent to handle these soft-masked interrupts in the same
way. So introduce a define for all types of interrupts that require
MSR[EE] masking in their soft-disable handlers, and use that in
may_hard_irq_enable().

Fixes: ef0d1fc33f31 ("powerpc/64s: Add support to mask perf interrupts and replay them")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/hw_irq.h
arch/powerpc/kernel/exceptions-64e.S
arch/powerpc/kernel/exceptions-64s.S