Re: [PATCH 09/32] s390/extable: Rework exception handling logic

From: Ilya Leoshkevich

Date: Mon Oct 12 2026 - 09:47:19 EST




On 10/1/26 12:32, Heiko Carstens wrote:
Add EX_TABLE_INSN macros which will replace the existing EX_TABLE
macros. The macros come with new semantics for the whole exception
handling: with the new exception handling the exception table entries
always point to the instruction which may cause an exception. This is
regardless of exception type, and whether an exception is nullifying,
suppressing, completing, or terminating.

This improves the current situation where exception table entries are
required which point to the instruction (nullifying) and/or behind the
instruction (suppressing, completing, or terminating), since depending
on usage an instruction can generate different exceptions.

The new EX_TABLE_INSN macros are aliases to the existing EX_TABLE
macros. The exception handling logic is changed to first perform a lookup
in the exception tables with get_trap_ip() / boot_get_trap_ip(). If that
finds nothing, it falls back to looking up with instruction_pointer().

This is a temporary solution until all EX_TABLE usages have been
converted to EX_TABLE_INSN. When that work is complete EX_TABLE will
be removed, exception tables will only be searched by using the return
value of get_trap_ip() / boot_get_trap_ip().

Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/boot/pgm_check.c | 35 ++++++++++++++++++++++++-----
arch/s390/include/asm/asm-extable.h | 10 +++++++++
arch/s390/mm/extable.c | 4 +++-
3 files changed, 42 insertions(+), 7 deletions(-)

Reviewed-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>