powerpc/64s: add a table of implicit soft-masked addresses
authorNicholas Piggin <npiggin@gmail.com>
Wed, 30 Jun 2021 07:46:16 +0000 (17:46 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 30 Jun 2021 12:21:20 +0000 (22:21 +1000)
commit325678fd052259e7c05ef29060a73c705ea90432
tree4af33e651e345d979c3cdca9af3f9bccd7e10f38
parent9b69d48c7516a29cdaacd18d8bf5f575014a42a1
powerpc/64s: add a table of implicit soft-masked addresses

Commit 9d1988ca87dd ("powerpc/64: treat low kernel text as irqs
soft-masked") ends up catching too much code, including ret_from_fork,
and parts of interrupt and syscall return that do not expect to be
interrupts to be soft-masked. If an interrupt gets marked pending,
and then the code proceeds out of the implicit soft-masked region it
will fail to deal with the pending interrupt.

Fix this by adding a new table of addresses which explicitly marks
the regions of code that are soft masked. This table is only checked
for interrupts that below __end_soft_masked, so most kernel interrupts
will not have the overhead of the table search.

Fixes: 9d1988ca87dd ("powerpc/64: treat low kernel text as irqs soft-masked")
Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210630074621.2109197-5-npiggin@gmail.com
arch/powerpc/include/asm/interrupt.h
arch/powerpc/include/asm/ppc_asm.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/interrupt_64.S
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/lib/restart_table.c