Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * S390 low-level entry points. |
| 4 | * |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 5 | * Copyright IBM Corp. 1999, 2012 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 7 | * Hartmut Penner (hp@de.ibm.com), |
| 8 | * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 9 | * Heiko Carstens <heiko.carstens@de.ibm.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Heiko Carstens | 2bc89b5 | 2008-02-05 16:50:40 +0100 | [diff] [blame] | 12 | #include <linux/init.h> |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 13 | #include <linux/linkage.h> |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 14 | #include <asm/alternative-asm.h> |
Heiko Carstens | eb608fb | 2012-09-05 13:26:11 +0200 | [diff] [blame] | 15 | #include <asm/processor.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <asm/cache.h> |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 17 | #include <asm/ctl_reg.h> |
Hendrik Brueckner | dc24b7b | 2018-02-19 11:27:09 +0100 | [diff] [blame] | 18 | #include <asm/dwarf.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/errno.h> |
| 20 | #include <asm/ptrace.h> |
| 21 | #include <asm/thread_info.h> |
Sam Ravnborg | 0013a85 | 2005-09-09 20:57:26 +0200 | [diff] [blame] | 22 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | #include <asm/unistd.h> |
| 24 | #include <asm/page.h> |
Heiko Carstens | eb54619 | 2012-06-04 15:05:43 +0200 | [diff] [blame] | 25 | #include <asm/sigp.h> |
Martin Schwidefsky | 1f44a225 | 2013-06-27 09:01:09 +0200 | [diff] [blame] | 26 | #include <asm/irq.h> |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 27 | #include <asm/vx-insn.h> |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 28 | #include <asm/setup.h> |
| 29 | #include <asm/nmi.h> |
Al Viro | 711f5df | 2016-01-12 13:30:03 -0500 | [diff] [blame] | 30 | #include <asm/export.h> |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 31 | #include <asm/nospec-insn.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 33 | __PT_R0 = __PT_GPRS |
| 34 | __PT_R1 = __PT_GPRS + 8 |
| 35 | __PT_R2 = __PT_GPRS + 16 |
| 36 | __PT_R3 = __PT_GPRS + 24 |
| 37 | __PT_R4 = __PT_GPRS + 32 |
| 38 | __PT_R5 = __PT_GPRS + 40 |
| 39 | __PT_R6 = __PT_GPRS + 48 |
| 40 | __PT_R7 = __PT_GPRS + 56 |
| 41 | __PT_R8 = __PT_GPRS + 64 |
| 42 | __PT_R9 = __PT_GPRS + 72 |
| 43 | __PT_R10 = __PT_GPRS + 80 |
| 44 | __PT_R11 = __PT_GPRS + 88 |
| 45 | __PT_R12 = __PT_GPRS + 96 |
| 46 | __PT_R13 = __PT_GPRS + 104 |
| 47 | __PT_R14 = __PT_GPRS + 112 |
| 48 | __PT_R15 = __PT_GPRS + 120 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
Heiko Carstens | 3a89038 | 2016-11-14 14:39:16 +0100 | [diff] [blame] | 50 | STACK_SHIFT = PAGE_SHIFT + THREAD_SIZE_ORDER |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | STACK_SIZE = 1 << STACK_SHIFT |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 52 | STACK_INIT = STACK_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 54 | _TIF_WORK = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
Linus Torvalds | 76f1948 | 2017-05-02 18:24:16 -0700 | [diff] [blame] | 55 | _TIF_UPROBE | _TIF_GUARDED_STORAGE | _TIF_PATCH_PENDING) |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 56 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ |
| 57 | _TIF_SYSCALL_TRACEPOINT) |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 58 | _CIF_WORK = (_CIF_MCCK_PENDING | _CIF_ASCE_PRIMARY | \ |
| 59 | _CIF_ASCE_SECONDARY | _CIF_FPU) |
Martin Schwidefsky | 23fefe1 | 2017-06-07 14:10:24 +0200 | [diff] [blame] | 60 | _PIF_WORK = (_PIF_PER_TRAP | _PIF_SYSCALL_RESTART) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
Martin Schwidefsky | e5b9819 | 2018-03-26 15:23:33 +0200 | [diff] [blame] | 62 | _LPP_OFFSET = __LC_LPP |
| 63 | |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 64 | #define BASED(name) name-cleanup_critical(%r13) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 66 | .macro TRACE_IRQS_ON |
| 67 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 68 | basr %r2,%r0 |
| 69 | brasl %r14,trace_hardirqs_on_caller |
| 70 | #endif |
| 71 | .endm |
| 72 | |
| 73 | .macro TRACE_IRQS_OFF |
| 74 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 75 | basr %r2,%r0 |
| 76 | brasl %r14,trace_hardirqs_off_caller |
| 77 | #endif |
| 78 | .endm |
| 79 | |
| 80 | .macro LOCKDEP_SYS_EXIT |
| 81 | #ifdef CONFIG_LOCKDEP |
| 82 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 83 | jz .+10 |
| 84 | brasl %r14,lockdep_sys_exit |
| 85 | #endif |
| 86 | .endm |
| 87 | |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 88 | .macro CHECK_STACK savearea |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 89 | #ifdef CONFIG_CHECK_STACK |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 90 | tml %r15,STACK_SIZE - CONFIG_STACK_GUARD |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 91 | lghi %r14,\savearea |
| 92 | jz stack_overflow |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 93 | #endif |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 94 | .endm |
| 95 | |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 96 | .macro CHECK_VMAP_STACK savearea,oklabel |
| 97 | #ifdef CONFIG_VMAP_STACK |
| 98 | lgr %r14,%r15 |
| 99 | nill %r14,0x10000 - STACK_SIZE |
| 100 | oill %r14,STACK_INIT |
| 101 | clg %r14,__LC_KERNEL_STACK |
| 102 | je \oklabel |
| 103 | clg %r14,__LC_ASYNC_STACK |
| 104 | je \oklabel |
| 105 | clg %r14,__LC_NODAT_STACK |
| 106 | je \oklabel |
| 107 | clg %r14,__LC_RESTART_STACK |
| 108 | je \oklabel |
| 109 | lghi %r14,\savearea |
| 110 | j stack_overflow |
| 111 | #else |
| 112 | j \oklabel |
| 113 | #endif |
| 114 | .endm |
| 115 | |
Martin Schwidefsky | 2acb94f | 2015-06-22 17:28:14 +0200 | [diff] [blame] | 116 | .macro SWITCH_ASYNC savearea,timer |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 117 | tmhh %r8,0x0001 # interrupting from user ? |
| 118 | jnz 1f |
| 119 | lgr %r14,%r9 |
| 120 | slg %r14,BASED(.Lcritical_start) |
| 121 | clg %r14,BASED(.Lcritical_length) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | jhe 0f |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 123 | lghi %r11,\savearea # inside critical section, do cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | brasl %r14,cleanup_critical |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 125 | tmhh %r8,0x0001 # retest problem state after cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | jnz 1f |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 127 | 0: lg %r14,__LC_ASYNC_STACK # are we already on the target stack? |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | slgr %r14,%r15 |
Martin Schwidefsky | 2acb94f | 2015-06-22 17:28:14 +0200 | [diff] [blame] | 129 | srag %r14,%r14,STACK_SHIFT |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 130 | jnz 2f |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 131 | CHECK_STACK \savearea |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 132 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 133 | j 3f |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 134 | 1: UPDATE_VTIME %r14,%r15,\timer |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 135 | BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | 2acb94f | 2015-06-22 17:28:14 +0200 | [diff] [blame] | 136 | 2: lg %r15,__LC_ASYNC_STACK # load async stack |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 137 | 3: la %r11,STACK_FRAME_OVERHEAD(%r15) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 138 | .endm |
| 139 | |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 140 | .macro UPDATE_VTIME w1,w2,enter_timer |
| 141 | lg \w1,__LC_EXIT_TIMER |
| 142 | lg \w2,__LC_LAST_UPDATE_TIMER |
| 143 | slg \w1,\enter_timer |
| 144 | slg \w2,__LC_EXIT_TIMER |
| 145 | alg \w1,__LC_USER_TIMER |
| 146 | alg \w2,__LC_SYSTEM_TIMER |
| 147 | stg \w1,__LC_USER_TIMER |
| 148 | stg \w2,__LC_SYSTEM_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 149 | mvc __LC_LAST_UPDATE_TIMER(8),\enter_timer |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 150 | .endm |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 152 | .macro REENABLE_IRQS |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 153 | stg %r8,__LC_RETURN_PSW |
| 154 | ni __LC_RETURN_PSW,0xbf |
| 155 | ssm __LC_RETURN_PSW |
Martin Schwidefsky | 1e54622 | 2010-10-25 16:10:37 +0200 | [diff] [blame] | 156 | .endm |
| 157 | |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 158 | .macro STCK savearea |
Heiko Carstens | d652d59 | 2012-05-14 10:35:22 +0200 | [diff] [blame] | 159 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 160 | .insn s,0xb27c0000,\savearea # store clock fast |
| 161 | #else |
| 162 | .insn s,0xb2050000,\savearea # store clock |
| 163 | #endif |
| 164 | .endm |
| 165 | |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 166 | /* |
| 167 | * The TSTMSK macro generates a test-under-mask instruction by |
| 168 | * calculating the memory offset for the specified mask value. |
| 169 | * Mask value can be any constant. The macro shifts the mask |
| 170 | * value to calculate the memory offset for the test-under-mask |
| 171 | * instruction. |
| 172 | */ |
| 173 | .macro TSTMSK addr, mask, size=8, bytepos=0 |
| 174 | .if (\bytepos < \size) && (\mask >> 8) |
| 175 | .if (\mask & 0xff) |
| 176 | .error "Mask exceeds byte boundary" |
| 177 | .endif |
| 178 | TSTMSK \addr, "(\mask >> 8)", \size, "(\bytepos + 1)" |
| 179 | .exitm |
| 180 | .endif |
| 181 | .ifeq \mask |
| 182 | .error "Mask must not be zero" |
| 183 | .endif |
| 184 | off = \size - \bytepos - 1 |
| 185 | tm off+\addr, \mask |
| 186 | .endm |
| 187 | |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 188 | .macro BPOFF |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 189 | ALTERNATIVE "", ".long 0xb2e8c000", 82 |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 190 | .endm |
| 191 | |
| 192 | .macro BPON |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 193 | ALTERNATIVE "", ".long 0xb2e8d000", 82 |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 194 | .endm |
| 195 | |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 196 | .macro BPENTER tif_ptr,tif_mask |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 197 | ALTERNATIVE "TSTMSK \tif_ptr,\tif_mask; jz .+8; .long 0xb2e8d000", \ |
| 198 | "", 82 |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 199 | .endm |
| 200 | |
| 201 | .macro BPEXIT tif_ptr,tif_mask |
| 202 | TSTMSK \tif_ptr,\tif_mask |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 203 | ALTERNATIVE "jz .+8; .long 0xb2e8c000", \ |
| 204 | "jnz .+8; .long 0xb2e8d000", 82 |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 205 | .endm |
| 206 | |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 207 | GEN_BR_THUNK %r9 |
| 208 | GEN_BR_THUNK %r14 |
| 209 | GEN_BR_THUNK %r14,%r11 |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 210 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 211 | .section .kprobes.text, "ax" |
Heiko Carstens | 46210c4 | 2016-06-30 12:40:25 +0200 | [diff] [blame] | 212 | .Ldummy: |
| 213 | /* |
| 214 | * This nop exists only in order to avoid that __switch_to starts at |
| 215 | * the beginning of the kprobes text section. In that case we would |
| 216 | * have several symbols at the same address. E.g. objdump would take |
| 217 | * an arbitrary symbol name when disassembling this code. |
| 218 | * With the added nop in between the __switch_to symbol is unique |
| 219 | * again. |
| 220 | */ |
| 221 | nop 0 |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 222 | |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 223 | ENTRY(__bpon) |
| 224 | .globl __bpon |
| 225 | BPON |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 226 | BR_EX %r14 |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 227 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | /* |
| 229 | * Scheduler resume function, called by switch_to |
| 230 | * gpr2 = (task_struct *) prev |
| 231 | * gpr3 = (task_struct *) next |
| 232 | * Returns: |
| 233 | * gpr2 = prev |
| 234 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 235 | ENTRY(__switch_to) |
Martin Schwidefsky | eda0c6d | 2012-05-15 09:20:06 +0200 | [diff] [blame] | 236 | stmg %r6,%r15,__SF_GPRS(%r15) # store gprs of prev task |
Heiko Carstens | 3241d3e | 2017-11-16 14:54:04 +0100 | [diff] [blame] | 237 | lghi %r4,__TASK_stack |
| 238 | lghi %r1,__TASK_thread |
Vasily Gorbik | 9fed920 | 2018-10-26 15:29:59 +0200 | [diff] [blame] | 239 | llill %r5,STACK_INIT |
Heiko Carstens | 3241d3e | 2017-11-16 14:54:04 +0100 | [diff] [blame] | 240 | stg %r15,__THREAD_ksp(%r1,%r2) # store kernel stack of prev |
Vasily Gorbik | 9fed920 | 2018-10-26 15:29:59 +0200 | [diff] [blame] | 241 | lg %r15,0(%r4,%r3) # start of kernel stack of next |
| 242 | agr %r15,%r5 # end of kernel stack of next |
Martin Schwidefsky | eda0c6d | 2012-05-15 09:20:06 +0200 | [diff] [blame] | 243 | stg %r3,__LC_CURRENT # store task struct of next |
Martin Schwidefsky | eda0c6d | 2012-05-15 09:20:06 +0200 | [diff] [blame] | 244 | stg %r15,__LC_KERNEL_STACK # store end of kernel stack |
Heiko Carstens | 3241d3e | 2017-11-16 14:54:04 +0100 | [diff] [blame] | 245 | lg %r15,__THREAD_ksp(%r1,%r3) # load kernel stack of next |
| 246 | aghi %r3,__TASK_pid |
| 247 | mvc __LC_CURRENT_PID(4,%r0),0(%r3) # store pid of next |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 248 | lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task |
Martin Schwidefsky | e5b9819 | 2018-03-26 15:23:33 +0200 | [diff] [blame] | 249 | ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40 |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 250 | BR_EX %r14 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 252 | .L__critical_start: |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 253 | |
| 254 | #if IS_ENABLED(CONFIG_KVM) |
| 255 | /* |
| 256 | * sie64a calling convention: |
| 257 | * %r2 pointer to sie control block |
| 258 | * %r3 guest register save area |
| 259 | */ |
| 260 | ENTRY(sie64a) |
| 261 | stmg %r6,%r14,__SF_GPRS(%r15) # save kernel registers |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 262 | lg %r12,__LC_CURRENT |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 263 | stg %r2,__SF_SIE_CONTROL(%r15) # save control block pointer |
| 264 | stg %r3,__SF_SIE_SAVEAREA(%r15) # save guest register save area |
| 265 | xc __SF_SIE_REASON(8,%r15),__SF_SIE_REASON(%r15) # reason code = 0 |
| 266 | mvc __SF_SIE_FLAGS(8,%r15),__TI_flags(%r12) # copy thread flags |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 267 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU # load guest fp/vx registers ? |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 268 | jno .Lsie_load_guest_gprs |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 269 | brasl %r14,load_fpu_regs # load guest fp/vx regs |
| 270 | .Lsie_load_guest_gprs: |
| 271 | lmg %r0,%r13,0(%r3) # load guest gprs 0-13 |
| 272 | lg %r14,__LC_GMAP # get gmap pointer |
| 273 | ltgr %r14,%r14 |
| 274 | jz .Lsie_gmap |
| 275 | lctlg %c1,%c1,__GMAP_ASCE(%r14) # load primary asce |
| 276 | .Lsie_gmap: |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 277 | lg %r14,__SF_SIE_CONTROL(%r15) # get control block pointer |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 278 | oi __SIE_PROG0C+3(%r14),1 # we are going into SIE now |
| 279 | tm __SIE_PROG20+3(%r14),3 # last exit... |
| 280 | jnz .Lsie_skip |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 281 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 282 | jo .Lsie_skip # exit if fp/vx regs changed |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 283 | BPEXIT __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST) |
QingFeng Hao | c929500 | 2017-06-07 11:30:42 +0200 | [diff] [blame] | 284 | .Lsie_entry: |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 285 | sie 0(%r14) |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 286 | .Lsie_exit: |
| 287 | BPOFF |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 288 | BPENTER __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 289 | .Lsie_skip: |
| 290 | ni __SIE_PROG0C+3(%r14),0xfe # no longer in SIE |
| 291 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
| 292 | .Lsie_done: |
| 293 | # some program checks are suppressing. C code (e.g. do_protection_exception) |
Christian Borntraeger | c0e7bb3 | 2017-05-15 14:11:03 +0200 | [diff] [blame] | 294 | # will rewind the PSW by the ILC, which is often 4 bytes in case of SIE. There |
| 295 | # are some corner cases (e.g. runtime instrumentation) where ILC is unpredictable. |
| 296 | # Other instructions between sie64a and .Lsie_done should not cause program |
| 297 | # interrupts. So lets use 3 nops as a landing pad for all possible rewinds. |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 298 | # See also .Lcleanup_sie |
Christian Borntraeger | c0e7bb3 | 2017-05-15 14:11:03 +0200 | [diff] [blame] | 299 | .Lrewind_pad6: |
| 300 | nopr 7 |
| 301 | .Lrewind_pad4: |
| 302 | nopr 7 |
| 303 | .Lrewind_pad2: |
| 304 | nopr 7 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 305 | .globl sie_exit |
| 306 | sie_exit: |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 307 | lg %r14,__SF_SIE_SAVEAREA(%r15) # load guest register save area |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 308 | stmg %r0,%r13,0(%r14) # save guest gprs 0-13 |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 309 | xgr %r0,%r0 # clear guest registers to |
| 310 | xgr %r1,%r1 # prevent speculative use |
| 311 | xgr %r2,%r2 |
| 312 | xgr %r3,%r3 |
| 313 | xgr %r4,%r4 |
| 314 | xgr %r5,%r5 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 315 | lmg %r6,%r14,__SF_GPRS(%r15) # restore kernel registers |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 316 | lg %r2,__SF_SIE_REASON(%r15) # return exit reason code |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 317 | BR_EX %r14 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 318 | .Lsie_fault: |
| 319 | lghi %r14,-EFAULT |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 320 | stg %r14,__SF_SIE_REASON(%r15) # set exit reason code |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 321 | j sie_exit |
| 322 | |
Christian Borntraeger | c0e7bb3 | 2017-05-15 14:11:03 +0200 | [diff] [blame] | 323 | EX_TABLE(.Lrewind_pad6,.Lsie_fault) |
| 324 | EX_TABLE(.Lrewind_pad4,.Lsie_fault) |
| 325 | EX_TABLE(.Lrewind_pad2,.Lsie_fault) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 326 | EX_TABLE(sie_exit,.Lsie_fault) |
Al Viro | 711f5df | 2016-01-12 13:30:03 -0500 | [diff] [blame] | 327 | EXPORT_SYMBOL(sie64a) |
| 328 | EXPORT_SYMBOL(sie_exit) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 329 | #endif |
| 330 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | /* |
| 332 | * SVC interrupt handler routine. System calls are synchronous events and |
| 333 | * are executed with interrupts enabled. |
| 334 | */ |
| 335 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 336 | ENTRY(system_call) |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 337 | stpt __LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 338 | .Lsysc_stmg: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 339 | stmg %r8,%r15,__LC_SAVE_AREA_SYNC |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 340 | BPOFF |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 341 | lg %r12,__LC_CURRENT |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 342 | lghi %r13,__TASK_thread |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 343 | lghi %r14,_PIF_SYSCALL |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 344 | .Lsysc_per: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 345 | lg %r15,__LC_KERNEL_STACK |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 346 | la %r11,STACK_FRAME_OVERHEAD(%r15) # pointer to pt_regs |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 347 | .Lsysc_vtime: |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 348 | UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 349 | BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 350 | stmg %r0,%r7,__PT_R0(%r11) |
| 351 | mvc __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC |
| 352 | mvc __PT_PSW(16,%r11),__LC_SVC_OLD_PSW |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 353 | mvc __PT_INT_CODE(4,%r11),__LC_SVC_ILC |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 354 | stg %r14,__PT_FLAGS(%r11) |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 355 | .Lsysc_do_svc: |
Christian Borntraeger | d3f4689 | 2018-03-05 19:18:47 +0000 | [diff] [blame] | 356 | # clear user controlled register to prevent speculative use |
| 357 | xgr %r0,%r0 |
Martin Schwidefsky | ef280c8 | 2016-11-08 12:33:38 +0100 | [diff] [blame] | 358 | # load address of system call table |
Martin Schwidefsky | ef280c8 | 2016-11-08 12:33:38 +0100 | [diff] [blame] | 359 | lg %r10,__THREAD_sysc_table(%r13,%r12) |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 360 | llgh %r8,__PT_INT_CODE+2(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 361 | slag %r8,%r8,2 # shift and test for svc 0 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 362 | jnz .Lsysc_nr_ok |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | # svc 0: system call number in %r1 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 364 | llgfr %r1,%r1 # clear high word in r1 |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 365 | cghi %r1,NR_syscalls |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 366 | jnl .Lsysc_nr_ok |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 367 | sth %r1,__PT_INT_CODE+2(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 368 | slag %r8,%r1,2 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 369 | .Lsysc_nr_ok: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 370 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 371 | stg %r2,__PT_ORIG_GPR2(%r11) |
| 372 | stg %r7,STACK_FRAME_OVERHEAD(%r15) |
| 373 | lgf %r9,0(%r8,%r10) # get system call add. |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 374 | TSTMSK __TI_flags(%r12),_TIF_TRACE |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 375 | jnz .Lsysc_tracesys |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 376 | BASR_EX %r14,%r9 # call sys_xxxx |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 377 | stg %r2,__PT_R2(%r11) # store return value |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 379 | .Lsysc_return: |
Heiko Carstens | 9d6d99e | 2018-06-30 10:54:15 +0200 | [diff] [blame] | 380 | #ifdef CONFIG_DEBUG_RSEQ |
| 381 | lgr %r2,%r11 |
| 382 | brasl %r14,rseq_syscall |
| 383 | #endif |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 384 | LOCKDEP_SYS_EXIT |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 385 | .Lsysc_tif: |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 386 | TSTMSK __PT_FLAGS(%r11),_PIF_WORK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 387 | jnz .Lsysc_work |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 388 | TSTMSK __TI_flags(%r12),_TIF_WORK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 389 | jnz .Lsysc_work # check for work |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 390 | TSTMSK __LC_CPU_FLAGS,_CIF_WORK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 391 | jnz .Lsysc_work |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 392 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 393 | .Lsysc_restore: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 394 | lg %r14,__LC_VDSO_PER_CPU |
| 395 | lmg %r0,%r10,__PT_R0(%r11) |
| 396 | mvc __LC_RETURN_PSW(16),__PT_PSW(%r11) |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 397 | .Lsysc_exit_timer: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 398 | stpt __LC_EXIT_TIMER |
| 399 | mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER |
| 400 | lmg %r11,%r15,__PT_R11(%r11) |
| 401 | lpswe __LC_RETURN_PSW |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 402 | .Lsysc_done: |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 403 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | # |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 405 | # One of the work bits is on. Find out which one. |
| 406 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 407 | .Lsysc_work: |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 408 | TSTMSK __LC_CPU_FLAGS,_CIF_MCCK_PENDING |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 409 | jo .Lsysc_mcck_pending |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 410 | TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 411 | jo .Lsysc_reschedule |
Martin Schwidefsky | 23fefe1 | 2017-06-07 14:10:24 +0200 | [diff] [blame] | 412 | TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART |
| 413 | jo .Lsysc_syscall_restart |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 414 | #ifdef CONFIG_UPROBES |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 415 | TSTMSK __TI_flags(%r12),_TIF_UPROBE |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 416 | jo .Lsysc_uprobe_notify |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 417 | #endif |
Martin Schwidefsky | 916cda1 | 2016-01-26 14:10:34 +0100 | [diff] [blame] | 418 | TSTMSK __TI_flags(%r12),_TIF_GUARDED_STORAGE |
| 419 | jo .Lsysc_guarded_storage |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 420 | TSTMSK __PT_FLAGS(%r11),_PIF_PER_TRAP |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 421 | jo .Lsysc_singlestep |
Miroslav Benes | 2f09ca6 | 2017-02-13 19:42:34 -0600 | [diff] [blame] | 422 | #ifdef CONFIG_LIVEPATCH |
| 423 | TSTMSK __TI_flags(%r12),_TIF_PATCH_PENDING |
| 424 | jo .Lsysc_patch_pending # handle live patching just before |
| 425 | # signals and possible syscall restart |
| 426 | #endif |
Martin Schwidefsky | 23fefe1 | 2017-06-07 14:10:24 +0200 | [diff] [blame] | 427 | TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART |
| 428 | jo .Lsysc_syscall_restart |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 429 | TSTMSK __TI_flags(%r12),_TIF_SIGPENDING |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 430 | jo .Lsysc_sigpending |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 431 | TSTMSK __TI_flags(%r12),_TIF_NOTIFY_RESUME |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 432 | jo .Lsysc_notify_resume |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 433 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 434 | jo .Lsysc_vxrs |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 435 | TSTMSK __LC_CPU_FLAGS,(_CIF_ASCE_PRIMARY|_CIF_ASCE_SECONDARY) |
| 436 | jnz .Lsysc_asce |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 437 | j .Lsysc_return # beware of critical section cleanup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | |
| 439 | # |
| 440 | # _TIF_NEED_RESCHED is set, call schedule |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 441 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 442 | .Lsysc_reschedule: |
| 443 | larl %r14,.Lsysc_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 444 | jg schedule |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 445 | |
| 446 | # |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 447 | # _CIF_MCCK_PENDING is set, call handler |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 448 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 449 | .Lsysc_mcck_pending: |
| 450 | larl %r14,.Lsysc_return |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 451 | jg s390_handle_mcck # TIF bit will be cleared by handler |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 452 | |
| 453 | # |
Martin Schwidefsky | 0aaba41 | 2017-08-22 12:08:22 +0200 | [diff] [blame] | 454 | # _CIF_ASCE_PRIMARY and/or _CIF_ASCE_SECONDARY set, load user space asce |
Heiko Carstens | 457f218 | 2014-03-21 10:42:25 +0100 | [diff] [blame] | 455 | # |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 456 | .Lsysc_asce: |
Martin Schwidefsky | 0aaba41 | 2017-08-22 12:08:22 +0200 | [diff] [blame] | 457 | ni __LC_CPU_FLAGS+7,255-_CIF_ASCE_SECONDARY |
| 458 | lctlg %c7,%c7,__LC_VDSO_ASCE # load secondary asce |
| 459 | TSTMSK __LC_CPU_FLAGS,_CIF_ASCE_PRIMARY |
| 460 | jz .Lsysc_return |
| 461 | #ifndef CONFIG_HAVE_MARCH_Z10_FEATURES |
| 462 | tm __LC_STFLE_FAC_LIST+3,0x10 # has MVCOS ? |
| 463 | jnz .Lsysc_set_fs_fixup |
Heiko Carstens | 606aa4a | 2017-02-17 08:12:30 +0100 | [diff] [blame] | 464 | ni __LC_CPU_FLAGS+7,255-_CIF_ASCE_PRIMARY |
Heiko Carstens | 457f218 | 2014-03-21 10:42:25 +0100 | [diff] [blame] | 465 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
Martin Schwidefsky | 0aaba41 | 2017-08-22 12:08:22 +0200 | [diff] [blame] | 466 | j .Lsysc_return |
| 467 | .Lsysc_set_fs_fixup: |
| 468 | #endif |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 469 | larl %r14,.Lsysc_return |
| 470 | jg set_fs_fixup |
Heiko Carstens | 457f218 | 2014-03-21 10:42:25 +0100 | [diff] [blame] | 471 | |
| 472 | # |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 473 | # CIF_FPU is set, restore floating-point controls and floating-point registers. |
| 474 | # |
| 475 | .Lsysc_vxrs: |
| 476 | larl %r14,.Lsysc_return |
| 477 | jg load_fpu_regs |
| 478 | |
| 479 | # |
Roland McGrath | 02a029b | 2008-04-30 00:53:08 -0700 | [diff] [blame] | 480 | # _TIF_SIGPENDING is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 482 | .Lsysc_sigpending: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 483 | lgr %r2,%r11 # pass pointer to pt_regs |
| 484 | brasl %r14,do_signal |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 485 | TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 486 | jno .Lsysc_return |
Martin Schwidefsky | 57d7f93 | 2016-03-22 10:54:24 +0100 | [diff] [blame] | 487 | .Lsysc_do_syscall: |
| 488 | lghi %r13,__TASK_thread |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 489 | lmg %r2,%r7,__PT_R2(%r11) # load svc arguments |
Martin Schwidefsky | 57d7f93 | 2016-03-22 10:54:24 +0100 | [diff] [blame] | 490 | lghi %r1,0 # svc 0 returns -ENOSYS |
| 491 | j .Lsysc_do_svc |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 492 | |
| 493 | # |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 494 | # _TIF_NOTIFY_RESUME is set, call do_notify_resume |
| 495 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 496 | .Lsysc_notify_resume: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 497 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 498 | larl %r14,.Lsysc_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 499 | jg do_notify_resume |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 500 | |
| 501 | # |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 502 | # _TIF_UPROBE is set, call uprobe_notify_resume |
| 503 | # |
| 504 | #ifdef CONFIG_UPROBES |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 505 | .Lsysc_uprobe_notify: |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 506 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 507 | larl %r14,.Lsysc_return |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 508 | jg uprobe_notify_resume |
| 509 | #endif |
| 510 | |
| 511 | # |
Martin Schwidefsky | 916cda1 | 2016-01-26 14:10:34 +0100 | [diff] [blame] | 512 | # _TIF_GUARDED_STORAGE is set, call guarded_storage_load |
| 513 | # |
| 514 | .Lsysc_guarded_storage: |
| 515 | lgr %r2,%r11 # pass pointer to pt_regs |
| 516 | larl %r14,.Lsysc_return |
| 517 | jg gs_load_bc_cb |
Linus Torvalds | 76f1948 | 2017-05-02 18:24:16 -0700 | [diff] [blame] | 518 | # |
Miroslav Benes | 2f09ca6 | 2017-02-13 19:42:34 -0600 | [diff] [blame] | 519 | # _TIF_PATCH_PENDING is set, call klp_update_patch_state |
| 520 | # |
| 521 | #ifdef CONFIG_LIVEPATCH |
| 522 | .Lsysc_patch_pending: |
| 523 | lg %r2,__LC_CURRENT # pass pointer to task struct |
| 524 | larl %r14,.Lsysc_return |
| 525 | jg klp_update_patch_state |
| 526 | #endif |
Martin Schwidefsky | 916cda1 | 2016-01-26 14:10:34 +0100 | [diff] [blame] | 527 | |
| 528 | # |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 529 | # _PIF_PER_TRAP is set, call do_per_trap |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 530 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 531 | .Lsysc_singlestep: |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 532 | ni __PT_FLAGS+7(%r11),255-_PIF_PER_TRAP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 533 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 534 | larl %r14,.Lsysc_return |
Martin Schwidefsky | 5e9a269 | 2011-01-05 12:48:10 +0100 | [diff] [blame] | 535 | jg do_per_trap |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 536 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 537 | # |
Martin Schwidefsky | 23fefe1 | 2017-06-07 14:10:24 +0200 | [diff] [blame] | 538 | # _PIF_SYSCALL_RESTART is set, repeat the current system call |
| 539 | # |
| 540 | .Lsysc_syscall_restart: |
| 541 | ni __PT_FLAGS+7(%r11),255-_PIF_SYSCALL_RESTART |
| 542 | lmg %r1,%r7,__PT_R1(%r11) # load svc arguments |
| 543 | lg %r2,__PT_ORIG_GPR2(%r11) |
| 544 | j .Lsysc_do_svc |
| 545 | |
| 546 | # |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 547 | # call tracehook_report_syscall_entry/tracehook_report_syscall_exit before |
| 548 | # and after the system call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 549 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 550 | .Lsysc_tracesys: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 551 | lgr %r2,%r11 # pass pointer to pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | la %r3,0 |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 553 | llgh %r0,__PT_INT_CODE+2(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 554 | stg %r0,__PT_R2(%r11) |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 555 | brasl %r14,do_syscall_trace_enter |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 556 | lghi %r0,NR_syscalls |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 557 | clgr %r0,%r2 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 558 | jnh .Lsysc_tracenogo |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 559 | sllg %r8,%r2,2 |
| 560 | lgf %r9,0(%r8,%r10) |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 561 | .Lsysc_tracego: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 562 | lmg %r3,%r7,__PT_R3(%r11) |
| 563 | stg %r7,STACK_FRAME_OVERHEAD(%r15) |
| 564 | lg %r2,__PT_ORIG_GPR2(%r11) |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 565 | BASR_EX %r14,%r9 # call sys_xxx |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 566 | stg %r2,__PT_R2(%r11) # store return value |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 567 | .Lsysc_tracenogo: |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 568 | TSTMSK __TI_flags(%r12),_TIF_TRACE |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 569 | jz .Lsysc_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 570 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 571 | larl %r14,.Lsysc_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 572 | jg do_syscall_trace_exit |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 573 | |
| 574 | # |
| 575 | # a new process exits the kernel with ret_from_fork |
| 576 | # |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 577 | ENTRY(ret_from_fork) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 578 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 579 | lg %r12,__LC_CURRENT |
Al Viro | 30dcb09 | 2012-10-11 15:30:14 -0400 | [diff] [blame] | 580 | brasl %r14,schedule_tail |
| 581 | TRACE_IRQS_ON |
| 582 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 583 | tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ? |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 584 | jne .Lsysc_tracenogo |
Al Viro | 30dcb09 | 2012-10-11 15:30:14 -0400 | [diff] [blame] | 585 | # it's a kernel thread |
| 586 | lmg %r9,%r10,__PT_R9(%r11) # load gprs |
Al Viro | 37fe5d4 | 2012-09-10 18:03:41 -0400 | [diff] [blame] | 587 | ENTRY(kernel_thread_starter) |
| 588 | la %r2,0(%r10) |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 589 | BASR_EX %r14,%r9 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 590 | j .Lsysc_tracenogo |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 591 | |
| 592 | /* |
| 593 | * Program check handler routine |
| 594 | */ |
| 595 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 596 | ENTRY(pgm_check_handler) |
Martin Schwidefsky | c185b78 | 2008-12-25 13:39:25 +0100 | [diff] [blame] | 597 | stpt __LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 598 | BPOFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 599 | stmg %r8,%r15,__LC_SAVE_AREA_SYNC |
| 600 | lg %r10,__LC_LAST_BREAK |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 601 | lg %r12,__LC_CURRENT |
Martin Schwidefsky | c771320 | 2017-10-05 08:44:26 +0200 | [diff] [blame] | 602 | lghi %r11,0 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 603 | larl %r13,cleanup_critical |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 604 | lmg %r8,%r9,__LC_PGM_OLD_PSW |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 605 | tmhh %r8,0x0001 # test problem state bit |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 606 | jnz 2f # -> fault in user space |
| 607 | #if IS_ENABLED(CONFIG_KVM) |
Martin Schwidefsky | 0a5e2ec | 2017-10-05 08:29:47 +0200 | [diff] [blame] | 608 | # cleanup critical section for program checks in sie64a |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 609 | lgr %r14,%r9 |
| 610 | slg %r14,BASED(.Lsie_critical_start) |
| 611 | clg %r14,BASED(.Lsie_critical_length) |
| 612 | jhe 0f |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 613 | lg %r14,__SF_SIE_CONTROL(%r15) # get control block pointer |
Martin Schwidefsky | 0a5e2ec | 2017-10-05 08:29:47 +0200 | [diff] [blame] | 614 | ni __SIE_PROG0C+3(%r14),0xfe # no longer in SIE |
| 615 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
| 616 | larl %r9,sie_exit # skip forward to sie_exit |
Martin Schwidefsky | c771320 | 2017-10-05 08:44:26 +0200 | [diff] [blame] | 617 | lghi %r11,_PIF_GUEST_FAULT |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 618 | #endif |
| 619 | 0: tmhh %r8,0x4000 # PER bit set in old PSW ? |
| 620 | jnz 1f # -> enabled, can't be a double fault |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 621 | tm __LC_PGM_ILC+3,0x80 # check for per exception |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 622 | jnz .Lpgm_svcper # -> single stepped svc |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 623 | 1: CHECK_STACK __LC_SAVE_AREA_SYNC |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 624 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 625 | # CHECK_VMAP_STACK branches to stack_overflow or 4f |
| 626 | CHECK_VMAP_STACK __LC_SAVE_AREA_SYNC,4f |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 627 | 2: UPDATE_VTIME %r14,%r15,__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 628 | BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 629 | lg %r15,__LC_KERNEL_STACK |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 630 | lgr %r14,%r12 |
Martin Schwidefsky | 3827ec3 | 2015-07-20 10:01:46 +0200 | [diff] [blame] | 631 | aghi %r14,__TASK_thread # pointer to thread_struct |
Martin Schwidefsky | d35339a | 2012-07-31 11:03:04 +0200 | [diff] [blame] | 632 | lghi %r13,__LC_PGM_TDB |
| 633 | tm __LC_PGM_ILC+2,0x02 # check for transaction abort |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 634 | jz 3f |
Martin Schwidefsky | d35339a | 2012-07-31 11:03:04 +0200 | [diff] [blame] | 635 | mvc __THREAD_trap_tdb(256,%r14),0(%r13) |
Martin Schwidefsky | d9fcf2a | 2017-02-28 07:42:01 +0100 | [diff] [blame] | 636 | 3: stg %r10,__THREAD_last_break(%r14) |
Martin Schwidefsky | c771320 | 2017-10-05 08:44:26 +0200 | [diff] [blame] | 637 | 4: lgr %r13,%r11 |
| 638 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 639 | stmg %r0,%r7,__PT_R0(%r11) |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 640 | # clear user controlled registers to prevent speculative use |
| 641 | xgr %r0,%r0 |
| 642 | xgr %r1,%r1 |
| 643 | xgr %r2,%r2 |
| 644 | xgr %r3,%r3 |
| 645 | xgr %r4,%r4 |
| 646 | xgr %r5,%r5 |
| 647 | xgr %r6,%r6 |
| 648 | xgr %r7,%r7 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 649 | mvc __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC |
| 650 | stmg %r8,%r9,__PT_PSW(%r11) |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 651 | mvc __PT_INT_CODE(4,%r11),__LC_PGM_ILC |
| 652 | mvc __PT_INT_PARM_LONG(8,%r11),__LC_TRANS_EXC_CODE |
Martin Schwidefsky | c771320 | 2017-10-05 08:44:26 +0200 | [diff] [blame] | 653 | stg %r13,__PT_FLAGS(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 654 | stg %r10,__PT_ARGS(%r11) |
| 655 | tm __LC_PGM_ILC+3,0x80 # check for per exception |
Martin Schwidefsky | d9fcf2a | 2017-02-28 07:42:01 +0100 | [diff] [blame] | 656 | jz 5f |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 657 | tmhh %r8,0x0001 # kernel per event ? |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 658 | jz .Lpgm_kprobe |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 659 | oi __PT_FLAGS+7(%r11),_PIF_PER_TRAP |
Martin Schwidefsky | d35339a | 2012-07-31 11:03:04 +0200 | [diff] [blame] | 660 | mvc __THREAD_per_address(8,%r14),__LC_PER_ADDRESS |
Jens Freimann | 21ee7ff | 2014-02-26 16:32:46 +0100 | [diff] [blame] | 661 | mvc __THREAD_per_cause(2,%r14),__LC_PER_CODE |
| 662 | mvc __THREAD_per_paid(1,%r14),__LC_PER_ACCESS_ID |
Martin Schwidefsky | d9fcf2a | 2017-02-28 07:42:01 +0100 | [diff] [blame] | 663 | 5: REENABLE_IRQS |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 664 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Heiko Carstens | f5cdac2 | 2010-07-27 19:29:37 +0200 | [diff] [blame] | 665 | larl %r1,pgm_check_table |
Martin Schwidefsky | aa33c8c | 2011-12-27 11:27:18 +0100 | [diff] [blame] | 666 | llgh %r10,__PT_INT_CODE+2(%r11) |
| 667 | nill %r10,0x007f |
Heiko Carstens | b01a37a | 2012-10-18 18:10:06 +0200 | [diff] [blame] | 668 | sll %r10,2 |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 669 | je .Lpgm_return |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 670 | lgf %r9,0(%r10,%r1) # load address of handler routine |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 671 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 672 | BASR_EX %r14,%r9 # branch to interrupt-handler |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 673 | .Lpgm_return: |
| 674 | LOCKDEP_SYS_EXIT |
| 675 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 676 | jno .Lsysc_restore |
Martin Schwidefsky | 57d7f93 | 2016-03-22 10:54:24 +0100 | [diff] [blame] | 677 | TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL |
| 678 | jo .Lsysc_do_syscall |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 679 | j .Lsysc_tif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | |
| 681 | # |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 682 | # PER event in supervisor state, must be kprobes |
| 683 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 684 | .Lpgm_kprobe: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 685 | REENABLE_IRQS |
| 686 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 687 | lgr %r2,%r11 # pass pointer to pt_regs |
| 688 | brasl %r14,do_per_trap |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 689 | j .Lpgm_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 690 | |
| 691 | # |
| 692 | # single stepped system call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 693 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 694 | .Lpgm_svcper: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 695 | mvc __LC_RETURN_PSW(8),__LC_SVC_NEW_PSW |
Martin Schwidefsky | d24b98e | 2017-02-20 09:51:36 +0100 | [diff] [blame] | 696 | lghi %r13,__TASK_thread |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 697 | larl %r14,.Lsysc_per |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 698 | stg %r14,__LC_RETURN_PSW+8 |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 699 | lghi %r14,_PIF_SYSCALL | _PIF_PER_TRAP |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 700 | lpswe __LC_RETURN_PSW # branch to .Lsysc_per and enable irqs |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 701 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 702 | /* |
| 703 | * IO interrupt handler routine |
| 704 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 705 | ENTRY(io_int_handler) |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 706 | STCK __LC_INT_CLOCK |
Martin Schwidefsky | 9cfb9b3 | 2008-12-31 15:11:41 +0100 | [diff] [blame] | 707 | stpt __LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 708 | BPOFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 709 | stmg %r8,%r15,__LC_SAVE_AREA_ASYNC |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 710 | lg %r12,__LC_CURRENT |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 711 | larl %r13,cleanup_critical |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 712 | lmg %r8,%r9,__LC_IO_OLD_PSW |
Martin Schwidefsky | 2acb94f | 2015-06-22 17:28:14 +0200 | [diff] [blame] | 713 | SWITCH_ASYNC __LC_SAVE_AREA_ASYNC,__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 714 | stmg %r0,%r7,__PT_R0(%r11) |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 715 | # clear user controlled registers to prevent speculative use |
| 716 | xgr %r0,%r0 |
| 717 | xgr %r1,%r1 |
| 718 | xgr %r2,%r2 |
| 719 | xgr %r3,%r3 |
| 720 | xgr %r4,%r4 |
| 721 | xgr %r5,%r5 |
| 722 | xgr %r6,%r6 |
| 723 | xgr %r7,%r7 |
| 724 | xgr %r10,%r10 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 725 | mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC |
| 726 | stmg %r8,%r9,__PT_PSW(%r11) |
Martin Schwidefsky | 48f6b00 | 2013-06-17 14:54:02 +0200 | [diff] [blame] | 727 | mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 728 | xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11) |
Heiko Carstens | db7e007 | 2015-08-15 11:42:21 +0200 | [diff] [blame] | 729 | TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ |
| 730 | jo .Lio_restore |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 731 | TRACE_IRQS_OFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 732 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 733 | .Lio_loop: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 734 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 1f44a225 | 2013-06-27 09:01:09 +0200 | [diff] [blame] | 735 | lghi %r3,IO_INTERRUPT |
| 736 | tm __PT_INT_CODE+8(%r11),0x80 # adapter interrupt ? |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 737 | jz .Lio_call |
Martin Schwidefsky | 1f44a225 | 2013-06-27 09:01:09 +0200 | [diff] [blame] | 738 | lghi %r3,THIN_INTERRUPT |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 739 | .Lio_call: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 740 | brasl %r14,do_IRQ |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 741 | TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_LPAR |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 742 | jz .Lio_return |
Martin Schwidefsky | 48f6b00 | 2013-06-17 14:54:02 +0200 | [diff] [blame] | 743 | tpi 0 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 744 | jz .Lio_return |
Martin Schwidefsky | 48f6b00 | 2013-06-17 14:54:02 +0200 | [diff] [blame] | 745 | mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 746 | j .Lio_loop |
| 747 | .Lio_return: |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 748 | LOCKDEP_SYS_EXIT |
| 749 | TRACE_IRQS_ON |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 750 | .Lio_tif: |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 751 | TSTMSK __TI_flags(%r12),_TIF_WORK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 752 | jnz .Lio_work # there is work to do (signals etc.) |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 753 | TSTMSK __LC_CPU_FLAGS,_CIF_WORK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 754 | jnz .Lio_work |
| 755 | .Lio_restore: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 756 | lg %r14,__LC_VDSO_PER_CPU |
| 757 | lmg %r0,%r10,__PT_R0(%r11) |
| 758 | mvc __LC_RETURN_PSW(16),__PT_PSW(%r11) |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 759 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
| 760 | jno .Lio_exit_kernel |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 761 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 762 | .Lio_exit_timer: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 763 | stpt __LC_EXIT_TIMER |
| 764 | mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 765 | .Lio_exit_kernel: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 766 | lmg %r11,%r15,__PT_R11(%r11) |
| 767 | lpswe __LC_RETURN_PSW |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 768 | .Lio_done: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 769 | |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 770 | # |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 771 | # There is work todo, find out in which context we have been interrupted: |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 772 | # 1) if we return to user space we can do all _TIF_WORK work |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 773 | # 2) if we return to kernel code and kvm is enabled check if we need to |
| 774 | # modify the psw to leave SIE |
| 775 | # 3) if we return to kernel code and preemptive scheduling is enabled check |
| 776 | # the preemption counter and if it is zero call preempt_schedule_irq |
| 777 | # Before any work can be done, a switch to the kernel stack is required. |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 778 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 779 | .Lio_work: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 780 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 781 | jo .Lio_work_user # yes -> do resched & signal |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 782 | #ifdef CONFIG_PREEMPT |
Martin Schwidefsky | 2688905 | 2008-05-07 09:22:52 +0200 | [diff] [blame] | 783 | # check for preemptive scheduling |
Martin Schwidefsky | c360192 | 2016-10-25 12:21:44 +0200 | [diff] [blame] | 784 | icm %r0,15,__LC_PREEMPT_COUNT |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 785 | jnz .Lio_restore # preemption is disabled |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 786 | TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 787 | jno .Lio_restore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 788 | # switch to kernel stack |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 789 | lg %r1,__PT_R15(%r11) |
| 790 | aghi %r1,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 791 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 792 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) |
| 793 | la %r11,STACK_FRAME_OVERHEAD(%r1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 794 | lgr %r15,%r1 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 795 | # TRACE_IRQS_ON already done at .Lio_return, call |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 796 | # TRACE_IRQS_OFF to keep things symmetrical |
| 797 | TRACE_IRQS_OFF |
| 798 | brasl %r14,preempt_schedule_irq |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 799 | j .Lio_return |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 800 | #else |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 801 | j .Lio_restore |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 802 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 803 | |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 804 | # |
| 805 | # Need to do work before returning to userspace, switch to kernel stack |
| 806 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 807 | .Lio_work_user: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 808 | lg %r1,__LC_KERNEL_STACK |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 809 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 810 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) |
| 811 | la %r11,STACK_FRAME_OVERHEAD(%r1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 812 | lgr %r15,%r1 |
Martin Schwidefsky | 43d399d | 2010-05-17 10:00:01 +0200 | [diff] [blame] | 813 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 814 | # |
| 815 | # One of the work bits is on. Find out which one. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 816 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 817 | .Lio_work_tif: |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 818 | TSTMSK __LC_CPU_FLAGS,_CIF_MCCK_PENDING |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 819 | jo .Lio_mcck_pending |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 820 | TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 821 | jo .Lio_reschedule |
Miroslav Benes | 2f09ca6 | 2017-02-13 19:42:34 -0600 | [diff] [blame] | 822 | #ifdef CONFIG_LIVEPATCH |
| 823 | TSTMSK __TI_flags(%r12),_TIF_PATCH_PENDING |
| 824 | jo .Lio_patch_pending |
| 825 | #endif |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 826 | TSTMSK __TI_flags(%r12),_TIF_SIGPENDING |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 827 | jo .Lio_sigpending |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 828 | TSTMSK __TI_flags(%r12),_TIF_NOTIFY_RESUME |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 829 | jo .Lio_notify_resume |
Martin Schwidefsky | 916cda1 | 2016-01-26 14:10:34 +0100 | [diff] [blame] | 830 | TSTMSK __TI_flags(%r12),_TIF_GUARDED_STORAGE |
| 831 | jo .Lio_guarded_storage |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 832 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 833 | jo .Lio_vxrs |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 834 | TSTMSK __LC_CPU_FLAGS,(_CIF_ASCE_PRIMARY|_CIF_ASCE_SECONDARY) |
| 835 | jnz .Lio_asce |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 836 | j .Lio_return # beware of critical section cleanup |
Christian Borntraeger | 0eaeafa | 2008-05-07 09:22:53 +0200 | [diff] [blame] | 837 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 838 | # |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 839 | # _CIF_MCCK_PENDING is set, call handler |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 840 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 841 | .Lio_mcck_pending: |
| 842 | # TRACE_IRQS_ON already done at .Lio_return |
Heiko Carstens | b771aea | 2007-07-27 12:29:18 +0200 | [diff] [blame] | 843 | brasl %r14,s390_handle_mcck # TIF bit will be cleared by handler |
Martin Schwidefsky | 6a2df3a | 2010-05-17 10:00:02 +0200 | [diff] [blame] | 844 | TRACE_IRQS_OFF |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 845 | j .Lio_return |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 846 | |
| 847 | # |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 848 | # _CIF_ASCE_PRIMARY and/or CIF_ASCE_SECONDARY set, load user space asce |
Heiko Carstens | 457f218 | 2014-03-21 10:42:25 +0100 | [diff] [blame] | 849 | # |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 850 | .Lio_asce: |
Martin Schwidefsky | 0aaba41 | 2017-08-22 12:08:22 +0200 | [diff] [blame] | 851 | ni __LC_CPU_FLAGS+7,255-_CIF_ASCE_SECONDARY |
| 852 | lctlg %c7,%c7,__LC_VDSO_ASCE # load secondary asce |
| 853 | TSTMSK __LC_CPU_FLAGS,_CIF_ASCE_PRIMARY |
| 854 | jz .Lio_return |
| 855 | #ifndef CONFIG_HAVE_MARCH_Z10_FEATURES |
| 856 | tm __LC_STFLE_FAC_LIST+3,0x10 # has MVCOS ? |
| 857 | jnz .Lio_set_fs_fixup |
Heiko Carstens | 606aa4a | 2017-02-17 08:12:30 +0100 | [diff] [blame] | 858 | ni __LC_CPU_FLAGS+7,255-_CIF_ASCE_PRIMARY |
Heiko Carstens | 457f218 | 2014-03-21 10:42:25 +0100 | [diff] [blame] | 859 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
Martin Schwidefsky | 0aaba41 | 2017-08-22 12:08:22 +0200 | [diff] [blame] | 860 | j .Lio_return |
| 861 | .Lio_set_fs_fixup: |
| 862 | #endif |
Heiko Carstens | b5a882f | 2017-02-17 08:13:28 +0100 | [diff] [blame] | 863 | larl %r14,.Lio_return |
| 864 | jg set_fs_fixup |
Heiko Carstens | 457f218 | 2014-03-21 10:42:25 +0100 | [diff] [blame] | 865 | |
| 866 | # |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 867 | # CIF_FPU is set, restore floating-point controls and floating-point registers. |
| 868 | # |
| 869 | .Lio_vxrs: |
| 870 | larl %r14,.Lio_return |
| 871 | jg load_fpu_regs |
| 872 | |
| 873 | # |
Martin Schwidefsky | 916cda1 | 2016-01-26 14:10:34 +0100 | [diff] [blame] | 874 | # _TIF_GUARDED_STORAGE is set, call guarded_storage_load |
| 875 | # |
| 876 | .Lio_guarded_storage: |
| 877 | # TRACE_IRQS_ON already done at .Lio_return |
| 878 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
| 879 | lgr %r2,%r11 # pass pointer to pt_regs |
| 880 | brasl %r14,gs_load_bc_cb |
| 881 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
| 882 | TRACE_IRQS_OFF |
| 883 | j .Lio_return |
| 884 | |
| 885 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | # _TIF_NEED_RESCHED is set, call schedule |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 887 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 888 | .Lio_reschedule: |
| 889 | # TRACE_IRQS_ON already done at .Lio_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 890 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 891 | brasl %r14,schedule # call scheduler |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 892 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 893 | TRACE_IRQS_OFF |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 894 | j .Lio_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 895 | |
| 896 | # |
Miroslav Benes | 2f09ca6 | 2017-02-13 19:42:34 -0600 | [diff] [blame] | 897 | # _TIF_PATCH_PENDING is set, call klp_update_patch_state |
| 898 | # |
| 899 | #ifdef CONFIG_LIVEPATCH |
| 900 | .Lio_patch_pending: |
| 901 | lg %r2,__LC_CURRENT # pass pointer to task struct |
| 902 | larl %r14,.Lio_return |
| 903 | jg klp_update_patch_state |
| 904 | #endif |
| 905 | |
| 906 | # |
Roland McGrath | 02a029b | 2008-04-30 00:53:08 -0700 | [diff] [blame] | 907 | # _TIF_SIGPENDING or is set, call do_signal |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 908 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 909 | .Lio_sigpending: |
| 910 | # TRACE_IRQS_ON already done at .Lio_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 911 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
| 912 | lgr %r2,%r11 # pass pointer to pt_regs |
| 913 | brasl %r14,do_signal |
| 914 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Heiko Carstens | 411788e | 2007-11-20 11:13:32 +0100 | [diff] [blame] | 915 | TRACE_IRQS_OFF |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 916 | j .Lio_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 917 | |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 918 | # |
| 919 | # _TIF_NOTIFY_RESUME or is set, call do_notify_resume |
| 920 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 921 | .Lio_notify_resume: |
| 922 | # TRACE_IRQS_ON already done at .Lio_return |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 923 | ssm __LC_SVC_NEW_PSW # reenable interrupts |
| 924 | lgr %r2,%r11 # pass pointer to pt_regs |
| 925 | brasl %r14,do_notify_resume |
| 926 | ssm __LC_PGM_NEW_PSW # disable I/O and ext. interrupts |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 927 | TRACE_IRQS_OFF |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 928 | j .Lio_return |
Martin Schwidefsky | 753c4dd | 2008-10-10 21:33:20 +0200 | [diff] [blame] | 929 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 930 | /* |
| 931 | * External interrupt handler routine |
| 932 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 933 | ENTRY(ext_int_handler) |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 934 | STCK __LC_INT_CLOCK |
Martin Schwidefsky | 9cfb9b3 | 2008-12-31 15:11:41 +0100 | [diff] [blame] | 935 | stpt __LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 936 | BPOFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 937 | stmg %r8,%r15,__LC_SAVE_AREA_ASYNC |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 938 | lg %r12,__LC_CURRENT |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 939 | larl %r13,cleanup_critical |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 940 | lmg %r8,%r9,__LC_EXT_OLD_PSW |
Martin Schwidefsky | 2acb94f | 2015-06-22 17:28:14 +0200 | [diff] [blame] | 941 | SWITCH_ASYNC __LC_SAVE_AREA_ASYNC,__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 942 | stmg %r0,%r7,__PT_R0(%r11) |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 943 | # clear user controlled registers to prevent speculative use |
| 944 | xgr %r0,%r0 |
| 945 | xgr %r1,%r1 |
| 946 | xgr %r2,%r2 |
| 947 | xgr %r3,%r3 |
| 948 | xgr %r4,%r4 |
| 949 | xgr %r5,%r5 |
| 950 | xgr %r6,%r6 |
| 951 | xgr %r7,%r7 |
| 952 | xgr %r10,%r10 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 953 | mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC |
| 954 | stmg %r8,%r9,__PT_PSW(%r11) |
Martin Schwidefsky | 48f6b00 | 2013-06-17 14:54:02 +0200 | [diff] [blame] | 955 | lghi %r1,__LC_EXT_PARAMS2 |
| 956 | mvc __PT_INT_CODE(4,%r11),__LC_EXT_CPU_ADDR |
| 957 | mvc __PT_INT_PARM(4,%r11),__LC_EXT_PARAMS |
| 958 | mvc __PT_INT_PARM_LONG(8,%r11),0(%r1) |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 959 | xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11) |
Heiko Carstens | db7e007 | 2015-08-15 11:42:21 +0200 | [diff] [blame] | 960 | TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ |
| 961 | jo .Lio_restore |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 962 | TRACE_IRQS_OFF |
Michael Holzheu | 0de9db3 | 2012-05-09 16:27:35 +0200 | [diff] [blame] | 963 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 964 | lgr %r2,%r11 # pass pointer to pt_regs |
Martin Schwidefsky | 1f44a225 | 2013-06-27 09:01:09 +0200 | [diff] [blame] | 965 | lghi %r3,EXT_INTERRUPT |
| 966 | brasl %r14,do_IRQ |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 967 | j .Lio_return |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 968 | |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 969 | /* |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 970 | * Load idle PSW. The second "half" of this function is in .Lcleanup_idle. |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 971 | */ |
| 972 | ENTRY(psw_idle) |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 973 | stg %r3,__SF_EMPTY(%r15) |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 974 | larl %r1,.Lpsw_idle_lpsw+4 |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 975 | stg %r1,__SF_EMPTY+8(%r15) |
Martin Schwidefsky | 72d38b1 | 2015-09-18 16:41:36 +0200 | [diff] [blame] | 976 | #ifdef CONFIG_SMP |
| 977 | larl %r1,smp_cpu_mtid |
| 978 | llgf %r1,0(%r1) |
| 979 | ltgr %r1,%r1 |
| 980 | jz .Lpsw_idle_stcctm |
| 981 | .insn rsy,0xeb0000000017,%r1,5,__SF_EMPTY+16(%r15) |
| 982 | .Lpsw_idle_stcctm: |
| 983 | #endif |
Martin Schwidefsky | 419123f | 2015-11-19 11:09:45 +0100 | [diff] [blame] | 984 | oi __LC_CPU_FLAGS+7,_CIF_ENABLED_WAIT |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 985 | BPON |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 986 | STCK __CLOCK_IDLE_ENTER(%r2) |
| 987 | stpt __TIMER_IDLE_ENTER(%r2) |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 988 | .Lpsw_idle_lpsw: |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 989 | lpswe __SF_EMPTY(%r15) |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 990 | BR_EX %r14 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 991 | .Lpsw_idle_end: |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 992 | |
Hendrik Brueckner | b5510d9 | 2015-09-29 10:04:41 +0200 | [diff] [blame] | 993 | /* |
| 994 | * Store floating-point controls and floating-point or vector register |
| 995 | * depending whether the vector facility is available. A critical section |
| 996 | * cleanup assures that the registers are stored even if interrupted for |
| 997 | * some other work. The CIF_FPU flag is set to trigger a lazy restore |
| 998 | * of the register contents at return from io or a system call. |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 999 | */ |
| 1000 | ENTRY(save_fpu_regs) |
Hendrik Brueckner | d0164ee | 2015-06-29 16:43:06 +0200 | [diff] [blame] | 1001 | lg %r2,__LC_CURRENT |
| 1002 | aghi %r2,__TASK_thread |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1003 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 1004 | jo .Lsave_fpu_regs_exit |
Hendrik Brueckner | d0164ee | 2015-06-29 16:43:06 +0200 | [diff] [blame] | 1005 | stfpc __THREAD_FPU_fpc(%r2) |
Hendrik Brueckner | d0164ee | 2015-06-29 16:43:06 +0200 | [diff] [blame] | 1006 | lg %r3,__THREAD_FPU_regs(%r2) |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1007 | TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1008 | jz .Lsave_fpu_regs_fp # no -> store FP regs |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1009 | VSTM %v0,%v15,0,%r3 # vstm 0,15,0(3) |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1010 | VSTM %v16,%v31,256,%r3 # vstm 16,31,256(3) |
| 1011 | j .Lsave_fpu_regs_done # -> set CIF_FPU flag |
| 1012 | .Lsave_fpu_regs_fp: |
| 1013 | std 0,0(%r3) |
| 1014 | std 1,8(%r3) |
| 1015 | std 2,16(%r3) |
| 1016 | std 3,24(%r3) |
| 1017 | std 4,32(%r3) |
| 1018 | std 5,40(%r3) |
| 1019 | std 6,48(%r3) |
| 1020 | std 7,56(%r3) |
| 1021 | std 8,64(%r3) |
| 1022 | std 9,72(%r3) |
| 1023 | std 10,80(%r3) |
| 1024 | std 11,88(%r3) |
| 1025 | std 12,96(%r3) |
| 1026 | std 13,104(%r3) |
| 1027 | std 14,112(%r3) |
| 1028 | std 15,120(%r3) |
| 1029 | .Lsave_fpu_regs_done: |
| 1030 | oi __LC_CPU_FLAGS+7,_CIF_FPU |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 1031 | .Lsave_fpu_regs_exit: |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1032 | BR_EX %r14 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1033 | .Lsave_fpu_regs_end: |
Al Viro | 711f5df | 2016-01-12 13:30:03 -0500 | [diff] [blame] | 1034 | EXPORT_SYMBOL(save_fpu_regs) |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1035 | |
Hendrik Brueckner | b5510d9 | 2015-09-29 10:04:41 +0200 | [diff] [blame] | 1036 | /* |
| 1037 | * Load floating-point controls and floating-point or vector registers. |
| 1038 | * A critical section cleanup assures that the register contents are |
| 1039 | * loaded even if interrupted for some other work. |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1040 | * |
| 1041 | * There are special calling conventions to fit into sysc and io return work: |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1042 | * %r15: <kernel stack> |
| 1043 | * The function requires: |
Hendrik Brueckner | b5510d9 | 2015-09-29 10:04:41 +0200 | [diff] [blame] | 1044 | * %r4 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1045 | */ |
| 1046 | load_fpu_regs: |
Hendrik Brueckner | d0164ee | 2015-06-29 16:43:06 +0200 | [diff] [blame] | 1047 | lg %r4,__LC_CURRENT |
| 1048 | aghi %r4,__TASK_thread |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1049 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 1050 | jno .Lload_fpu_regs_exit |
Hendrik Brueckner | d0164ee | 2015-06-29 16:43:06 +0200 | [diff] [blame] | 1051 | lfpc __THREAD_FPU_fpc(%r4) |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1052 | TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX |
Hendrik Brueckner | d0164ee | 2015-06-29 16:43:06 +0200 | [diff] [blame] | 1053 | lg %r4,__THREAD_FPU_regs(%r4) # %r4 <- reg save area |
Hendrik Brueckner | b5510d9 | 2015-09-29 10:04:41 +0200 | [diff] [blame] | 1054 | jz .Lload_fpu_regs_fp # -> no VX, load FP regs |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1055 | VLM %v0,%v15,0,%r4 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1056 | VLM %v16,%v31,256,%r4 |
| 1057 | j .Lload_fpu_regs_done |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1058 | .Lload_fpu_regs_fp: |
| 1059 | ld 0,0(%r4) |
| 1060 | ld 1,8(%r4) |
| 1061 | ld 2,16(%r4) |
| 1062 | ld 3,24(%r4) |
| 1063 | ld 4,32(%r4) |
| 1064 | ld 5,40(%r4) |
| 1065 | ld 6,48(%r4) |
| 1066 | ld 7,56(%r4) |
| 1067 | ld 8,64(%r4) |
| 1068 | ld 9,72(%r4) |
| 1069 | ld 10,80(%r4) |
| 1070 | ld 11,88(%r4) |
| 1071 | ld 12,96(%r4) |
| 1072 | ld 13,104(%r4) |
| 1073 | ld 14,112(%r4) |
| 1074 | ld 15,120(%r4) |
| 1075 | .Lload_fpu_regs_done: |
| 1076 | ni __LC_CPU_FLAGS+7,255-_CIF_FPU |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 1077 | .Lload_fpu_regs_exit: |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1078 | BR_EX %r14 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1079 | .Lload_fpu_regs_end: |
| 1080 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1081 | .L__critical_end: |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1082 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1083 | /* |
| 1084 | * Machine check handler routines |
| 1085 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 1086 | ENTRY(mcck_int_handler) |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 1087 | STCK __LC_MCCK_CLOCK |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 1088 | BPOFF |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 1089 | la %r1,4095 # validate r1 |
| 1090 | spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # validate cpu timer |
| 1091 | sckc __LC_CLOCK_COMPARATOR # validate comparator |
| 1092 | lam %a0,%a15,__LC_AREGS_SAVE_AREA-4095(%r1) # validate acrs |
| 1093 | lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# validate gprs |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 1094 | lg %r12,__LC_CURRENT |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1095 | larl %r13,cleanup_critical |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1096 | lmg %r8,%r9,__LC_MCK_OLD_PSW |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1097 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_SYSTEM_DAMAGE |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1098 | jo .Lmcck_panic # yes -> rest of mcck code invalid |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 1099 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_CR_VALID |
| 1100 | jno .Lmcck_panic # control registers invalid -> panic |
| 1101 | la %r14,4095 |
| 1102 | lctlg %c0,%c15,__LC_CREGS_SAVE_AREA-4095(%r14) # validate ctl regs |
| 1103 | ptlb |
Vasily Gorbik | 2a2d7bef | 2017-10-27 12:44:48 +0200 | [diff] [blame] | 1104 | lg %r11,__LC_MCESAD-4095(%r14) # extended machine check save area |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 1105 | nill %r11,0xfc00 # MCESA_ORIGIN_MASK |
| 1106 | TSTMSK __LC_CREGS_SAVE_AREA+16-4095(%r14),CR2_GUARDED_STORAGE |
| 1107 | jno 0f |
| 1108 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_GS_VALID |
| 1109 | jno 0f |
| 1110 | .insn rxy,0xe3000000004d,0,__MCESA_GS_SAVE_AREA(%r11) # LGSC |
| 1111 | 0: l %r14,__LC_FP_CREG_SAVE_AREA-4095(%r14) |
| 1112 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_FC_VALID |
| 1113 | jo 0f |
| 1114 | sr %r14,%r14 |
| 1115 | 0: sfpc %r14 |
| 1116 | TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX |
| 1117 | jo 0f |
| 1118 | lghi %r14,__LC_FPREGS_SAVE_AREA |
| 1119 | ld %f0,0(%r14) |
| 1120 | ld %f1,8(%r14) |
| 1121 | ld %f2,16(%r14) |
| 1122 | ld %f3,24(%r14) |
| 1123 | ld %f4,32(%r14) |
| 1124 | ld %f5,40(%r14) |
| 1125 | ld %f6,48(%r14) |
| 1126 | ld %f7,56(%r14) |
| 1127 | ld %f8,64(%r14) |
| 1128 | ld %f9,72(%r14) |
| 1129 | ld %f10,80(%r14) |
| 1130 | ld %f11,88(%r14) |
| 1131 | ld %f12,96(%r14) |
| 1132 | ld %f13,104(%r14) |
| 1133 | ld %f14,112(%r14) |
| 1134 | ld %f15,120(%r14) |
| 1135 | j 1f |
| 1136 | 0: VLM %v0,%v15,0,%r11 |
| 1137 | VLM %v16,%v31,256,%r11 |
| 1138 | 1: lghi %r14,__LC_CPU_TIMER_SAVE_AREA |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1139 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1140 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_CPU_TIMER_VALID |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1141 | jo 3f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 1142 | la %r14,__LC_SYNC_ENTER_TIMER |
| 1143 | clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER |
| 1144 | jl 0f |
| 1145 | la %r14,__LC_ASYNC_ENTER_TIMER |
| 1146 | 0: clc 0(8,%r14),__LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1147 | jl 1f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 1148 | la %r14,__LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1149 | 1: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER |
| 1150 | jl 2f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 1151 | la %r14,__LC_LAST_UPDATE_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1152 | 2: spt 0(%r14) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1153 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 1154 | 3: TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_MWP_VALID |
| 1155 | jno .Lmcck_panic |
| 1156 | tmhh %r8,0x0001 # interrupting from user ? |
| 1157 | jnz 4f |
| 1158 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_IA_VALID |
| 1159 | jno .Lmcck_panic |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 1160 | 4: ssm __LC_PGM_NEW_PSW # turn dat on, keep irqs off |
| 1161 | SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+64,__LC_MCCK_ENTER_TIMER |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1162 | .Lmcck_skip: |
Martin Schwidefsky | 6551fbd | 2013-02-28 16:28:41 +0100 | [diff] [blame] | 1163 | lghi %r14,__LC_GPREGS_SAVE_AREA+64 |
| 1164 | stmg %r0,%r7,__PT_R0(%r11) |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 1165 | # clear user controlled registers to prevent speculative use |
| 1166 | xgr %r0,%r0 |
| 1167 | xgr %r1,%r1 |
| 1168 | xgr %r2,%r2 |
| 1169 | xgr %r3,%r3 |
| 1170 | xgr %r4,%r4 |
| 1171 | xgr %r5,%r5 |
| 1172 | xgr %r6,%r6 |
| 1173 | xgr %r7,%r7 |
| 1174 | xgr %r10,%r10 |
Martin Schwidefsky | 6551fbd | 2013-02-28 16:28:41 +0100 | [diff] [blame] | 1175 | mvc __PT_R8(64,%r11),0(%r14) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1176 | stmg %r8,%r9,__PT_PSW(%r11) |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 1177 | xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1178 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 1179 | lgr %r2,%r11 # pass pointer to pt_regs |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 1180 | brasl %r14,s390_do_machine_check |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1181 | tm __PT_PSW+1(%r11),0x01 # returning to user ? |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1182 | jno .Lmcck_return |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 1183 | lg %r1,__LC_KERNEL_STACK # switch to kernel stack |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1184 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 1185 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) |
| 1186 | la %r11,STACK_FRAME_OVERHEAD(%r1) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 1187 | lgr %r15,%r1 |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 1188 | TSTMSK __LC_CPU_FLAGS,_CIF_MCCK_PENDING |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1189 | jno .Lmcck_return |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 1190 | TRACE_IRQS_OFF |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 1191 | brasl %r14,s390_handle_mcck |
Heiko Carstens | 1f194a4 | 2006-07-03 00:24:46 -0700 | [diff] [blame] | 1192 | TRACE_IRQS_ON |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1193 | .Lmcck_return: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1194 | lg %r14,__LC_VDSO_PER_CPU |
| 1195 | lmg %r0,%r10,__PT_R0(%r11) |
| 1196 | mvc __LC_RETURN_MCCK_PSW(16),__PT_PSW(%r11) # move return PSW |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 1197 | tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ? |
| 1198 | jno 0f |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 1199 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 1200 | stpt __LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1201 | mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER |
| 1202 | 0: lmg %r11,%r15,__PT_R11(%r11) |
| 1203 | lpswe __LC_RETURN_MCCK_PSW |
| 1204 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1205 | .Lmcck_panic: |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 1206 | lg %r15,__LC_NODAT_STACK |
Martin Schwidefsky | ce4dda3 | 2016-12-02 13:29:22 +0100 | [diff] [blame] | 1207 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1208 | j .Lmcck_skip |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1209 | |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 1210 | # |
| 1211 | # PSW restart interrupt handler |
| 1212 | # |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 1213 | ENTRY(restart_int_handler) |
Martin Schwidefsky | e5b9819 | 2018-03-26 15:23:33 +0200 | [diff] [blame] | 1214 | ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40 |
| 1215 | stg %r15,__LC_SAVE_AREA_RESTART |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 1216 | lg %r15,__LC_RESTART_STACK |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 1217 | xc STACK_FRAME_OVERHEAD(__PT_SIZE,%r15),STACK_FRAME_OVERHEAD(%r15) |
| 1218 | stmg %r0,%r14,STACK_FRAME_OVERHEAD+__PT_R0(%r15) |
| 1219 | mvc STACK_FRAME_OVERHEAD+__PT_R15(8,%r15),__LC_SAVE_AREA_RESTART |
| 1220 | mvc STACK_FRAME_OVERHEAD+__PT_PSW(16,%r15),__LC_RST_OLD_PSW |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 1221 | xc 0(STACK_FRAME_OVERHEAD,%r15),0(%r15) |
Heiko Carstens | fbe7656 | 2012-06-05 09:59:52 +0200 | [diff] [blame] | 1222 | lg %r1,__LC_RESTART_FN # load fn, parm & source cpu |
| 1223 | lg %r2,__LC_RESTART_DATA |
| 1224 | lg %r3,__LC_RESTART_SOURCE |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 1225 | ltgr %r3,%r3 # test source cpu address |
| 1226 | jm 1f # negative -> skip source stop |
Heiko Carstens | eb54619 | 2012-06-04 15:05:43 +0200 | [diff] [blame] | 1227 | 0: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 1228 | brc 10,0b # wait for status stored |
| 1229 | 1: basr %r14,%r1 # call function |
| 1230 | stap __SF_EMPTY(%r15) # store cpu address |
| 1231 | llgh %r3,__SF_EMPTY(%r15) |
Heiko Carstens | eb54619 | 2012-06-04 15:05:43 +0200 | [diff] [blame] | 1232 | 2: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 1233 | brc 2,2b |
| 1234 | 3: j 3b |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 1235 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 1236 | .section .kprobes.text, "ax" |
| 1237 | |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 1238 | #if defined(CONFIG_CHECK_STACK) || defined(CONFIG_VMAP_STACK) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1239 | /* |
| 1240 | * The synchronous or the asynchronous stack overflowed. We are dead. |
| 1241 | * No need to properly save the registers, we are going to panic anyway. |
| 1242 | * Setup a pt_regs so that show_trace can provide a good call trace. |
| 1243 | */ |
| 1244 | stack_overflow: |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 1245 | lg %r15,__LC_NODAT_STACK # change to panic stack |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 1246 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1247 | stmg %r0,%r7,__PT_R0(%r11) |
| 1248 | stmg %r8,%r9,__PT_PSW(%r11) |
| 1249 | mvc __PT_R8(64,%r11),0(%r14) |
| 1250 | stg %r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1251 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 1252 | lgr %r2,%r11 # pass pointer to pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1253 | jg kernel_stack_overflow |
| 1254 | #endif |
| 1255 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1256 | cleanup_critical: |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 1257 | #if IS_ENABLED(CONFIG_KVM) |
| 1258 | clg %r9,BASED(.Lcleanup_table_sie) # .Lsie_gmap |
| 1259 | jl 0f |
| 1260 | clg %r9,BASED(.Lcleanup_table_sie+8)# .Lsie_done |
| 1261 | jl .Lcleanup_sie |
| 1262 | #endif |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1263 | clg %r9,BASED(.Lcleanup_table) # system_call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1264 | jl 0f |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1265 | clg %r9,BASED(.Lcleanup_table+8) # .Lsysc_do_svc |
| 1266 | jl .Lcleanup_system_call |
| 1267 | clg %r9,BASED(.Lcleanup_table+16) # .Lsysc_tif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1268 | jl 0f |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1269 | clg %r9,BASED(.Lcleanup_table+24) # .Lsysc_restore |
| 1270 | jl .Lcleanup_sysc_tif |
| 1271 | clg %r9,BASED(.Lcleanup_table+32) # .Lsysc_done |
| 1272 | jl .Lcleanup_sysc_restore |
| 1273 | clg %r9,BASED(.Lcleanup_table+40) # .Lio_tif |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 1274 | jl 0f |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1275 | clg %r9,BASED(.Lcleanup_table+48) # .Lio_restore |
| 1276 | jl .Lcleanup_io_tif |
| 1277 | clg %r9,BASED(.Lcleanup_table+56) # .Lio_done |
| 1278 | jl .Lcleanup_io_restore |
| 1279 | clg %r9,BASED(.Lcleanup_table+64) # psw_idle |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1280 | jl 0f |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1281 | clg %r9,BASED(.Lcleanup_table+72) # .Lpsw_idle_end |
| 1282 | jl .Lcleanup_idle |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1283 | clg %r9,BASED(.Lcleanup_table+80) # save_fpu_regs |
| 1284 | jl 0f |
| 1285 | clg %r9,BASED(.Lcleanup_table+88) # .Lsave_fpu_regs_end |
| 1286 | jl .Lcleanup_save_fpu_regs |
| 1287 | clg %r9,BASED(.Lcleanup_table+96) # load_fpu_regs |
| 1288 | jl 0f |
| 1289 | clg %r9,BASED(.Lcleanup_table+104) # .Lload_fpu_regs_end |
| 1290 | jl .Lcleanup_load_fpu_regs |
Christian Borntraeger | 891f6a72 | 2018-06-21 14:49:38 +0200 | [diff] [blame] | 1291 | 0: BR_EX %r14,%r11 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1292 | |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 1293 | .align 8 |
| 1294 | .Lcleanup_table: |
| 1295 | .quad system_call |
| 1296 | .quad .Lsysc_do_svc |
| 1297 | .quad .Lsysc_tif |
| 1298 | .quad .Lsysc_restore |
| 1299 | .quad .Lsysc_done |
| 1300 | .quad .Lio_tif |
| 1301 | .quad .Lio_restore |
| 1302 | .quad .Lio_done |
| 1303 | .quad psw_idle |
| 1304 | .quad .Lpsw_idle_end |
| 1305 | .quad save_fpu_regs |
| 1306 | .quad .Lsave_fpu_regs_end |
| 1307 | .quad load_fpu_regs |
| 1308 | .quad .Lload_fpu_regs_end |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 1309 | |
| 1310 | #if IS_ENABLED(CONFIG_KVM) |
| 1311 | .Lcleanup_table_sie: |
| 1312 | .quad .Lsie_gmap |
| 1313 | .quad .Lsie_done |
| 1314 | |
| 1315 | .Lcleanup_sie: |
QingFeng Hao | c929500 | 2017-06-07 11:30:42 +0200 | [diff] [blame] | 1316 | cghi %r11,__LC_SAVE_AREA_ASYNC #Is this in normal interrupt? |
| 1317 | je 1f |
| 1318 | slg %r9,BASED(.Lsie_crit_mcck_start) |
| 1319 | clg %r9,BASED(.Lsie_crit_mcck_length) |
| 1320 | jh 1f |
| 1321 | oi __LC_CPU_FLAGS+7, _CIF_MCCK_GUEST |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 1322 | 1: BPENTER __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST) |
| 1323 | lg %r9,__SF_SIE_CONTROL(%r15) # get control block pointer |
Christian Borntraeger | e22cf8c | 2015-10-06 18:06:15 +0200 | [diff] [blame] | 1324 | ni __SIE_PROG0C+3(%r9),0xfe # no longer in SIE |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 1325 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
| 1326 | larl %r9,sie_exit # skip forward to sie_exit |
Christian Borntraeger | 891f6a72 | 2018-06-21 14:49:38 +0200 | [diff] [blame] | 1327 | BR_EX %r14,%r11 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 1328 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1329 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1330 | .Lcleanup_system_call: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1331 | # check if stpt has been executed |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1332 | clg %r9,BASED(.Lcleanup_system_call_insn) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1333 | jh 0f |
| 1334 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1335 | cghi %r11,__LC_SAVE_AREA_ASYNC |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1336 | je 0f |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1337 | mvc __LC_SYNC_ENTER_TIMER(8),__LC_MCCK_ENTER_TIMER |
| 1338 | 0: # check if stmg has been executed |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1339 | clg %r9,BASED(.Lcleanup_system_call_insn+8) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1340 | jh 0f |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1341 | mvc __LC_SAVE_AREA_SYNC(64),0(%r11) |
| 1342 | 0: # check if base register setup + TIF bit load has been done |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1343 | clg %r9,BASED(.Lcleanup_system_call_insn+16) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1344 | jhe 0f |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 1345 | # set up saved register r12 task struct pointer |
| 1346 | stg %r12,32(%r11) |
| 1347 | # set up saved register r13 __TASK_thread offset |
| 1348 | mvc 40(8,%r11),BASED(.Lcleanup_system_call_const) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1349 | 0: # check if the user time update has been done |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1350 | clg %r9,BASED(.Lcleanup_system_call_insn+24) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1351 | jh 0f |
| 1352 | lg %r15,__LC_EXIT_TIMER |
| 1353 | slg %r15,__LC_SYNC_ENTER_TIMER |
| 1354 | alg %r15,__LC_USER_TIMER |
| 1355 | stg %r15,__LC_USER_TIMER |
| 1356 | 0: # check if the system time update has been done |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1357 | clg %r9,BASED(.Lcleanup_system_call_insn+32) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1358 | jh 0f |
| 1359 | lg %r15,__LC_LAST_UPDATE_TIMER |
| 1360 | slg %r15,__LC_EXIT_TIMER |
| 1361 | alg %r15,__LC_SYSTEM_TIMER |
| 1362 | stg %r15,__LC_SYSTEM_TIMER |
| 1363 | 0: # update accounting time stamp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1364 | mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER |
Martin Schwidefsky | d5feec0 | 2018-02-22 13:42:29 +0100 | [diff] [blame] | 1365 | BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 1366 | # set up saved register r11 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1367 | lg %r15,__LC_KERNEL_STACK |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 1368 | la %r9,STACK_FRAME_OVERHEAD(%r15) |
| 1369 | stg %r9,24(%r11) # r11 pt_regs pointer |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1370 | # fill pt_regs |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 1371 | mvc __PT_R8(64,%r9),__LC_SAVE_AREA_SYNC |
| 1372 | stmg %r0,%r7,__PT_R0(%r9) |
| 1373 | mvc __PT_PSW(16,%r9),__LC_SVC_OLD_PSW |
| 1374 | mvc __PT_INT_CODE(4,%r9),__LC_SVC_ILC |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 1375 | xc __PT_FLAGS(8,%r9),__PT_FLAGS(%r9) |
| 1376 | mvi __PT_FLAGS+7(%r9),_PIF_SYSCALL |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1377 | # setup saved register r15 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1378 | stg %r15,56(%r11) # r15 stack pointer |
| 1379 | # set new psw address and exit |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1380 | larl %r9,.Lsysc_do_svc |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1381 | BR_EX %r14,%r11 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1382 | .Lcleanup_system_call_insn: |
Heiko Carstens | 25d83cb | 2006-09-28 16:56:37 +0200 | [diff] [blame] | 1383 | .quad system_call |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1384 | .quad .Lsysc_stmg |
| 1385 | .quad .Lsysc_per |
Martin Schwidefsky | a359bb1 | 2015-06-22 17:27:48 +0200 | [diff] [blame] | 1386 | .quad .Lsysc_vtime+36 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1387 | .quad .Lsysc_vtime+42 |
Martin Schwidefsky | 34525e1 | 2017-01-25 12:54:17 +0100 | [diff] [blame] | 1388 | .Lcleanup_system_call_const: |
| 1389 | .quad __TASK_thread |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1390 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1391 | .Lcleanup_sysc_tif: |
| 1392 | larl %r9,.Lsysc_tif |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1393 | BR_EX %r14,%r11 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1394 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1395 | .Lcleanup_sysc_restore: |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1396 | # check if stpt has been executed |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1397 | clg %r9,BASED(.Lcleanup_sysc_restore_insn) |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1398 | jh 0f |
| 1399 | mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER |
| 1400 | cghi %r11,__LC_SAVE_AREA_ASYNC |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 1401 | je 0f |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1402 | mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER |
| 1403 | 0: clg %r9,BASED(.Lcleanup_sysc_restore_insn+8) |
| 1404 | je 1f |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1405 | lg %r9,24(%r11) # get saved pointer to pt_regs |
| 1406 | mvc __LC_RETURN_PSW(16),__PT_PSW(%r9) |
| 1407 | mvc 0(64,%r11),__PT_R8(%r9) |
| 1408 | lmg %r0,%r7,__PT_R0(%r9) |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1409 | 1: lmg %r8,%r9,__LC_RETURN_PSW |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1410 | BR_EX %r14,%r11 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1411 | .Lcleanup_sysc_restore_insn: |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1412 | .quad .Lsysc_exit_timer |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1413 | .quad .Lsysc_done - 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1414 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1415 | .Lcleanup_io_tif: |
| 1416 | larl %r9,.Lio_tif |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1417 | BR_EX %r14,%r11 |
Martin Schwidefsky | 176b180 | 2010-04-09 13:43:00 +0200 | [diff] [blame] | 1418 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1419 | .Lcleanup_io_restore: |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1420 | # check if stpt has been executed |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1421 | clg %r9,BASED(.Lcleanup_io_restore_insn) |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1422 | jh 0f |
| 1423 | mvc __LC_EXIT_TIMER(8),__LC_MCCK_ENTER_TIMER |
| 1424 | 0: clg %r9,BASED(.Lcleanup_io_restore_insn+8) |
| 1425 | je 1f |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1426 | lg %r9,24(%r11) # get saved r11 pointer to pt_regs |
| 1427 | mvc __LC_RETURN_PSW(16),__PT_PSW(%r9) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1428 | mvc 0(64,%r11),__PT_R8(%r9) |
| 1429 | lmg %r0,%r7,__PT_R0(%r9) |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1430 | 1: lmg %r8,%r9,__LC_RETURN_PSW |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1431 | BR_EX %r14,%r11 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1432 | .Lcleanup_io_restore_insn: |
Martin Schwidefsky | 07a63cb | 2017-05-02 13:36:00 +0200 | [diff] [blame] | 1433 | .quad .Lio_exit_timer |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1434 | .quad .Lio_done - 4 |
Martin Schwidefsky | ae6aa2e | 2005-09-03 15:57:56 -0700 | [diff] [blame] | 1435 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1436 | .Lcleanup_idle: |
Martin Schwidefsky | 419123f | 2015-11-19 11:09:45 +0100 | [diff] [blame] | 1437 | ni __LC_CPU_FLAGS+7,255-_CIF_ENABLED_WAIT |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1438 | # copy interrupt clock & cpu timer |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1439 | mvc __CLOCK_IDLE_EXIT(8,%r2),__LC_INT_CLOCK |
| 1440 | mvc __TIMER_IDLE_EXIT(8,%r2),__LC_ASYNC_ENTER_TIMER |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1441 | cghi %r11,__LC_SAVE_AREA_ASYNC |
| 1442 | je 0f |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1443 | mvc __CLOCK_IDLE_EXIT(8,%r2),__LC_MCCK_CLOCK |
| 1444 | mvc __TIMER_IDLE_EXIT(8,%r2),__LC_MCCK_ENTER_TIMER |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1445 | 0: # check if stck & stpt have been executed |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1446 | clg %r9,BASED(.Lcleanup_idle_insn) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1447 | jhe 1f |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1448 | mvc __CLOCK_IDLE_ENTER(8,%r2),__CLOCK_IDLE_EXIT(%r2) |
| 1449 | mvc __TIMER_IDLE_ENTER(8,%r2),__TIMER_IDLE_EXIT(%r2) |
Martin Schwidefsky | 72d38b1 | 2015-09-18 16:41:36 +0200 | [diff] [blame] | 1450 | 1: # calculate idle cycles |
| 1451 | #ifdef CONFIG_SMP |
| 1452 | clg %r9,BASED(.Lcleanup_idle_insn) |
| 1453 | jl 3f |
| 1454 | larl %r1,smp_cpu_mtid |
| 1455 | llgf %r1,0(%r1) |
| 1456 | ltgr %r1,%r1 |
| 1457 | jz 3f |
| 1458 | .insn rsy,0xeb0000000017,%r1,5,__SF_EMPTY+80(%r15) |
| 1459 | larl %r3,mt_cycles |
| 1460 | ag %r3,__LC_PERCPU_OFFSET |
| 1461 | la %r4,__SF_EMPTY+16(%r15) |
| 1462 | 2: lg %r0,0(%r3) |
| 1463 | slg %r0,0(%r4) |
| 1464 | alg %r0,64(%r4) |
| 1465 | stg %r0,0(%r3) |
| 1466 | la %r3,8(%r3) |
| 1467 | la %r4,8(%r4) |
| 1468 | brct %r1,2b |
| 1469 | #endif |
| 1470 | 3: # account system time going idle |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1471 | lg %r9,__LC_STEAL_TIMER |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1472 | alg %r9,__CLOCK_IDLE_ENTER(%r2) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1473 | slg %r9,__LC_LAST_UPDATE_CLOCK |
| 1474 | stg %r9,__LC_STEAL_TIMER |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1475 | mvc __LC_LAST_UPDATE_CLOCK(8),__CLOCK_IDLE_EXIT(%r2) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1476 | lg %r9,__LC_SYSTEM_TIMER |
| 1477 | alg %r9,__LC_LAST_UPDATE_TIMER |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1478 | slg %r9,__TIMER_IDLE_ENTER(%r2) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1479 | stg %r9,__LC_SYSTEM_TIMER |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 1480 | mvc __LC_LAST_UPDATE_TIMER(8),__TIMER_IDLE_EXIT(%r2) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1481 | # prepare return psw |
Martin Schwidefsky | 0587d40 | 2013-08-23 14:45:58 +0200 | [diff] [blame] | 1482 | nihh %r8,0xfcfd # clear irq & wait state bits |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1483 | lg %r9,48(%r11) # return from psw_idle |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1484 | BR_EX %r14,%r11 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1485 | .Lcleanup_idle_insn: |
| 1486 | .quad .Lpsw_idle_lpsw |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 1487 | |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1488 | .Lcleanup_save_fpu_regs: |
Martin Schwidefsky | e370e47 | 2016-03-10 09:52:55 +0100 | [diff] [blame] | 1489 | larl %r9,save_fpu_regs |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1490 | BR_EX %r14,%r11 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1491 | |
| 1492 | .Lcleanup_load_fpu_regs: |
Martin Schwidefsky | e370e47 | 2016-03-10 09:52:55 +0100 | [diff] [blame] | 1493 | larl %r9,load_fpu_regs |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 1494 | BR_EX %r14,%r11 |
Hendrik Brueckner | 9977e88 | 2015-06-10 12:53:42 +0200 | [diff] [blame] | 1495 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1496 | /* |
| 1497 | * Integer constants |
| 1498 | */ |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1499 | .align 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1500 | .Lcritical_start: |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1501 | .quad .L__critical_start |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 1502 | .Lcritical_length: |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1503 | .quad .L__critical_end - .L__critical_start |
Heiko Carstens | 61aa488 | 2013-11-01 10:08:20 +0100 | [diff] [blame] | 1504 | #if IS_ENABLED(CONFIG_KVM) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 1505 | .Lsie_critical_start: |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1506 | .quad .Lsie_gmap |
Martin Schwidefsky | 7c47053 | 2013-05-17 14:41:37 +0200 | [diff] [blame] | 1507 | .Lsie_critical_length: |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 1508 | .quad .Lsie_done - .Lsie_gmap |
QingFeng Hao | c929500 | 2017-06-07 11:30:42 +0200 | [diff] [blame] | 1509 | .Lsie_crit_mcck_start: |
| 1510 | .quad .Lsie_entry |
| 1511 | .Lsie_crit_mcck_length: |
| 1512 | .quad .Lsie_skip - .Lsie_entry |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 1513 | #endif |
Heiko Carstens | a876cb3 | 2015-02-13 14:44:29 +0100 | [diff] [blame] | 1514 | .section .rodata, "a" |
| 1515 | #define SYSCALL(esame,emu) .long esame |
Heiko Carstens | 9bf1226 | 2009-06-12 10:26:47 +0200 | [diff] [blame] | 1516 | .globl sys_call_table |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1517 | sys_call_table: |
Hendrik Brueckner | 4381f9f | 2017-12-11 14:47:27 +0100 | [diff] [blame] | 1518 | #include "asm/syscall_table.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1519 | #undef SYSCALL |
| 1520 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 1521 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1522 | |
Heiko Carstens | a876cb3 | 2015-02-13 14:44:29 +0100 | [diff] [blame] | 1523 | #define SYSCALL(esame,emu) .long emu |
Martin Schwidefsky | 6164988 | 2013-04-24 12:58:39 +0200 | [diff] [blame] | 1524 | .globl sys_call_table_emu |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1525 | sys_call_table_emu: |
Hendrik Brueckner | 4381f9f | 2017-12-11 14:47:27 +0100 | [diff] [blame] | 1526 | #include "asm/syscall_table.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1527 | #undef SYSCALL |
| 1528 | #endif |