powerpc/64s: interrupt exit improve bounding of interrupt recursion
authorNicholas Piggin <npiggin@gmail.com>
Sat, 30 Jan 2021 13:08:11 +0000 (23:08 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Feb 2021 13:02:07 +0000 (00:02 +1100)
commitc0ef717305f51e29b5ce0c78a6bfe566b3283415
treeace3b74a551d4a9bd94686d86c812bde96716e83
parentc144bc719234500e292c0545de99822bd8a78a6b
powerpc/64s: interrupt exit improve bounding of interrupt recursion

When replaying pending soft-masked interrupts when an interrupt returns
to an irqs-enabled context, there is a special case required if this was
an asynchronous interrupt to avoid unbounded interrupt recursion.

This case was not tested for in the case the asynchronous interrupt hit
in user context, because a subsequent nested interrupt would by definition
hit in kernel mode, which then exits via the kernel path which does test
this case.

There is no reason to allow this for such interrupts. While recursion is
bounded at the next level, it's simpler and uses less stack to apply the
replay logic consistently.

This also expands the comment which was really pretty poor and didn't
explain the problem (I can say that because I wrote it).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-2-npiggin@gmail.com
arch/powerpc/kernel/syscall_64.c