Re: [PATCH 03/32] s390: Clear pt_regs flags field
From: Ilya Leoshkevich
Date: Mon Oct 12 2026 - 08:20:23 EST
On 10/1/26 12:32, Heiko Carstens wrote:
Clear the pt_regs flags field in the early program check handler as well
as in the stack_invalid handler. Without this the pt_regs flags field will
have random values, depending on previous stack contents.
This matters currently for bug reporting and disassembly, where flags like
PIF_PSW_ADDR_ADJUSTED may then be incorrectly set, which could lead to a
partially incorrect disassembly or wrong code markers.
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/kernel/early.c | 1 +
arch/s390/kernel/entry.S | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 1fc153d8385b..b8e3c065fbec 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -154,6 +154,7 @@ void __init __do_early_pgm_check(struct pt_regs *regs)
{
struct lowcore *lc = get_lowcore();
+ regs->flags = 0;
regs->int_code = lc->pgm_int_code;
regs->int_parm_long = lc->trans_exc_code;
regs->last_break = lc->pgm_last_break;
Just for my understanding, why can't we do it in C for all handlers?
Reviewed-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>