]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/entry: Make __switch_to() ready for lowcore relocation
authorSven Schnelle <svens@linux.ibm.com>
Mon, 22 Jul 2024 13:41:24 +0000 (15:41 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 23 Jul 2024 14:02:32 +0000 (16:02 +0200)
In preparation of having lowcore at different address than zero,
add the base register to all lowcore accesses in __switch_to().

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/entry.S

index ca58b3da391645c57b2bf2f5ace9ae16cb715d87..bbdbe3c3a7701ffb558a8d2377e9951e30f7ada8 100644 (file)
@@ -169,13 +169,14 @@ SYM_FUNC_START(__switch_to_asm)
        stg     %r15,__THREAD_ksp(%r1,%r2)      # store kernel stack of prev
        lg      %r15,0(%r4,%r3)                 # start of kernel stack of next
        agr     %r15,%r5                        # end of kernel stack of next
-       stg     %r3,__LC_CURRENT                # store task struct of next
-       stg     %r15,__LC_KERNEL_STACK          # store end of kernel stack
+       GET_LC  %r13
+       stg     %r3,__LC_CURRENT(%r13)          # store task struct of next
+       stg     %r15,__LC_KERNEL_STACK(%r13)    # store end of kernel stack
        lg      %r15,__THREAD_ksp(%r1,%r3)      # load kernel stack of next
        aghi    %r3,__TASK_pid
-       mvc     __LC_CURRENT_PID(4,%r0),0(%r3)  # store pid of next
+       mvc     __LC_CURRENT_PID(4,%r13),0(%r3) # store pid of next
+       ALTERNATIVE "nop", "lpp _LPP_OFFSET(%r13)", ALT_FACILITY(40)
        lmg     %r6,%r15,__SF_GPRS(%r15)        # load gprs of next task
-       ALTERNATIVE "nop", "lpp _LPP_OFFSET", ALT_FACILITY(40)
        BR_EX   %r14
 SYM_FUNC_END(__switch_to_asm)