From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Niklas Schnelle <schnelle@linux.ibm.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Vineeth Vijayan <vneethv@linux.ibm.com>,
Peter Oberparleiter <oberpar@linux.ibm.com>,
Harald Freudenberger <freude@linux.ibm.com>,
Holger Dengler <dengler@linux.ibm.com>,
Stefan Haberland <sth@linux.ibm.com>,
Jan Hoeppner <hoeppner@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH 07/32] s390/traps: Handle nullifying program checks in get_trap_ip()
Date: Mon, 12 Oct 2026 15:01:56 +0200 [thread overview]
Message-ID: <f7a81358-0ff9-404b-9b27-1ea11c095694@linux.ibm.com> (raw)
In-Reply-To: <20261001103247.1989111-8-hca@linux.ibm.com>
On 10/1/26 12:32, Heiko Carstens wrote:
> get_trap_ip() always rewinds the PSW address by the instruction length
> from the interruption code. For nullifying program checks the PSW
> already points at the faulting instruction, so rewinding is wrong.
>
> Add a nullified[] bitmap and return the unchanged PSW address for
> nullifying cases, or if PIF_PSW_ADDR_ADJUSTED is set.
>
> No functional change for existing callers, which only deal with
> suppressing, terminating, or completing program checks.
>
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> ---
> arch/s390/kernel/traps.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
> index bfcab4592299..5e63032a56db 100644
> --- a/arch/s390/kernel/traps.c
> +++ b/arch/s390/kernel/traps.c
> @@ -26,6 +26,7 @@
> #include <linux/entry-common.h>
> #include <linux/kmsan.h>
> #include <linux/bug.h>
> +#include <asm/pgmcheck-defs.h>
> #include <asm/entry-percpu.h>
> #include <asm/asm-extable.h>
> #include <asm/irqflags.h>
> @@ -41,15 +42,19 @@ struct pgm_stat {
>
> static DEFINE_PER_CPU_SHARED_ALIGNED(struct pgm_stat, pgm_stat);
>
> -static inline void __user *get_trap_ip(struct pt_regs *regs)
> +static inline unsigned long get_trap_ip(struct pt_regs *regs)
> {
> - unsigned long address;
> + static const unsigned long nullified[2] = { PGM_CHECKS_NULLIFIED };
Maybe just [], to deal with the possibility of expansion in the future?
[...]
> @@ -152,7 +157,7 @@ static void illegal_op(struct pt_regs *regs)
> int signal = 0;
> u16 opcode;
>
> - location = get_trap_ip(regs);
> + location = (void __user *)get_trap_ip(regs);
Should location be moved inside the "if"? Now it reads weirdly: we cast
the pointer to __user before checking for user mode.
> if (user_mode(regs)) {
> if (get_user(opcode, location))
> return;
Regardless:
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
next prev parent reply other threads:[~2026-10-12 13:02 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 10:32 [PATCH 00/32] s390: Improve exception table handling and disassembler Heiko Carstens
2026-10-01 10:32 ` [PATCH 01/32] s390/kprobes: Prevent kprobes on instructions with exception table entry Heiko Carstens
2026-10-12 11:31 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 02/32] s390/early: Fix early warning handling Heiko Carstens
2026-10-12 12:11 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 03/32] s390: Clear pt_regs flags field Heiko Carstens
2026-10-12 12:15 ` Ilya Leoshkevich
2026-10-12 12:21 ` Heiko Carstens
2026-10-01 10:32 ` [PATCH 04/32] s390/bug: Indicate modified PSW in disassembly Heiko Carstens
2026-10-12 15:07 ` Ilya Leoshkevich
2026-10-12 15:29 ` Heiko Carstens
2026-10-12 15:37 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 05/32] s390/tools: Rename gen_facilities to gen_bitmaps Heiko Carstens
2026-10-12 12:35 ` Ilya Leoshkevich
2026-10-12 13:26 ` Heiko Carstens
2026-10-01 10:32 ` [PATCH 06/32] s390/tools: Generate bitmap of nullified program checks Heiko Carstens
2026-10-12 12:50 ` Ilya Leoshkevich
2026-10-12 13:32 ` Heiko Carstens
2026-10-01 10:32 ` [PATCH 07/32] s390/traps: Handle nullifying program checks in get_trap_ip() Heiko Carstens
2026-10-12 13:01 ` Ilya Leoshkevich [this message]
2026-10-12 13:42 ` Heiko Carstens
2026-10-12 14:31 ` Ilya Leoshkevich
2026-10-12 15:30 ` Heiko Carstens
2026-10-01 10:32 ` [PATCH 08/32] s390/dis: Improve show_code() output Heiko Carstens
2026-10-12 15:08 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 09/32] s390/extable: Rework exception handling logic Heiko Carstens
2026-10-12 13:09 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 10/32] s390/diag: Convert amode31 exception tables to EX_TABLE_INSN Heiko Carstens
2026-10-12 13:13 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 11/32] s390/uaccess: Convert inline assembly " Heiko Carstens
2026-10-12 13:16 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 12/32] s390/lib/uaccess: " Heiko Carstens
2026-10-12 13:24 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 13/32] s390/futex: " Heiko Carstens
2026-10-12 13:27 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 14/32] s390/diag: " Heiko Carstens
2026-10-12 14:20 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 15/32] s390/mm/pfault: " Heiko Carstens
2026-10-12 14:21 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 16/32] s390/cpu_mf: " Heiko Carstens
2026-10-12 14:22 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 17/32] s390/cert_store: " Heiko Carstens
2026-10-12 14:23 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 18/32] s390/ipl: " Heiko Carstens
2026-10-12 14:23 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 19/32] s390/hypfs: " Heiko Carstens
2026-10-12 14:24 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 20/32] s390/ap: " Heiko Carstens
2026-10-02 7:54 ` Harald Freudenberger
2026-10-01 10:32 ` [PATCH 21/32] s390/fpu: " Heiko Carstens
2026-10-12 14:25 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 22/32] s390/traps: " Heiko Carstens
2026-10-12 14:25 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 23/32] s390/word-at-a-time: " Heiko Carstens
2026-10-12 14:26 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 24/32] s390/kvm: " Heiko Carstens
2026-10-02 8:24 ` Claudio Imbrenda
2026-10-01 10:32 ` [PATCH 25/32] s390/pci: " Heiko Carstens
2026-10-02 9:12 ` Niklas Schnelle
2026-10-01 10:32 ` [PATCH 26/32] s390/boot: " Heiko Carstens
2026-10-12 14:28 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 27/32] s390/cio: " Heiko Carstens
2026-10-12 14:32 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 28/32] s390/dasd: " Heiko Carstens
2026-10-12 14:33 ` Ilya Leoshkevich
2026-10-12 14:52 ` Stefan Haberland
2026-10-01 10:32 ` [PATCH 29/32] s390/diag_ftp: " Heiko Carstens
2026-10-12 14:33 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 30/32] s390/sclp: " Heiko Carstens
2026-10-12 14:34 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 31/32] s390/bpf: Simplify exception table entry handling Heiko Carstens
2026-10-12 14:38 ` Ilya Leoshkevich
2026-10-01 10:32 ` [PATCH 32/32] s390/extable: Remove EX_TABLE macros and fallback extable search Heiko Carstens
2026-10-12 14:43 ` Ilya Leoshkevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7a81358-0ff9-404b-9b27-1ea11c095694@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=dengler@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hoeppner@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=oberpar@linux.ibm.com \
--cc=schnelle@linux.ibm.com \
--cc=sth@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=vneethv@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®