Skip to content

Commit 034e9e9

Browse files
Michael HolzheuMartin Schwidefsky
authored andcommitted
[S390] Fix parameter passing for smp_switch_to_cpu()
After the execution has been switched to the destination CPU, the target function is called with the wrong parameter. According to the C calling convention on s390, the first parameter should be loaded into register 2. Currently in smp_restart_cpu() it is stored in register 3. To fix this, we load the parameter into the correct register 2. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 65a94b1 commit 034e9e9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎arch/s390/kernel/switch_cpu.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ smp_restart_cpu:
4646
ltr %r4,%r4 /* New stack ? */
4747
jz 1f
4848
lr %r15,%r4
49-
1: basr %r14,%r2
49+
1: lr %r14,%r2 /* r14: Function to call */
50+
lr %r2,%r3 /* r2 : Parameter for function*/
51+
basr %r14,%r14 /* Call function */
5052

5153
.gprregs_addr:
5254
.long .gprregs

‎arch/s390/kernel/switch_cpu64.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ smp_restart_cpu:
4242
ltgr %r4,%r4 /* New stack ? */
4343
jz 1f
4444
lgr %r15,%r4
45-
1: basr %r14,%r2
45+
1: lgr %r14,%r2 /* r14: Function to call */
46+
lgr %r2,%r3 /* r2 : Parameter for function*/
47+
basr %r14,%r14 /* Call function */
4648

4749
.section .data,"aw",@progbits
4850
.gprregs:

0 commit comments

Comments
 (0)