Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 Vitaly Mayatskikh <vmayatsk@redhat.com> |
| 3 | * Copyright 2002 Andi Kleen, SuSE Labs. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * Subject to the GNU Public License v2. |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 5 | * |
| 6 | * Functions to copy from and to user space. |
| 7 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 9 | #include <linux/linkage.h> |
| 10 | #include <asm/dwarf2.h> |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 11 | #include <asm/current.h> |
| 12 | #include <asm/asm-offsets.h> |
| 13 | #include <asm/thread_info.h> |
| 14 | #include <asm/cpufeature.h> |
Fenghua Yu | 4307bec | 2011-05-17 15:29:15 -0700 | [diff] [blame] | 15 | #include <asm/alternative-asm.h> |
H. Peter Anvin | 9732da8 | 2012-04-20 12:19:51 -0700 | [diff] [blame] | 16 | #include <asm/asm.h> |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 17 | #include <asm/smap.h> |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 18 | |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 19 | /* Standard copy_to_user with segment limit checking */ |
Frederic Weisbecker | 3c93ca0 | 2009-11-16 15:42:18 +0100 | [diff] [blame] | 20 | ENTRY(_copy_to_user) |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 21 | CFI_STARTPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | GET_THREAD_INFO(%rax) |
| 23 | movq %rdi,%rcx |
| 24 | addq %rdx,%rcx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 25 | jc bad_to_user |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 26 | cmpq TI_addr_limit(%rax),%rcx |
Jiri Olsa | 26afb7c | 2011-05-12 16:30:30 +0200 | [diff] [blame] | 27 | ja bad_to_user |
Borislav Petkov | de2ff88 | 2015-01-13 01:38:17 +0100 | [diff] [blame] | 28 | ALTERNATIVE_2 "jmp copy_user_generic_unrolled", \ |
| 29 | "jmp copy_user_generic_string", \ |
| 30 | X86_FEATURE_REP_GOOD, \ |
| 31 | "jmp copy_user_enhanced_fast_string", \ |
| 32 | X86_FEATURE_ERMS |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 33 | CFI_ENDPROC |
Frederic Weisbecker | 3c93ca0 | 2009-11-16 15:42:18 +0100 | [diff] [blame] | 34 | ENDPROC(_copy_to_user) |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 35 | |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 36 | /* Standard copy_from_user with segment limit checking */ |
Arjan van de Ven | 9f0cf4a | 2009-09-26 14:33:01 +0200 | [diff] [blame] | 37 | ENTRY(_copy_from_user) |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 38 | CFI_STARTPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | GET_THREAD_INFO(%rax) |
| 40 | movq %rsi,%rcx |
| 41 | addq %rdx,%rcx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 42 | jc bad_from_user |
Glauber Costa | 26ccb8a | 2008-06-24 11:19:35 -0300 | [diff] [blame] | 43 | cmpq TI_addr_limit(%rax),%rcx |
Jiri Olsa | 26afb7c | 2011-05-12 16:30:30 +0200 | [diff] [blame] | 44 | ja bad_from_user |
Borislav Petkov | de2ff88 | 2015-01-13 01:38:17 +0100 | [diff] [blame] | 45 | ALTERNATIVE_2 "jmp copy_user_generic_unrolled", \ |
| 46 | "jmp copy_user_generic_string", \ |
| 47 | X86_FEATURE_REP_GOOD, \ |
| 48 | "jmp copy_user_enhanced_fast_string", \ |
| 49 | X86_FEATURE_ERMS |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 50 | CFI_ENDPROC |
Arjan van de Ven | 9f0cf4a | 2009-09-26 14:33:01 +0200 | [diff] [blame] | 51 | ENDPROC(_copy_from_user) |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | .section .fixup,"ax" |
| 54 | /* must zero dest */ |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 55 | ENTRY(bad_from_user) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | bad_from_user: |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 57 | CFI_STARTPROC |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | movl %edx,%ecx |
| 59 | xorl %eax,%eax |
| 60 | rep |
| 61 | stosb |
| 62 | bad_to_user: |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 63 | movl %edx,%eax |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | ret |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 65 | CFI_ENDPROC |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 66 | ENDPROC(bad_from_user) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | .previous |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 68 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | /* |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 70 | * copy_user_generic_unrolled - memory copy with exception handling. |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 71 | * This version is for CPUs like P4 that don't have efficient micro |
| 72 | * code for rep movsq |
| 73 | * |
| 74 | * Input: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | * rdi destination |
| 76 | * rsi source |
| 77 | * rdx count |
| 78 | * |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 79 | * Output: |
Lucas De Marchi | 0d2eb44 | 2011-03-17 16:24:16 -0300 | [diff] [blame] | 80 | * eax uncopied bytes or 0 if successful. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | */ |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 82 | ENTRY(copy_user_generic_unrolled) |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 83 | CFI_STARTPROC |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 84 | ASM_STAC |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 85 | cmpl $8,%edx |
| 86 | jb 20f /* less then 8 bytes, go to byte copy loop */ |
| 87 | ALIGN_DESTINATION |
| 88 | movl %edx,%ecx |
| 89 | andl $63,%edx |
| 90 | shrl $6,%ecx |
| 91 | jz 17f |
| 92 | 1: movq (%rsi),%r8 |
| 93 | 2: movq 1*8(%rsi),%r9 |
| 94 | 3: movq 2*8(%rsi),%r10 |
| 95 | 4: movq 3*8(%rsi),%r11 |
| 96 | 5: movq %r8,(%rdi) |
| 97 | 6: movq %r9,1*8(%rdi) |
| 98 | 7: movq %r10,2*8(%rdi) |
| 99 | 8: movq %r11,3*8(%rdi) |
| 100 | 9: movq 4*8(%rsi),%r8 |
| 101 | 10: movq 5*8(%rsi),%r9 |
| 102 | 11: movq 6*8(%rsi),%r10 |
| 103 | 12: movq 7*8(%rsi),%r11 |
| 104 | 13: movq %r8,4*8(%rdi) |
| 105 | 14: movq %r9,5*8(%rdi) |
| 106 | 15: movq %r10,6*8(%rdi) |
| 107 | 16: movq %r11,7*8(%rdi) |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 108 | leaq 64(%rsi),%rsi |
| 109 | leaq 64(%rdi),%rdi |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 110 | decl %ecx |
| 111 | jnz 1b |
| 112 | 17: movl %edx,%ecx |
| 113 | andl $7,%edx |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 114 | shrl $3,%ecx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 115 | jz 20f |
| 116 | 18: movq (%rsi),%r8 |
| 117 | 19: movq %r8,(%rdi) |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 118 | leaq 8(%rsi),%rsi |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 119 | leaq 8(%rdi),%rdi |
| 120 | decl %ecx |
| 121 | jnz 18b |
| 122 | 20: andl %edx,%edx |
| 123 | jz 23f |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 124 | movl %edx,%ecx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 125 | 21: movb (%rsi),%al |
| 126 | 22: movb %al,(%rdi) |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 127 | incq %rsi |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 128 | incq %rdi |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 129 | decl %ecx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 130 | jnz 21b |
| 131 | 23: xor %eax,%eax |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 132 | ASM_CLAC |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 133 | ret |
| 134 | |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 135 | .section .fixup,"ax" |
| 136 | 30: shll $6,%ecx |
| 137 | addl %ecx,%edx |
| 138 | jmp 60f |
H. Peter Anvin | 661c801 | 2013-11-20 12:50:51 -0800 | [diff] [blame] | 139 | 40: leal (%rdx,%rcx,8),%edx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 140 | jmp 60f |
| 141 | 50: movl %ecx,%edx |
| 142 | 60: jmp copy_user_handle_tail /* ecx is zerorest also */ |
| 143 | .previous |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 144 | |
H. Peter Anvin | 9732da8 | 2012-04-20 12:19:51 -0700 | [diff] [blame] | 145 | _ASM_EXTABLE(1b,30b) |
| 146 | _ASM_EXTABLE(2b,30b) |
| 147 | _ASM_EXTABLE(3b,30b) |
| 148 | _ASM_EXTABLE(4b,30b) |
| 149 | _ASM_EXTABLE(5b,30b) |
| 150 | _ASM_EXTABLE(6b,30b) |
| 151 | _ASM_EXTABLE(7b,30b) |
| 152 | _ASM_EXTABLE(8b,30b) |
| 153 | _ASM_EXTABLE(9b,30b) |
| 154 | _ASM_EXTABLE(10b,30b) |
| 155 | _ASM_EXTABLE(11b,30b) |
| 156 | _ASM_EXTABLE(12b,30b) |
| 157 | _ASM_EXTABLE(13b,30b) |
| 158 | _ASM_EXTABLE(14b,30b) |
| 159 | _ASM_EXTABLE(15b,30b) |
| 160 | _ASM_EXTABLE(16b,30b) |
| 161 | _ASM_EXTABLE(18b,40b) |
| 162 | _ASM_EXTABLE(19b,40b) |
| 163 | _ASM_EXTABLE(21b,50b) |
| 164 | _ASM_EXTABLE(22b,50b) |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 165 | CFI_ENDPROC |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 166 | ENDPROC(copy_user_generic_unrolled) |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 167 | |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 168 | /* Some CPUs run faster using the string copy instructions. |
| 169 | * This is also a lot simpler. Use them when possible. |
| 170 | * |
| 171 | * Only 4GB of copy is supported. This shouldn't be a problem |
| 172 | * because the kernel normally only writes from/to page sized chunks |
| 173 | * even if user space passed a longer buffer. |
| 174 | * And more would be dangerous because both Intel and AMD have |
| 175 | * errata with rep movsq > 4GB. If someone feels the need to fix |
| 176 | * this please consider this. |
| 177 | * |
| 178 | * Input: |
| 179 | * rdi destination |
| 180 | * rsi source |
| 181 | * rdx count |
| 182 | * |
| 183 | * Output: |
| 184 | * eax uncopied bytes or 0 if successful. |
| 185 | */ |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 186 | ENTRY(copy_user_generic_string) |
Jan Beulich | 8d379da | 2006-09-26 10:52:32 +0200 | [diff] [blame] | 187 | CFI_STARTPROC |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 188 | ASM_STAC |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 189 | cmpl $8,%edx |
| 190 | jb 2f /* less than 8 bytes, go to byte copy loop */ |
| 191 | ALIGN_DESTINATION |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | movl %edx,%ecx |
| 193 | shrl $3,%ecx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 194 | andl $7,%edx |
| 195 | 1: rep |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 196 | movsq |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 197 | 2: movl %edx,%ecx |
| 198 | 3: rep |
| 199 | movsb |
Fenghua Yu | f4cb1cc | 2013-11-16 12:37:01 -0800 | [diff] [blame] | 200 | xorl %eax,%eax |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 201 | ASM_CLAC |
Andi Kleen | 7bcd3f3 | 2006-02-03 21:51:02 +0100 | [diff] [blame] | 202 | ret |
Andi Kleen | 3022d73 | 2006-09-26 10:52:39 +0200 | [diff] [blame] | 203 | |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 204 | .section .fixup,"ax" |
H. Peter Anvin | 661c801 | 2013-11-20 12:50:51 -0800 | [diff] [blame] | 205 | 11: leal (%rdx,%rcx,8),%ecx |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 206 | 12: movl %ecx,%edx /* ecx is zerorest also */ |
| 207 | jmp copy_user_handle_tail |
| 208 | .previous |
Andi Kleen | 2cbc9ee | 2006-01-11 22:44:45 +0100 | [diff] [blame] | 209 | |
H. Peter Anvin | 9732da8 | 2012-04-20 12:19:51 -0700 | [diff] [blame] | 210 | _ASM_EXTABLE(1b,11b) |
| 211 | _ASM_EXTABLE(3b,12b) |
Vitaly Mayatskikh | ad2fc2c | 2008-07-02 15:53:13 +0200 | [diff] [blame] | 212 | CFI_ENDPROC |
| 213 | ENDPROC(copy_user_generic_string) |
Fenghua Yu | 4307bec | 2011-05-17 15:29:15 -0700 | [diff] [blame] | 214 | |
| 215 | /* |
| 216 | * Some CPUs are adding enhanced REP MOVSB/STOSB instructions. |
| 217 | * It's recommended to use enhanced REP MOVSB/STOSB if it's enabled. |
| 218 | * |
| 219 | * Input: |
| 220 | * rdi destination |
| 221 | * rsi source |
| 222 | * rdx count |
| 223 | * |
| 224 | * Output: |
| 225 | * eax uncopied bytes or 0 if successful. |
| 226 | */ |
| 227 | ENTRY(copy_user_enhanced_fast_string) |
| 228 | CFI_STARTPROC |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 229 | ASM_STAC |
Fenghua Yu | 4307bec | 2011-05-17 15:29:15 -0700 | [diff] [blame] | 230 | movl %edx,%ecx |
| 231 | 1: rep |
| 232 | movsb |
Fenghua Yu | f4cb1cc | 2013-11-16 12:37:01 -0800 | [diff] [blame] | 233 | xorl %eax,%eax |
H. Peter Anvin | 63bcff2 | 2012-09-21 12:43:12 -0700 | [diff] [blame] | 234 | ASM_CLAC |
Fenghua Yu | 4307bec | 2011-05-17 15:29:15 -0700 | [diff] [blame] | 235 | ret |
| 236 | |
| 237 | .section .fixup,"ax" |
| 238 | 12: movl %ecx,%edx /* ecx is zerorest also */ |
| 239 | jmp copy_user_handle_tail |
| 240 | .previous |
| 241 | |
H. Peter Anvin | 9732da8 | 2012-04-20 12:19:51 -0700 | [diff] [blame] | 242 | _ASM_EXTABLE(1b,12b) |
Fenghua Yu | 4307bec | 2011-05-17 15:29:15 -0700 | [diff] [blame] | 243 | CFI_ENDPROC |
| 244 | ENDPROC(copy_user_enhanced_fast_string) |
Borislav Petkov | b41e6ec | 2015-05-13 19:42:24 +0200 | [diff] [blame^] | 245 | |
| 246 | /* |
| 247 | * copy_user_nocache - Uncached memory copy with exception handling |
| 248 | * This will force destination/source out of cache for more performance. |
| 249 | */ |
| 250 | ENTRY(__copy_user_nocache) |
| 251 | CFI_STARTPROC |
| 252 | ASM_STAC |
| 253 | cmpl $8,%edx |
| 254 | jb 20f /* less then 8 bytes, go to byte copy loop */ |
| 255 | ALIGN_DESTINATION |
| 256 | movl %edx,%ecx |
| 257 | andl $63,%edx |
| 258 | shrl $6,%ecx |
| 259 | jz 17f |
| 260 | 1: movq (%rsi),%r8 |
| 261 | 2: movq 1*8(%rsi),%r9 |
| 262 | 3: movq 2*8(%rsi),%r10 |
| 263 | 4: movq 3*8(%rsi),%r11 |
| 264 | 5: movnti %r8,(%rdi) |
| 265 | 6: movnti %r9,1*8(%rdi) |
| 266 | 7: movnti %r10,2*8(%rdi) |
| 267 | 8: movnti %r11,3*8(%rdi) |
| 268 | 9: movq 4*8(%rsi),%r8 |
| 269 | 10: movq 5*8(%rsi),%r9 |
| 270 | 11: movq 6*8(%rsi),%r10 |
| 271 | 12: movq 7*8(%rsi),%r11 |
| 272 | 13: movnti %r8,4*8(%rdi) |
| 273 | 14: movnti %r9,5*8(%rdi) |
| 274 | 15: movnti %r10,6*8(%rdi) |
| 275 | 16: movnti %r11,7*8(%rdi) |
| 276 | leaq 64(%rsi),%rsi |
| 277 | leaq 64(%rdi),%rdi |
| 278 | decl %ecx |
| 279 | jnz 1b |
| 280 | 17: movl %edx,%ecx |
| 281 | andl $7,%edx |
| 282 | shrl $3,%ecx |
| 283 | jz 20f |
| 284 | 18: movq (%rsi),%r8 |
| 285 | 19: movnti %r8,(%rdi) |
| 286 | leaq 8(%rsi),%rsi |
| 287 | leaq 8(%rdi),%rdi |
| 288 | decl %ecx |
| 289 | jnz 18b |
| 290 | 20: andl %edx,%edx |
| 291 | jz 23f |
| 292 | movl %edx,%ecx |
| 293 | 21: movb (%rsi),%al |
| 294 | 22: movb %al,(%rdi) |
| 295 | incq %rsi |
| 296 | incq %rdi |
| 297 | decl %ecx |
| 298 | jnz 21b |
| 299 | 23: xorl %eax,%eax |
| 300 | ASM_CLAC |
| 301 | sfence |
| 302 | ret |
| 303 | |
| 304 | .section .fixup,"ax" |
| 305 | 30: shll $6,%ecx |
| 306 | addl %ecx,%edx |
| 307 | jmp 60f |
| 308 | 40: lea (%rdx,%rcx,8),%rdx |
| 309 | jmp 60f |
| 310 | 50: movl %ecx,%edx |
| 311 | 60: sfence |
| 312 | jmp copy_user_handle_tail |
| 313 | .previous |
| 314 | |
| 315 | _ASM_EXTABLE(1b,30b) |
| 316 | _ASM_EXTABLE(2b,30b) |
| 317 | _ASM_EXTABLE(3b,30b) |
| 318 | _ASM_EXTABLE(4b,30b) |
| 319 | _ASM_EXTABLE(5b,30b) |
| 320 | _ASM_EXTABLE(6b,30b) |
| 321 | _ASM_EXTABLE(7b,30b) |
| 322 | _ASM_EXTABLE(8b,30b) |
| 323 | _ASM_EXTABLE(9b,30b) |
| 324 | _ASM_EXTABLE(10b,30b) |
| 325 | _ASM_EXTABLE(11b,30b) |
| 326 | _ASM_EXTABLE(12b,30b) |
| 327 | _ASM_EXTABLE(13b,30b) |
| 328 | _ASM_EXTABLE(14b,30b) |
| 329 | _ASM_EXTABLE(15b,30b) |
| 330 | _ASM_EXTABLE(16b,30b) |
| 331 | _ASM_EXTABLE(18b,40b) |
| 332 | _ASM_EXTABLE(19b,40b) |
| 333 | _ASM_EXTABLE(21b,50b) |
| 334 | _ASM_EXTABLE(22b,50b) |
| 335 | CFI_ENDPROC |
| 336 | ENDPROC(__copy_user_nocache) |