]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/entry: Make early program check handler relocated lowcore aware
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 31 Jul 2024 13:26:00 +0000 (15:26 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 7 Aug 2024 18:52:53 +0000 (20:52 +0200)
Add the missing pieces so the early program check handler also works
with a relocated lowcore. Right now the result of an early program
check in case of a relocated lowcore would be a program check loop.

Fixes: 8f1e70adb1a3 ("s390/boot: Add cmdline option to relocate lowcore")
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/early.c
arch/s390/kernel/entry.S

index 14d324865e33fc99790597fc28d11c91394eefe7..ee051ad81c7119a345c9d5f44b249c6e82e8f642 100644 (file)
@@ -183,12 +183,15 @@ void __do_early_pgm_check(struct pt_regs *regs)
 
 static noinline __init void setup_lowcore_early(void)
 {
+       struct lowcore *lc = get_lowcore();
        psw_t psw;
 
        psw.addr = (unsigned long)early_pgm_check_handler;
        psw.mask = PSW_KERNEL_BITS;
-       get_lowcore()->program_new_psw = psw;
-       get_lowcore()->preempt_count = INIT_PREEMPT_COUNT;
+       lc->program_new_psw = psw;
+       lc->preempt_count = INIT_PREEMPT_COUNT;
+       lc->return_lpswe = gen_lpswe(__LC_RETURN_PSW);
+       lc->return_mcck_lpswe = gen_lpswe(__LC_RETURN_MCCK_PSW);
 }
 
 static __init void detect_diag9c(void)
index b01f4ac43f729db1f7d2931cad29b83c69ec43ac..6539ec4800cd1bd7bff132bc188340fc3f262434 100644 (file)
@@ -600,18 +600,19 @@ SYM_CODE_START(restart_int_handler)
 SYM_CODE_END(restart_int_handler)
 
 SYM_CODE_START(early_pgm_check_handler)
-       stmg    %r8,%r15,__LC_SAVE_AREA_SYNC
+       STMG_LC %r8,%r15,__LC_SAVE_AREA_SYNC
+       GET_LC  %r13
        aghi    %r15,-(STACK_FRAME_OVERHEAD+__PT_SIZE)
        la      %r11,STACK_FRAME_OVERHEAD(%r15)
        xc      __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
        stmg    %r0,%r7,__PT_R0(%r11)
-       mvc     __PT_PSW(16,%r11),__LC_PGM_OLD_PSW
-       mvc     __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC
+       mvc     __PT_PSW(16,%r11),__LC_PGM_OLD_PSW(%r13)
+       mvc     __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC(%r13)
        lgr     %r2,%r11
        brasl   %r14,__do_early_pgm_check
-       mvc     __LC_RETURN_PSW(16),STACK_FRAME_OVERHEAD+__PT_PSW(%r15)
+       mvc     __LC_RETURN_PSW(16,%r13),STACK_FRAME_OVERHEAD+__PT_PSW(%r15)
        lmg     %r0,%r15,STACK_FRAME_OVERHEAD+__PT_R0(%r15)
-       lpswe   __LC_RETURN_PSW
+       LPSWEY  __LC_RETURN_PSW,__LC_RETURN_LPSWE
 SYM_CODE_END(early_pgm_check_handler)
 
        .section .kprobes.text, "ax"