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