aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/switch_cpu64.S
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2010-02-26 16:37:34 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-02-26 16:37:30 -0500
commit2c2df118a6440748e6fd71a510a66ee708c31494 (patch)
tree4e19684886c0c1e7261a1d68de9885302c0565f1 /arch/s390/kernel/switch_cpu64.S
parentabd1ecf209b30a0ed43f0aae50f8b8ce1be2c3d1 (diff)
[S390] smp: always reboot on cpu 0
Always reboot on logical cpu 0. This makes sure that the IPL cpu is always the same and usually avoids strange numbering schemes between physical and logical cpus. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/switch_cpu64.S')
-rw-r--r--arch/s390/kernel/switch_cpu64.S52
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/s390/kernel/switch_cpu64.S b/arch/s390/kernel/switch_cpu64.S
new file mode 100644
index 000000000000..c73ede3c1d68
--- /dev/null
+++ b/arch/s390/kernel/switch_cpu64.S
@@ -0,0 +1,52 @@
1/*
2 * 64-bit switch cpu code
3 *
4 * Copyright IBM Corp. 2009
5 *
6 */
7
8#include <asm/asm-offsets.h>
9#include <asm/lowcore.h>
10#include <asm/ptrace.h>
11
12# smp_switch_to_cpu switches to destination cpu and executes the passed function
13# Parameter: %r2 - function to call
14# %r3 - function parameter
15# %r4 - stack poiner
16# %r5 - current cpu
17# %r6 - destination cpu
18
19 .section .text
20 .align 4
21 .globl smp_switch_to_cpu
22smp_switch_to_cpu:
23 stmg %r6,%r15,__SF_GPRS(%r15)
24 lgr %r1,%r15
25 aghi %r15,-STACK_FRAME_OVERHEAD
26 stg %r1,__SF_BACKCHAIN(%r15)
27 larl %r1,.gprregs
28 stmg %r0,%r15,0(%r1)
291: sigp %r0,%r6,__SIGP_RESTART /* start destination CPU */
30 brc 2,1b /* busy, try again */
312: sigp %r0,%r5,__SIGP_STOP /* stop current CPU */
32 brc 2,2b /* busy, try again */
333: j 3b
34
35 .globl smp_restart_cpu
36smp_restart_cpu:
37 larl %r1,.gprregs
38 lmg %r0,%r15,0(%r1)
391: sigp %r0,%r5,__SIGP_SENSE /* Wait for calling CPU */
40 brc 10,1b /* busy, accepted (status 0), running */
41 tmll %r0,0x40 /* Test if calling CPU is stopped */
42 jz 1b
43 ltgr %r4,%r4 /* New stack ? */
44 jz 1f
45 lgr %r15,%r4
461: basr %r14,%r2
47
48 .section .data,"aw",@progbits
49.gprregs:
50 .rept 16
51 .quad 0
52 .endr