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 | |
Martin Schwidefsky | e5b9819 | 2018-03-26 15:23:33 +0200 | [diff] [blame] | 54 | _LPP_OFFSET = __LC_LPP |
| 55 | |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 56 | .macro CHECK_STACK savearea |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 57 | #ifdef CONFIG_CHECK_STACK |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 58 | tml %r15,STACK_SIZE - CONFIG_STACK_GUARD |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 59 | lghi %r14,\savearea |
| 60 | jz stack_overflow |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 61 | #endif |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 62 | .endm |
| 63 | |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 64 | .macro CHECK_VMAP_STACK savearea,oklabel |
| 65 | #ifdef CONFIG_VMAP_STACK |
| 66 | lgr %r14,%r15 |
| 67 | nill %r14,0x10000 - STACK_SIZE |
| 68 | oill %r14,STACK_INIT |
| 69 | clg %r14,__LC_KERNEL_STACK |
| 70 | je \oklabel |
| 71 | clg %r14,__LC_ASYNC_STACK |
| 72 | je \oklabel |
Sven Schnelle | b61b159 | 2021-02-03 09:02:51 +0100 | [diff] [blame] | 73 | clg %r14,__LC_MCCK_STACK |
| 74 | je \oklabel |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 75 | clg %r14,__LC_NODAT_STACK |
| 76 | je \oklabel |
| 77 | clg %r14,__LC_RESTART_STACK |
| 78 | je \oklabel |
| 79 | lghi %r14,\savearea |
| 80 | j stack_overflow |
| 81 | #else |
| 82 | j \oklabel |
| 83 | #endif |
| 84 | .endm |
| 85 | |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 86 | .macro STCK savearea |
Heiko Carstens | 78f6570 | 2021-02-02 13:46:47 +0100 | [diff] [blame] | 87 | ALTERNATIVE ".insn s,0xb2050000,\savearea", \ |
| 88 | ".insn s,0xb27c0000,\savearea", 25 |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 89 | .endm |
| 90 | |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 91 | /* |
| 92 | * The TSTMSK macro generates a test-under-mask instruction by |
| 93 | * calculating the memory offset for the specified mask value. |
| 94 | * Mask value can be any constant. The macro shifts the mask |
| 95 | * value to calculate the memory offset for the test-under-mask |
| 96 | * instruction. |
| 97 | */ |
| 98 | .macro TSTMSK addr, mask, size=8, bytepos=0 |
| 99 | .if (\bytepos < \size) && (\mask >> 8) |
| 100 | .if (\mask & 0xff) |
| 101 | .error "Mask exceeds byte boundary" |
| 102 | .endif |
| 103 | TSTMSK \addr, "(\mask >> 8)", \size, "(\bytepos + 1)" |
| 104 | .exitm |
| 105 | .endif |
| 106 | .ifeq \mask |
| 107 | .error "Mask must not be zero" |
| 108 | .endif |
| 109 | off = \size - \bytepos - 1 |
| 110 | tm off+\addr, \mask |
| 111 | .endm |
| 112 | |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 113 | .macro BPOFF |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 114 | ALTERNATIVE "", ".long 0xb2e8c000", 82 |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 115 | .endm |
| 116 | |
| 117 | .macro BPON |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 118 | ALTERNATIVE "", ".long 0xb2e8d000", 82 |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 119 | .endm |
| 120 | |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 121 | .macro BPENTER tif_ptr,tif_mask |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 122 | ALTERNATIVE "TSTMSK \tif_ptr,\tif_mask; jz .+8; .long 0xb2e8d000", \ |
| 123 | "", 82 |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 124 | .endm |
| 125 | |
| 126 | .macro BPEXIT tif_ptr,tif_mask |
| 127 | TSTMSK \tif_ptr,\tif_mask |
Martin Schwidefsky | b058661 | 2018-03-26 15:27:36 +0200 | [diff] [blame] | 128 | ALTERNATIVE "jz .+8; .long 0xb2e8c000", \ |
| 129 | "jnz .+8; .long 0xb2e8d000", 82 |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 130 | .endm |
| 131 | |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 132 | GEN_BR_THUNK %r14 |
Sven Schnelle | 33ea048 | 2021-02-03 17:46:12 +0100 | [diff] [blame] | 133 | GEN_BR_THUNK %r14,%r13 |
Martin Schwidefsky | f19fbd5 | 2018-01-26 12:46:47 +0100 | [diff] [blame] | 134 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 135 | .section .kprobes.text, "ax" |
Heiko Carstens | 46210c4 | 2016-06-30 12:40:25 +0200 | [diff] [blame] | 136 | .Ldummy: |
| 137 | /* |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 138 | * This nop exists only in order to avoid that __bpon starts at |
Heiko Carstens | 46210c4 | 2016-06-30 12:40:25 +0200 | [diff] [blame] | 139 | * the beginning of the kprobes text section. In that case we would |
| 140 | * have several symbols at the same address. E.g. objdump would take |
| 141 | * an arbitrary symbol name when disassembling this code. |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 142 | * With the added nop in between the __bpon symbol is unique |
Heiko Carstens | 46210c4 | 2016-06-30 12:40:25 +0200 | [diff] [blame] | 143 | * again. |
| 144 | */ |
| 145 | nop 0 |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 146 | |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 147 | ENTRY(__bpon) |
| 148 | .globl __bpon |
| 149 | BPON |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 150 | BR_EX %r14 |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 151 | ENDPROC(__bpon) |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 152 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | /* |
| 154 | * Scheduler resume function, called by switch_to |
| 155 | * gpr2 = (task_struct *) prev |
| 156 | * gpr3 = (task_struct *) next |
| 157 | * Returns: |
| 158 | * gpr2 = prev |
| 159 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 160 | ENTRY(__switch_to) |
Martin Schwidefsky | eda0c6d | 2012-05-15 09:20:06 +0200 | [diff] [blame] | 161 | stmg %r6,%r15,__SF_GPRS(%r15) # store gprs of prev task |
Heiko Carstens | 3241d3e | 2017-11-16 14:54:04 +0100 | [diff] [blame] | 162 | lghi %r4,__TASK_stack |
| 163 | lghi %r1,__TASK_thread |
Vasily Gorbik | 9fed920 | 2018-10-26 15:29:59 +0200 | [diff] [blame] | 164 | llill %r5,STACK_INIT |
Heiko Carstens | 3241d3e | 2017-11-16 14:54:04 +0100 | [diff] [blame] | 165 | stg %r15,__THREAD_ksp(%r1,%r2) # store kernel stack of prev |
Vasily Gorbik | 9fed920 | 2018-10-26 15:29:59 +0200 | [diff] [blame] | 166 | lg %r15,0(%r4,%r3) # start of kernel stack of next |
| 167 | agr %r15,%r5 # end of kernel stack of next |
Martin Schwidefsky | eda0c6d | 2012-05-15 09:20:06 +0200 | [diff] [blame] | 168 | stg %r3,__LC_CURRENT # store task struct of next |
Martin Schwidefsky | eda0c6d | 2012-05-15 09:20:06 +0200 | [diff] [blame] | 169 | stg %r15,__LC_KERNEL_STACK # store end of kernel stack |
Heiko Carstens | 3241d3e | 2017-11-16 14:54:04 +0100 | [diff] [blame] | 170 | lg %r15,__THREAD_ksp(%r1,%r3) # load kernel stack of next |
| 171 | aghi %r3,__TASK_pid |
| 172 | mvc __LC_CURRENT_PID(4,%r0),0(%r3) # store pid of next |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 173 | lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task |
Martin Schwidefsky | e5b9819 | 2018-03-26 15:23:33 +0200 | [diff] [blame] | 174 | ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40 |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 175 | BR_EX %r14 |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 176 | ENDPROC(__switch_to) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 178 | #if IS_ENABLED(CONFIG_KVM) |
| 179 | /* |
| 180 | * sie64a calling convention: |
| 181 | * %r2 pointer to sie control block |
| 182 | * %r3 guest register save area |
| 183 | */ |
| 184 | ENTRY(sie64a) |
| 185 | stmg %r6,%r14,__SF_GPRS(%r15) # save kernel registers |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 186 | lg %r12,__LC_CURRENT |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 187 | stg %r2,__SF_SIE_CONTROL(%r15) # save control block pointer |
| 188 | stg %r3,__SF_SIE_SAVEAREA(%r15) # save guest register save area |
| 189 | xc __SF_SIE_REASON(8,%r15),__SF_SIE_REASON(%r15) # reason code = 0 |
| 190 | mvc __SF_SIE_FLAGS(8,%r15),__TI_flags(%r12) # copy thread flags |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 191 | lmg %r0,%r13,0(%r3) # load guest gprs 0-13 |
| 192 | lg %r14,__LC_GMAP # get gmap pointer |
| 193 | ltgr %r14,%r14 |
| 194 | jz .Lsie_gmap |
| 195 | lctlg %c1,%c1,__GMAP_ASCE(%r14) # load primary asce |
| 196 | .Lsie_gmap: |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 197 | lg %r14,__SF_SIE_CONTROL(%r15) # get control block pointer |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 198 | oi __SIE_PROG0C+3(%r14),1 # we are going into SIE now |
| 199 | tm __SIE_PROG20+3(%r14),3 # last exit... |
| 200 | jnz .Lsie_skip |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 201 | TSTMSK __LC_CPU_FLAGS,_CIF_FPU |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 202 | jo .Lsie_skip # exit if fp/vx regs changed |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 203 | BPEXIT __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST) |
QingFeng Hao | c929500 | 2017-06-07 11:30:42 +0200 | [diff] [blame] | 204 | .Lsie_entry: |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 205 | sie 0(%r14) |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 206 | BPOFF |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 207 | BPENTER __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 208 | .Lsie_skip: |
| 209 | ni __SIE_PROG0C+3(%r14),0xfe # no longer in SIE |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 210 | lctlg %c1,%c1,__LC_KERNEL_ASCE # load primary asce |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 211 | .Lsie_done: |
| 212 | # some program checks are suppressing. C code (e.g. do_protection_exception) |
Christian Borntraeger | c0e7bb3 | 2017-05-15 14:11:03 +0200 | [diff] [blame] | 213 | # will rewind the PSW by the ILC, which is often 4 bytes in case of SIE. There |
| 214 | # are some corner cases (e.g. runtime instrumentation) where ILC is unpredictable. |
| 215 | # Other instructions between sie64a and .Lsie_done should not cause program |
| 216 | # interrupts. So lets use 3 nops as a landing pad for all possible rewinds. |
Sven Schnelle | efa5473 | 2021-02-03 17:50:00 +0100 | [diff] [blame] | 217 | # See also .Lcleanup_sie_mcck/.Lcleanup_sie_int |
Christian Borntraeger | c0e7bb3 | 2017-05-15 14:11:03 +0200 | [diff] [blame] | 218 | .Lrewind_pad6: |
| 219 | nopr 7 |
| 220 | .Lrewind_pad4: |
| 221 | nopr 7 |
| 222 | .Lrewind_pad2: |
| 223 | nopr 7 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 224 | .globl sie_exit |
| 225 | sie_exit: |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 226 | lg %r14,__SF_SIE_SAVEAREA(%r15) # load guest register save area |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 227 | stmg %r0,%r13,0(%r14) # save guest gprs 0-13 |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 228 | xgr %r0,%r0 # clear guest registers to |
| 229 | xgr %r1,%r1 # prevent speculative use |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 230 | xgr %r3,%r3 |
| 231 | xgr %r4,%r4 |
| 232 | xgr %r5,%r5 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 233 | lmg %r6,%r14,__SF_GPRS(%r15) # restore kernel registers |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 234 | lg %r2,__SF_SIE_REASON(%r15) # return exit reason code |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 235 | BR_EX %r14 |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 236 | .Lsie_fault: |
| 237 | lghi %r14,-EFAULT |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 238 | stg %r14,__SF_SIE_REASON(%r15) # set exit reason code |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 239 | j sie_exit |
| 240 | |
Christian Borntraeger | c0e7bb3 | 2017-05-15 14:11:03 +0200 | [diff] [blame] | 241 | EX_TABLE(.Lrewind_pad6,.Lsie_fault) |
| 242 | EX_TABLE(.Lrewind_pad4,.Lsie_fault) |
| 243 | EX_TABLE(.Lrewind_pad2,.Lsie_fault) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 244 | EX_TABLE(sie_exit,.Lsie_fault) |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 245 | ENDPROC(sie64a) |
Al Viro | 711f5df | 2016-01-12 13:30:03 -0500 | [diff] [blame] | 246 | EXPORT_SYMBOL(sie64a) |
| 247 | EXPORT_SYMBOL(sie_exit) |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 248 | #endif |
| 249 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | /* |
| 251 | * SVC interrupt handler routine. System calls are synchronous events and |
Christian Borntraeger | 7b7735c | 2020-07-07 14:07:53 +0200 | [diff] [blame] | 252 | * are entered with interrupts disabled. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | */ |
| 254 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 255 | ENTRY(system_call) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 256 | stpt __LC_SYS_ENTER_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 257 | stmg %r8,%r15,__LC_SAVE_AREA_SYNC |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 258 | BPOFF |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 259 | lghi %r14,0 |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 260 | .Lsysc_per: |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 261 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 262 | lg %r12,__LC_CURRENT |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 263 | lg %r15,__LC_KERNEL_STACK |
Heiko Carstens | 9365965 | 2020-12-04 17:56:57 +0100 | [diff] [blame] | 264 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 265 | stmg %r0,%r7,STACK_FRAME_OVERHEAD+__PT_R0(%r15) |
| 266 | BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Christian Borntraeger | d3f4689 | 2018-03-05 19:18:47 +0000 | [diff] [blame] | 267 | # clear user controlled register to prevent speculative use |
| 268 | xgr %r0,%r0 |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 269 | xgr %r1,%r1 |
| 270 | xgr %r4,%r4 |
| 271 | xgr %r5,%r5 |
| 272 | xgr %r6,%r6 |
| 273 | xgr %r7,%r7 |
| 274 | xgr %r8,%r8 |
| 275 | xgr %r9,%r9 |
| 276 | xgr %r10,%r10 |
| 277 | xgr %r11,%r11 |
| 278 | la %r2,STACK_FRAME_OVERHEAD(%r15) # pointer to pt_regs |
| 279 | lgr %r3,%r14 |
| 280 | brasl %r14,__do_syscall |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 281 | lctlg %c1,%c1,__LC_USER_ASCE |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 282 | mvc __LC_RETURN_PSW(16),STACK_FRAME_OVERHEAD+__PT_PSW(%r15) |
| 283 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
| 284 | lmg %r0,%r15,STACK_FRAME_OVERHEAD+__PT_R0(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 285 | stpt __LC_EXIT_TIMER |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 286 | b __LC_RETURN_LPSWE |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 287 | ENDPROC(system_call) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | |
| 289 | # |
| 290 | # a new process exits the kernel with ret_from_fork |
| 291 | # |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 292 | ENTRY(ret_from_fork) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 293 | lgr %r3,%r11 |
| 294 | brasl %r14,__ret_from_fork |
| 295 | lctlg %c1,%c1,__LC_USER_ASCE |
| 296 | mvc __LC_RETURN_PSW(16),STACK_FRAME_OVERHEAD+__PT_PSW(%r15) |
| 297 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
| 298 | lmg %r0,%r15,STACK_FRAME_OVERHEAD+__PT_R0(%r15) |
| 299 | stpt __LC_EXIT_TIMER |
| 300 | b __LC_RETURN_LPSWE |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 301 | ENDPROC(ret_from_fork) |
| 302 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | /* |
| 304 | * Program check handler routine |
| 305 | */ |
| 306 | |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 307 | ENTRY(pgm_check_handler) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 308 | stpt __LC_SYS_ENTER_TIMER |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 309 | BPOFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 310 | stmg %r8,%r15,__LC_SAVE_AREA_SYNC |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 311 | lg %r12,__LC_CURRENT |
| 312 | lghi %r10,0 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 313 | lmg %r8,%r9,__LC_PGM_OLD_PSW |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 314 | tmhh %r8,0x0001 # coming from user space? |
| 315 | jno .Lpgm_skip_asce |
| 316 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 317 | j 3f # -> fault in user space |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 318 | .Lpgm_skip_asce: |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 319 | #if IS_ENABLED(CONFIG_KVM) |
Martin Schwidefsky | 0a5e2ec | 2017-10-05 08:29:47 +0200 | [diff] [blame] | 320 | # cleanup critical section for program checks in sie64a |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 321 | lgr %r14,%r9 |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 322 | larl %r13,.Lsie_gmap |
| 323 | slgr %r14,%r13 |
| 324 | lghi %r13,.Lsie_done - .Lsie_gmap |
| 325 | clgr %r14,%r13 |
Sven Schnelle | 0b38b5e | 2020-01-22 13:38:22 +0100 | [diff] [blame] | 326 | jhe 1f |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 327 | lg %r14,__SF_SIE_CONTROL(%r15) # get control block pointer |
Martin Schwidefsky | 0a5e2ec | 2017-10-05 08:29:47 +0200 | [diff] [blame] | 328 | ni __SIE_PROG0C+3(%r14),0xfe # no longer in SIE |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 329 | lctlg %c1,%c1,__LC_KERNEL_ASCE # load primary asce |
Martin Schwidefsky | 0a5e2ec | 2017-10-05 08:29:47 +0200 | [diff] [blame] | 330 | larl %r9,sie_exit # skip forward to sie_exit |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 331 | lghi %r10,_PIF_GUEST_FAULT |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 332 | #endif |
Sven Schnelle | 0b38b5e | 2020-01-22 13:38:22 +0100 | [diff] [blame] | 333 | 1: tmhh %r8,0x4000 # PER bit set in old PSW ? |
| 334 | jnz 2f # -> enabled, can't be a double fault |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 335 | tm __LC_PGM_ILC+3,0x80 # check for per exception |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 336 | jnz .Lpgm_svcper # -> single stepped svc |
Sven Schnelle | 0b38b5e | 2020-01-22 13:38:22 +0100 | [diff] [blame] | 337 | 2: CHECK_STACK __LC_SAVE_AREA_SYNC |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 338 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 339 | # CHECK_VMAP_STACK branches to stack_overflow or 4f |
| 340 | CHECK_VMAP_STACK __LC_SAVE_AREA_SYNC,4f |
| 341 | 3: BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 342 | lg %r15,__LC_KERNEL_STACK |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 343 | 4: la %r11,STACK_FRAME_OVERHEAD(%r15) |
| 344 | stg %r10,__PT_FLAGS(%r11) |
| 345 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 346 | stmg %r0,%r7,__PT_R0(%r11) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 347 | mvc __PT_R8(64,%r11),__LC_SAVE_AREA_SYNC |
| 348 | stmg %r8,%r9,__PT_PSW(%r11) |
| 349 | |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 350 | # clear user controlled registers to prevent speculative use |
| 351 | xgr %r0,%r0 |
| 352 | xgr %r1,%r1 |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 353 | xgr %r3,%r3 |
| 354 | xgr %r4,%r4 |
| 355 | xgr %r5,%r5 |
| 356 | xgr %r6,%r6 |
| 357 | xgr %r7,%r7 |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 358 | lgr %r2,%r11 |
| 359 | brasl %r14,__do_pgm_check |
| 360 | tmhh %r8,0x0001 # returning to user space? |
| 361 | jno .Lpgm_exit_kernel |
| 362 | lctlg %c1,%c1,__LC_USER_ASCE |
| 363 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
Heiko Carstens | 0cd9b72 | 2020-11-11 18:46:26 +0100 | [diff] [blame] | 364 | stpt __LC_EXIT_TIMER |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 365 | .Lpgm_exit_kernel: |
| 366 | mvc __LC_RETURN_PSW(16),STACK_FRAME_OVERHEAD+__PT_PSW(%r15) |
| 367 | lmg %r0,%r15,STACK_FRAME_OVERHEAD+__PT_R0(%r15) |
Heiko Carstens | 0cd9b72 | 2020-11-11 18:46:26 +0100 | [diff] [blame] | 368 | b __LC_RETURN_LPSWE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 369 | |
| 370 | # |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 371 | # single stepped system call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 372 | # |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 373 | .Lpgm_svcper: |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 374 | mvc __LC_RETURN_PSW(8),__LC_SVC_NEW_PSW |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 375 | larl %r14,.Lsysc_per |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 376 | stg %r14,__LC_RETURN_PSW+8 |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 377 | lghi %r14,1 |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 378 | lpswe __LC_RETURN_PSW # branch to .Lsysc_per |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 379 | ENDPROC(pgm_check_handler) |
Michael Grundy | 4ba069b | 2006-09-20 15:58:39 +0200 | [diff] [blame] | 380 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | /* |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 382 | * Interrupt handler macro used for external and IO interrupts. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | */ |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 384 | .macro INT_HANDLER name,lc_old_psw,handler |
| 385 | ENTRY(\name) |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 386 | STCK __LC_INT_CLOCK |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 387 | stpt __LC_SYS_ENTER_TIMER |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 388 | BPOFF |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 389 | stmg %r8,%r15,__LC_SAVE_AREA_ASYNC |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 390 | lg %r12,__LC_CURRENT |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 391 | lmg %r8,%r9,\lc_old_psw |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 392 | tmhh %r8,0x0001 # interrupting from user ? |
| 393 | jnz 1f |
| 394 | #if IS_ENABLED(CONFIG_KVM) |
| 395 | lgr %r14,%r9 |
| 396 | larl %r13,.Lsie_gmap |
| 397 | slgr %r14,%r13 |
| 398 | lghi %r13,.Lsie_done - .Lsie_gmap |
| 399 | clgr %r14,%r13 |
| 400 | jhe 0f |
Sven Schnelle | efa5473 | 2021-02-03 17:50:00 +0100 | [diff] [blame] | 401 | brasl %r14,.Lcleanup_sie_int |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 402 | #endif |
| 403 | 0: CHECK_STACK __LC_SAVE_AREA_ASYNC |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 404 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 405 | j 2f |
| 406 | 1: BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
| 407 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
| 408 | lg %r15,__LC_KERNEL_STACK |
Vasily Gorbik | b74e409 | 2021-04-09 00:13:18 +0200 | [diff] [blame] | 409 | 2: xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 410 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 411 | stmg %r0,%r7,__PT_R0(%r11) |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 412 | # clear user controlled registers to prevent speculative use |
| 413 | xgr %r0,%r0 |
| 414 | xgr %r1,%r1 |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 415 | xgr %r3,%r3 |
| 416 | xgr %r4,%r4 |
| 417 | xgr %r5,%r5 |
| 418 | xgr %r6,%r6 |
| 419 | xgr %r7,%r7 |
| 420 | xgr %r10,%r10 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 421 | mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC |
| 422 | stmg %r8,%r9,__PT_PSW(%r11) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 423 | tm %r8,0x0001 # coming from user space? |
| 424 | jno 1f |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 425 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 426 | 1: lgr %r2,%r11 # pass pointer to pt_regs |
| 427 | brasl %r14,\handler |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 428 | mvc __LC_RETURN_PSW(16),__PT_PSW(%r11) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 429 | tmhh %r8,0x0001 # returning to user ? |
| 430 | jno 2f |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 431 | lctlg %c1,%c1,__LC_USER_ASCE |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 432 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 433 | stpt __LC_EXIT_TIMER |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 434 | 2: lmg %r0,%r15,__PT_R0(%r11) |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 435 | b __LC_RETURN_LPSWE |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 436 | ENDPROC(\name) |
| 437 | .endm |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 439 | INT_HANDLER ext_int_handler,__LC_EXT_OLD_PSW,do_ext_irq |
| 440 | INT_HANDLER io_int_handler,__LC_IO_OLD_PSW,do_io_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 442 | /* |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 443 | * Load idle PSW. |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 444 | */ |
| 445 | ENTRY(psw_idle) |
Vasily Gorbik | a994edd | 2021-04-09 00:15:21 +0200 | [diff] [blame] | 446 | stg %r14,(__SF_GPRS+8*8)(%r15) |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 447 | stg %r3,__SF_EMPTY(%r15) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 448 | larl %r1,psw_idle_exit |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 449 | stg %r1,__SF_EMPTY+8(%r15) |
Martin Schwidefsky | 72d38b1 | 2015-09-18 16:41:36 +0200 | [diff] [blame] | 450 | larl %r1,smp_cpu_mtid |
| 451 | llgf %r1,0(%r1) |
| 452 | ltgr %r1,%r1 |
| 453 | jz .Lpsw_idle_stcctm |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 454 | .insn rsy,0xeb0000000017,%r1,5,__MT_CYCLES_ENTER(%r2) |
Martin Schwidefsky | 72d38b1 | 2015-09-18 16:41:36 +0200 | [diff] [blame] | 455 | .Lpsw_idle_stcctm: |
Martin Schwidefsky | 419123f | 2015-11-19 11:09:45 +0100 | [diff] [blame] | 456 | oi __LC_CPU_FLAGS+7,_CIF_ENABLED_WAIT |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 457 | BPON |
Martin Schwidefsky | 27f6b41 | 2012-07-20 11:15:08 +0200 | [diff] [blame] | 458 | STCK __CLOCK_IDLE_ENTER(%r2) |
| 459 | stpt __TIMER_IDLE_ENTER(%r2) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 460 | lpswe __SF_EMPTY(%r15) |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 461 | .globl psw_idle_exit |
| 462 | psw_idle_exit: |
Martin Schwidefsky | 6dd85fb | 2018-04-20 16:49:46 +0200 | [diff] [blame] | 463 | BR_EX %r14 |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 464 | ENDPROC(psw_idle) |
Martin Schwidefsky | 4c1051e | 2012-03-11 11:59:27 -0400 | [diff] [blame] | 465 | |
Hendrik Brueckner | b5510d9 | 2015-09-29 10:04:41 +0200 | [diff] [blame] | 466 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 467 | * Machine check handler routines |
| 468 | */ |
Jan Glauber | 144d634 | 2011-07-24 10:48:19 +0200 | [diff] [blame] | 469 | ENTRY(mcck_int_handler) |
Heiko Carstens | 473e66b | 2012-05-09 16:27:39 +0200 | [diff] [blame] | 470 | STCK __LC_MCCK_CLOCK |
Martin Schwidefsky | d768bd8 | 2018-01-16 07:11:45 +0100 | [diff] [blame] | 471 | BPOFF |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 472 | la %r1,4095 # validate r1 |
| 473 | spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # validate cpu timer |
| 474 | sckc __LC_CLOCK_COMPARATOR # validate comparator |
| 475 | lam %a0,%a15,__LC_AREGS_SAVE_AREA-4095(%r1) # validate acrs |
| 476 | lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# validate gprs |
Heiko Carstens | d5c352c | 2016-11-08 11:08:26 +0100 | [diff] [blame] | 477 | lg %r12,__LC_CURRENT |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 478 | lmg %r8,%r9,__LC_MCK_OLD_PSW |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 479 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_SYSTEM_DAMAGE |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 480 | jo .Lmcck_panic # yes -> rest of mcck code invalid |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 481 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_CR_VALID |
| 482 | jno .Lmcck_panic # control registers invalid -> panic |
| 483 | la %r14,4095 |
| 484 | lctlg %c0,%c15,__LC_CREGS_SAVE_AREA-4095(%r14) # validate ctl regs |
| 485 | ptlb |
Vasily Gorbik | 2a2d7bef | 2017-10-27 12:44:48 +0200 | [diff] [blame] | 486 | lg %r11,__LC_MCESAD-4095(%r14) # extended machine check save area |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 487 | nill %r11,0xfc00 # MCESA_ORIGIN_MASK |
| 488 | TSTMSK __LC_CREGS_SAVE_AREA+16-4095(%r14),CR2_GUARDED_STORAGE |
| 489 | jno 0f |
| 490 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_GS_VALID |
| 491 | jno 0f |
| 492 | .insn rxy,0xe3000000004d,0,__MCESA_GS_SAVE_AREA(%r11) # LGSC |
| 493 | 0: l %r14,__LC_FP_CREG_SAVE_AREA-4095(%r14) |
| 494 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_FC_VALID |
| 495 | jo 0f |
| 496 | sr %r14,%r14 |
| 497 | 0: sfpc %r14 |
| 498 | TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_VX |
| 499 | jo 0f |
| 500 | lghi %r14,__LC_FPREGS_SAVE_AREA |
| 501 | ld %f0,0(%r14) |
| 502 | ld %f1,8(%r14) |
| 503 | ld %f2,16(%r14) |
| 504 | ld %f3,24(%r14) |
| 505 | ld %f4,32(%r14) |
| 506 | ld %f5,40(%r14) |
| 507 | ld %f6,48(%r14) |
| 508 | ld %f7,56(%r14) |
| 509 | ld %f8,64(%r14) |
| 510 | ld %f9,72(%r14) |
| 511 | ld %f10,80(%r14) |
| 512 | ld %f11,88(%r14) |
| 513 | ld %f12,96(%r14) |
| 514 | ld %f13,104(%r14) |
| 515 | ld %f14,112(%r14) |
| 516 | ld %f15,120(%r14) |
| 517 | j 1f |
| 518 | 0: VLM %v0,%v15,0,%r11 |
| 519 | VLM %v16,%v31,256,%r11 |
| 520 | 1: lghi %r14,__LC_CPU_TIMER_SAVE_AREA |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 521 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Hendrik Brueckner | 83abeff | 2015-10-01 17:02:48 +0200 | [diff] [blame] | 522 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_CPU_TIMER_VALID |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 523 | jo 3f |
Sven Schnelle | 56e62a7 | 2020-11-21 11:14:56 +0100 | [diff] [blame] | 524 | la %r14,__LC_SYS_ENTER_TIMER |
| 525 | clc 0(8,%r14),__LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 526 | jl 1f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 527 | la %r14,__LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 528 | 1: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER |
| 529 | jl 2f |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 530 | la %r14,__LC_LAST_UPDATE_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 531 | 2: spt 0(%r14) |
Martin Schwidefsky | 6377981 | 2010-05-17 10:00:03 +0200 | [diff] [blame] | 532 | mvc __LC_MCCK_ENTER_TIMER(8),0(%r14) |
Martin Schwidefsky | 3037a52 | 2017-10-12 13:24:48 +0200 | [diff] [blame] | 533 | 3: TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_MWP_VALID |
| 534 | jno .Lmcck_panic |
| 535 | tmhh %r8,0x0001 # interrupting from user ? |
| 536 | jnz 4f |
| 537 | TSTMSK __LC_MCCK_CODE,MCCK_CODE_PSW_IA_VALID |
| 538 | jno .Lmcck_panic |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 539 | 4: ssm __LC_PGM_NEW_PSW # turn dat on, keep irqs off |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 540 | tmhh %r8,0x0001 # interrupting from user ? |
| 541 | jnz .Lmcck_user |
| 542 | #if IS_ENABLED(CONFIG_KVM) |
| 543 | lgr %r14,%r9 |
| 544 | larl %r13,.Lsie_gmap |
| 545 | slgr %r14,%r13 |
| 546 | lghi %r13,.Lsie_done - .Lsie_gmap |
| 547 | clgr %r14,%r13 |
| 548 | jhe .Lmcck_stack |
Sven Schnelle | efa5473 | 2021-02-03 17:50:00 +0100 | [diff] [blame] | 549 | brasl %r14,.Lcleanup_sie_mcck |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 550 | #endif |
Sven Schnelle | b61b159 | 2021-02-03 09:02:51 +0100 | [diff] [blame] | 551 | j .Lmcck_stack |
Sven Schnelle | b0d3115 | 2021-01-28 13:06:05 +0100 | [diff] [blame] | 552 | .Lmcck_user: |
| 553 | BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
Sven Schnelle | b61b159 | 2021-02-03 09:02:51 +0100 | [diff] [blame] | 554 | .Lmcck_stack: |
| 555 | lg %r15,__LC_MCCK_STACK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 556 | .Lmcck_skip: |
Sven Schnelle | b61b159 | 2021-02-03 09:02:51 +0100 | [diff] [blame] | 557 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Sven Schnelle | 2652141 | 2021-02-03 09:16:45 +0100 | [diff] [blame] | 558 | stctg %c1,%c1,__PT_CR1(%r11) |
Sven Schnelle | b61b159 | 2021-02-03 09:02:51 +0100 | [diff] [blame] | 559 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
| 560 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
Martin Schwidefsky | 6551fbd | 2013-02-28 16:28:41 +0100 | [diff] [blame] | 561 | lghi %r14,__LC_GPREGS_SAVE_AREA+64 |
| 562 | stmg %r0,%r7,__PT_R0(%r11) |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 563 | # clear user controlled registers to prevent speculative use |
| 564 | xgr %r0,%r0 |
| 565 | xgr %r1,%r1 |
Martin Schwidefsky | 7041d28 | 2018-01-16 13:27:30 +0100 | [diff] [blame] | 566 | xgr %r3,%r3 |
| 567 | xgr %r4,%r4 |
| 568 | xgr %r5,%r5 |
| 569 | xgr %r6,%r6 |
| 570 | xgr %r7,%r7 |
| 571 | xgr %r10,%r10 |
Martin Schwidefsky | 6551fbd | 2013-02-28 16:28:41 +0100 | [diff] [blame] | 572 | mvc __PT_R8(64,%r11),0(%r14) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 573 | stmg %r8,%r9,__PT_PSW(%r11) |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 574 | xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 575 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 576 | lgr %r2,%r11 # pass pointer to pt_regs |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 577 | brasl %r14,s390_do_machine_check |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 578 | cghi %r2,0 |
| 579 | je .Lmcck_return |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 580 | lg %r1,__LC_KERNEL_STACK # switch to kernel stack |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 581 | mvc STACK_FRAME_OVERHEAD(__PT_SIZE,%r1),0(%r11) |
| 582 | xc __SF_BACKCHAIN(8,%r1),__SF_BACKCHAIN(%r1) |
| 583 | la %r11,STACK_FRAME_OVERHEAD(%r1) |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 584 | lgr %r15,%r1 |
Heiko Carstens | 77fa224 | 2005-06-25 14:55:30 -0700 | [diff] [blame] | 585 | brasl %r14,s390_handle_mcck |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 586 | .Lmcck_return: |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 587 | lctlg %c1,%c1,__PT_CR1(%r11) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 588 | lmg %r0,%r10,__PT_R0(%r11) |
| 589 | mvc __LC_RETURN_MCCK_PSW(16),__PT_PSW(%r11) # move return PSW |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 590 | tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ? |
| 591 | jno 0f |
Martin Schwidefsky | 6b73044 | 2018-01-16 07:36:46 +0100 | [diff] [blame] | 592 | BPEXIT __TI_flags(%r12),_TIF_ISOLATE_BP |
Martin Schwidefsky | 63b1224 | 2006-06-29 14:58:05 +0200 | [diff] [blame] | 593 | stpt __LC_EXIT_TIMER |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 594 | 0: lmg %r11,%r15,__PT_R11(%r11) |
Sven Schnelle | 0b38b5e | 2020-01-22 13:38:22 +0100 | [diff] [blame] | 595 | b __LC_RETURN_MCCK_LPSWE |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 596 | |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 597 | .Lmcck_panic: |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 598 | lg %r15,__LC_NODAT_STACK |
Martin Schwidefsky | 86ed42f | 2014-12-03 17:00:08 +0100 | [diff] [blame] | 599 | j .Lmcck_skip |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 600 | ENDPROC(mcck_int_handler) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 601 | |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 602 | # |
| 603 | # PSW restart interrupt handler |
| 604 | # |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 605 | ENTRY(restart_int_handler) |
Martin Schwidefsky | e5b9819 | 2018-03-26 15:23:33 +0200 | [diff] [blame] | 606 | ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40 |
| 607 | stg %r15,__LC_SAVE_AREA_RESTART |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 608 | lg %r15,__LC_RESTART_STACK |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 609 | xc STACK_FRAME_OVERHEAD(__PT_SIZE,%r15),STACK_FRAME_OVERHEAD(%r15) |
| 610 | stmg %r0,%r14,STACK_FRAME_OVERHEAD+__PT_R0(%r15) |
| 611 | mvc STACK_FRAME_OVERHEAD+__PT_R15(8,%r15),__LC_SAVE_AREA_RESTART |
| 612 | mvc STACK_FRAME_OVERHEAD+__PT_PSW(16,%r15),__LC_RST_OLD_PSW |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 613 | xc 0(STACK_FRAME_OVERHEAD,%r15),0(%r15) |
Heiko Carstens | fbe7656 | 2012-06-05 09:59:52 +0200 | [diff] [blame] | 614 | lg %r1,__LC_RESTART_FN # load fn, parm & source cpu |
| 615 | lg %r2,__LC_RESTART_DATA |
| 616 | lg %r3,__LC_RESTART_SOURCE |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 617 | ltgr %r3,%r3 # test source cpu address |
| 618 | jm 1f # negative -> skip source stop |
Heiko Carstens | eb54619 | 2012-06-04 15:05:43 +0200 | [diff] [blame] | 619 | 0: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 620 | brc 10,0b # wait for status stored |
| 621 | 1: basr %r14,%r1 # call function |
| 622 | stap __SF_EMPTY(%r15) # store cpu address |
| 623 | llgh %r3,__SF_EMPTY(%r15) |
Heiko Carstens | eb54619 | 2012-06-04 15:05:43 +0200 | [diff] [blame] | 624 | 2: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 625 | brc 2,2b |
| 626 | 3: j 3b |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 627 | ENDPROC(restart_int_handler) |
Michael Holzheu | 7dd6b33 | 2011-08-03 16:44:19 +0200 | [diff] [blame] | 628 | |
Martin Schwidefsky | 860dba4 | 2011-01-05 12:47:25 +0100 | [diff] [blame] | 629 | .section .kprobes.text, "ax" |
| 630 | |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 631 | #if defined(CONFIG_CHECK_STACK) || defined(CONFIG_VMAP_STACK) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 632 | /* |
| 633 | * The synchronous or the asynchronous stack overflowed. We are dead. |
| 634 | * No need to properly save the registers, we are going to panic anyway. |
| 635 | * Setup a pt_regs so that show_trace can provide a good call trace. |
| 636 | */ |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 637 | ENTRY(stack_overflow) |
Martin Schwidefsky | ce3dc44 | 2017-09-12 16:37:33 +0200 | [diff] [blame] | 638 | lg %r15,__LC_NODAT_STACK # change to panic stack |
Martin Schwidefsky | dc7ee00 | 2013-04-24 10:20:43 +0200 | [diff] [blame] | 639 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 640 | stmg %r0,%r7,__PT_R0(%r11) |
| 641 | stmg %r8,%r9,__PT_PSW(%r11) |
| 642 | mvc __PT_R8(64,%r11),0(%r14) |
| 643 | stg %r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2 |
Martin Schwidefsky | c532890 | 2011-12-27 11:27:15 +0100 | [diff] [blame] | 644 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 645 | lgr %r2,%r11 # pass pointer to pt_regs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 646 | jg kernel_stack_overflow |
Martin Schwidefsky | 26a374a | 2019-01-17 10:02:22 +0100 | [diff] [blame] | 647 | ENDPROC(stack_overflow) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 648 | #endif |
| 649 | |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 650 | #if IS_ENABLED(CONFIG_KVM) |
Sven Schnelle | efa5473 | 2021-02-03 17:50:00 +0100 | [diff] [blame] | 651 | .Lcleanup_sie_mcck: |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 652 | larl %r13,.Lsie_entry |
| 653 | slgr %r9,%r13 |
| 654 | larl %r13,.Lsie_skip |
| 655 | clgr %r9,%r13 |
Sven Schnelle | efa5473 | 2021-02-03 17:50:00 +0100 | [diff] [blame] | 656 | jh .Lcleanup_sie_int |
Sven Schnelle | 0b0ed65 | 2020-02-20 12:09:36 +0100 | [diff] [blame] | 657 | oi __LC_CPU_FLAGS+7, _CIF_MCCK_GUEST |
Sven Schnelle | efa5473 | 2021-02-03 17:50:00 +0100 | [diff] [blame] | 658 | .Lcleanup_sie_int: |
| 659 | BPENTER __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST) |
Martin Schwidefsky | 92fa7a1 | 2018-03-20 13:33:43 +0100 | [diff] [blame] | 660 | lg %r9,__SF_SIE_CONTROL(%r15) # get control block pointer |
Christian Borntraeger | e22cf8c | 2015-10-06 18:06:15 +0200 | [diff] [blame] | 661 | ni __SIE_PROG0C+3(%r9),0xfe # no longer in SIE |
Heiko Carstens | 87d5986 | 2020-11-16 08:06:40 +0100 | [diff] [blame] | 662 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
Martin Schwidefsky | d0fc410 | 2015-06-22 17:26:40 +0200 | [diff] [blame] | 663 | larl %r9,sie_exit # skip forward to sie_exit |
Sven Schnelle | 33ea048 | 2021-02-03 17:46:12 +0100 | [diff] [blame] | 664 | BR_EX %r14,%r13 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 665 | |
Martin Schwidefsky | 603d1a5 | 2011-07-24 10:48:18 +0200 | [diff] [blame] | 666 | #endif |
Heiko Carstens | a876cb3 | 2015-02-13 14:44:29 +0100 | [diff] [blame] | 667 | .section .rodata, "a" |
Gerald Schaefer | ff4a742 | 2019-02-03 21:36:13 +0100 | [diff] [blame] | 668 | #define SYSCALL(esame,emu) .quad __s390x_ ## esame |
Heiko Carstens | 9bf1226 | 2009-06-12 10:26:47 +0200 | [diff] [blame] | 669 | .globl sys_call_table |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 670 | sys_call_table: |
Hendrik Brueckner | 4381f9f | 2017-12-11 14:47:27 +0100 | [diff] [blame] | 671 | #include "asm/syscall_table.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 672 | #undef SYSCALL |
| 673 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 674 | #ifdef CONFIG_COMPAT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 675 | |
Gerald Schaefer | ff4a742 | 2019-02-03 21:36:13 +0100 | [diff] [blame] | 676 | #define SYSCALL(esame,emu) .quad __s390_ ## emu |
Martin Schwidefsky | 6164988 | 2013-04-24 12:58:39 +0200 | [diff] [blame] | 677 | .globl sys_call_table_emu |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 678 | sys_call_table_emu: |
Hendrik Brueckner | 4381f9f | 2017-12-11 14:47:27 +0100 | [diff] [blame] | 679 | #include "asm/syscall_table.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | #undef SYSCALL |
| 681 | #endif |