aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/swsusp_asm64.S
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2012-03-11 11:59:26 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-03-11 11:59:28 -0400
commit8b646bd759086f6090fe27acf414c0b5faa737f4 (patch)
tree29475659031c57ccf2ca43899614ab5c6b1899a0 /arch/s390/kernel/swsusp_asm64.S
parent7e180bd8020d213bb0de15c3606968f8a9262439 (diff)
[S390] rework smp code
Define struct pcpu and merge some of the NR_CPUS arrays into it, including __cpu_logical_map, current_set and smp_cpu_state. Split smp related functions to those operating on physical cpus and the functions operating on a logical cpu number. Make the functions for physical cpus use a pointer to a struct pcpu. This hides the knowledge about cpu addresses in smp.c, entry[64].S and swsusp_asm64.S, thus remove the sigp.h header. The PSW restart mechanism is used to start secondary cpus, calling a function on an online cpu, calling a function on the ipl cpu, and for the nmi signal. Replace the different assembler functions with a single function restart_int_handler. The new entry point calls a function whose pointer is stored in the lowcore of the target cpu and it can wait for the source cpu to stop. This covers all existing use cases. Overall the code is now simpler and there are ~380 lines less code. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/swsusp_asm64.S')
-rw-r--r--arch/s390/kernel/swsusp_asm64.S12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S
index 2ef39d1519a9..ad3c79eceed7 100644
--- a/arch/s390/kernel/swsusp_asm64.S
+++ b/arch/s390/kernel/swsusp_asm64.S
@@ -179,9 +179,9 @@ pgm_check_entry:
179 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ 179 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */
180 mvc __LC_RST_NEW_PSW(16,%r0),0(%r4) 180 mvc __LC_RST_NEW_PSW(16,%r0),0(%r4)
1813: 1813:
182 sigp %r9,%r1,__SIGP_INITIAL_CPU_RESET 182 sigp %r9,%r1,11 /* sigp initial cpu reset */
183 brc 8,4f /* accepted */ 183 brc 8,4f /* accepted */
184 brc 2,3b /* busy, try again */ 184 brc 2,3b /* busy, try again */
185 185
186 /* Suspend CPU not available -> panic */ 186 /* Suspend CPU not available -> panic */
187 larl %r15,init_thread_union 187 larl %r15,init_thread_union
@@ -196,10 +196,10 @@ pgm_check_entry:
196 lpsw 0(%r3) 196 lpsw 0(%r3)
1974: 1974:
198 /* Switch to suspend CPU */ 198 /* Switch to suspend CPU */
199 sigp %r9,%r1,__SIGP_RESTART /* start suspend CPU */ 199 sigp %r9,%r1,6 /* sigp restart to suspend CPU */
200 brc 2,4b /* busy, try again */ 200 brc 2,4b /* busy, try again */
2015: 2015:
202 sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ 202 sigp %r9,%r2,5 /* sigp stop to current resume CPU */
203 brc 2,5b /* busy, try again */ 203 brc 2,5b /* busy, try again */
2046: j 6b 2046: j 6b
205 205
@@ -207,7 +207,7 @@ restart_suspend:
207 larl %r1,.Lresume_cpu 207 larl %r1,.Lresume_cpu
208 llgh %r2,0(%r1) 208 llgh %r2,0(%r1)
2097: 2097:
210 sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ 210 sigp %r9,%r2,1 /* sigp sense, wait for resume CPU */
211 brc 8,7b /* accepted, status 0, still running */ 211 brc 8,7b /* accepted, status 0, still running */
212 brc 2,7b /* busy, try again */ 212 brc 2,7b /* busy, try again */
213 tmll %r9,0x40 /* Test if resume CPU is stopped */ 213 tmll %r9,0x40 /* Test if resume CPU is stopped */