diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2013-01-19 06:39:46 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-01-19 18:16:51 -0500 |
commit | d3f5188dfea70e7ea6570bd4bc9d6d7dbd431e39 (patch) | |
tree | 54fec05cb617686f30580477102580b93c7ebfc9 | |
parent | ac9d55dd42858b127bedb84f4e59789958263d37 (diff) |
crypto: x86/twofish - assembler clean-ups: use ENTRY/ENDPROC, localize jump labels
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | arch/x86/crypto/twofish-avx-x86_64-asm_64.S | 35 | ||||
-rw-r--r-- | arch/x86/crypto/twofish-i586-asm_32.S | 11 | ||||
-rw-r--r-- | arch/x86/crypto/twofish-x86_64-asm_64-3way.S | 20 | ||||
-rw-r--r-- | arch/x86/crypto/twofish-x86_64-asm_64.S | 11 |
4 files changed, 29 insertions, 48 deletions
diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S index ebac16bfa830..8d3e113b2c95 100644 --- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S +++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S | |||
@@ -23,6 +23,7 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/linkage.h> | ||
26 | #include "glue_helper-asm-avx.S" | 27 | #include "glue_helper-asm-avx.S" |
27 | 28 | ||
28 | .file "twofish-avx-x86_64-asm_64.S" | 29 | .file "twofish-avx-x86_64-asm_64.S" |
@@ -243,8 +244,6 @@ | |||
243 | vpxor x3, wkey, x3; | 244 | vpxor x3, wkey, x3; |
244 | 245 | ||
245 | .align 8 | 246 | .align 8 |
246 | .type __twofish_enc_blk8,@function; | ||
247 | |||
248 | __twofish_enc_blk8: | 247 | __twofish_enc_blk8: |
249 | /* input: | 248 | /* input: |
250 | * %rdi: ctx, CTX | 249 | * %rdi: ctx, CTX |
@@ -284,10 +283,9 @@ __twofish_enc_blk8: | |||
284 | outunpack_blocks(RC2, RD2, RA2, RB2, RK1, RX0, RY0, RK2); | 283 | outunpack_blocks(RC2, RD2, RA2, RB2, RK1, RX0, RY0, RK2); |
285 | 284 | ||
286 | ret; | 285 | ret; |
286 | ENDPROC(__twofish_enc_blk8) | ||
287 | 287 | ||
288 | .align 8 | 288 | .align 8 |
289 | .type __twofish_dec_blk8,@function; | ||
290 | |||
291 | __twofish_dec_blk8: | 289 | __twofish_dec_blk8: |
292 | /* input: | 290 | /* input: |
293 | * %rdi: ctx, CTX | 291 | * %rdi: ctx, CTX |
@@ -325,12 +323,9 @@ __twofish_dec_blk8: | |||
325 | outunpack_blocks(RA2, RB2, RC2, RD2, RK1, RX0, RY0, RK2); | 323 | outunpack_blocks(RA2, RB2, RC2, RD2, RK1, RX0, RY0, RK2); |
326 | 324 | ||
327 | ret; | 325 | ret; |
326 | ENDPROC(__twofish_dec_blk8) | ||
328 | 327 | ||
329 | .align 8 | 328 | ENTRY(twofish_ecb_enc_8way) |
330 | .global twofish_ecb_enc_8way | ||
331 | .type twofish_ecb_enc_8way,@function; | ||
332 | |||
333 | twofish_ecb_enc_8way: | ||
334 | /* input: | 329 | /* input: |
335 | * %rdi: ctx, CTX | 330 | * %rdi: ctx, CTX |
336 | * %rsi: dst | 331 | * %rsi: dst |
@@ -346,12 +341,9 @@ twofish_ecb_enc_8way: | |||
346 | store_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2); | 341 | store_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2); |
347 | 342 | ||
348 | ret; | 343 | ret; |
344 | ENDPROC(twofish_ecb_enc_8way) | ||
349 | 345 | ||
350 | .align 8 | 346 | ENTRY(twofish_ecb_dec_8way) |
351 | .global twofish_ecb_dec_8way | ||
352 | .type twofish_ecb_dec_8way,@function; | ||
353 | |||
354 | twofish_ecb_dec_8way: | ||
355 | /* input: | 347 | /* input: |
356 | * %rdi: ctx, CTX | 348 | * %rdi: ctx, CTX |
357 | * %rsi: dst | 349 | * %rsi: dst |
@@ -367,12 +359,9 @@ twofish_ecb_dec_8way: | |||
367 | store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); | 359 | store_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); |
368 | 360 | ||
369 | ret; | 361 | ret; |
362 | ENDPROC(twofish_ecb_dec_8way) | ||
370 | 363 | ||
371 | .align 8 | 364 | ENTRY(twofish_cbc_dec_8way) |
372 | .global twofish_cbc_dec_8way | ||
373 | .type twofish_cbc_dec_8way,@function; | ||
374 | |||
375 | twofish_cbc_dec_8way: | ||
376 | /* input: | 365 | /* input: |
377 | * %rdi: ctx, CTX | 366 | * %rdi: ctx, CTX |
378 | * %rsi: dst | 367 | * %rsi: dst |
@@ -393,12 +382,9 @@ twofish_cbc_dec_8way: | |||
393 | popq %r12; | 382 | popq %r12; |
394 | 383 | ||
395 | ret; | 384 | ret; |
385 | ENDPROC(twofish_cbc_dec_8way) | ||
396 | 386 | ||
397 | .align 8 | 387 | ENTRY(twofish_ctr_8way) |
398 | .global twofish_ctr_8way | ||
399 | .type twofish_ctr_8way,@function; | ||
400 | |||
401 | twofish_ctr_8way: | ||
402 | /* input: | 388 | /* input: |
403 | * %rdi: ctx, CTX | 389 | * %rdi: ctx, CTX |
404 | * %rsi: dst | 390 | * %rsi: dst |
@@ -421,3 +407,4 @@ twofish_ctr_8way: | |||
421 | popq %r12; | 407 | popq %r12; |
422 | 408 | ||
423 | ret; | 409 | ret; |
410 | ENDPROC(twofish_ctr_8way) | ||
diff --git a/arch/x86/crypto/twofish-i586-asm_32.S b/arch/x86/crypto/twofish-i586-asm_32.S index 658af4bb35c9..694ea4587ba7 100644 --- a/arch/x86/crypto/twofish-i586-asm_32.S +++ b/arch/x86/crypto/twofish-i586-asm_32.S | |||
@@ -20,6 +20,7 @@ | |||
20 | .file "twofish-i586-asm.S" | 20 | .file "twofish-i586-asm.S" |
21 | .text | 21 | .text |
22 | 22 | ||
23 | #include <linux/linkage.h> | ||
23 | #include <asm/asm-offsets.h> | 24 | #include <asm/asm-offsets.h> |
24 | 25 | ||
25 | /* return address at 0 */ | 26 | /* return address at 0 */ |
@@ -219,11 +220,7 @@ | |||
219 | xor %esi, d ## D;\ | 220 | xor %esi, d ## D;\ |
220 | ror $1, d ## D; | 221 | ror $1, d ## D; |
221 | 222 | ||
222 | .align 4 | 223 | ENTRY(twofish_enc_blk) |
223 | .global twofish_enc_blk | ||
224 | .global twofish_dec_blk | ||
225 | |||
226 | twofish_enc_blk: | ||
227 | push %ebp /* save registers according to calling convention*/ | 224 | push %ebp /* save registers according to calling convention*/ |
228 | push %ebx | 225 | push %ebx |
229 | push %esi | 226 | push %esi |
@@ -277,8 +274,9 @@ twofish_enc_blk: | |||
277 | pop %ebp | 274 | pop %ebp |
278 | mov $1, %eax | 275 | mov $1, %eax |
279 | ret | 276 | ret |
277 | ENDPROC(twofish_enc_blk) | ||
280 | 278 | ||
281 | twofish_dec_blk: | 279 | ENTRY(twofish_dec_blk) |
282 | push %ebp /* save registers according to calling convention*/ | 280 | push %ebp /* save registers according to calling convention*/ |
283 | push %ebx | 281 | push %ebx |
284 | push %esi | 282 | push %esi |
@@ -333,3 +331,4 @@ twofish_dec_blk: | |||
333 | pop %ebp | 331 | pop %ebp |
334 | mov $1, %eax | 332 | mov $1, %eax |
335 | ret | 333 | ret |
334 | ENDPROC(twofish_dec_blk) | ||
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S index 5b012a2c5119..1c3b7ceb36d2 100644 --- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S +++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S | |||
@@ -20,6 +20,8 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/linkage.h> | ||
24 | |||
23 | .file "twofish-x86_64-asm-3way.S" | 25 | .file "twofish-x86_64-asm-3way.S" |
24 | .text | 26 | .text |
25 | 27 | ||
@@ -214,11 +216,7 @@ | |||
214 | rorq $32, RAB2; \ | 216 | rorq $32, RAB2; \ |
215 | outunpack3(mov, RIO, 2, RAB, 2); | 217 | outunpack3(mov, RIO, 2, RAB, 2); |
216 | 218 | ||
217 | .align 8 | 219 | ENTRY(__twofish_enc_blk_3way) |
218 | .global __twofish_enc_blk_3way | ||
219 | .type __twofish_enc_blk_3way,@function; | ||
220 | |||
221 | __twofish_enc_blk_3way: | ||
222 | /* input: | 220 | /* input: |
223 | * %rdi: ctx, CTX | 221 | * %rdi: ctx, CTX |
224 | * %rsi: dst | 222 | * %rsi: dst |
@@ -250,7 +248,7 @@ __twofish_enc_blk_3way: | |||
250 | popq %rbp; /* bool xor */ | 248 | popq %rbp; /* bool xor */ |
251 | 249 | ||
252 | testb %bpl, %bpl; | 250 | testb %bpl, %bpl; |
253 | jnz __enc_xor3; | 251 | jnz .L__enc_xor3; |
254 | 252 | ||
255 | outunpack_enc3(mov); | 253 | outunpack_enc3(mov); |
256 | 254 | ||
@@ -262,7 +260,7 @@ __twofish_enc_blk_3way: | |||
262 | popq %r15; | 260 | popq %r15; |
263 | ret; | 261 | ret; |
264 | 262 | ||
265 | __enc_xor3: | 263 | .L__enc_xor3: |
266 | outunpack_enc3(xor); | 264 | outunpack_enc3(xor); |
267 | 265 | ||
268 | popq %rbx; | 266 | popq %rbx; |
@@ -272,11 +270,9 @@ __enc_xor3: | |||
272 | popq %r14; | 270 | popq %r14; |
273 | popq %r15; | 271 | popq %r15; |
274 | ret; | 272 | ret; |
273 | ENDPROC(__twofish_enc_blk_3way) | ||
275 | 274 | ||
276 | .global twofish_dec_blk_3way | 275 | ENTRY(twofish_dec_blk_3way) |
277 | .type twofish_dec_blk_3way,@function; | ||
278 | |||
279 | twofish_dec_blk_3way: | ||
280 | /* input: | 276 | /* input: |
281 | * %rdi: ctx, CTX | 277 | * %rdi: ctx, CTX |
282 | * %rsi: dst | 278 | * %rsi: dst |
@@ -313,4 +309,4 @@ twofish_dec_blk_3way: | |||
313 | popq %r14; | 309 | popq %r14; |
314 | popq %r15; | 310 | popq %r15; |
315 | ret; | 311 | ret; |
316 | 312 | ENDPROC(twofish_dec_blk_3way) | |
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S index 7bcf3fcc3668..a039d21986a2 100644 --- a/arch/x86/crypto/twofish-x86_64-asm_64.S +++ b/arch/x86/crypto/twofish-x86_64-asm_64.S | |||
@@ -20,6 +20,7 @@ | |||
20 | .file "twofish-x86_64-asm.S" | 20 | .file "twofish-x86_64-asm.S" |
21 | .text | 21 | .text |
22 | 22 | ||
23 | #include <linux/linkage.h> | ||
23 | #include <asm/asm-offsets.h> | 24 | #include <asm/asm-offsets.h> |
24 | 25 | ||
25 | #define a_offset 0 | 26 | #define a_offset 0 |
@@ -214,11 +215,7 @@ | |||
214 | xor %r8d, d ## D;\ | 215 | xor %r8d, d ## D;\ |
215 | ror $1, d ## D; | 216 | ror $1, d ## D; |
216 | 217 | ||
217 | .align 8 | 218 | ENTRY(twofish_enc_blk) |
218 | .global twofish_enc_blk | ||
219 | .global twofish_dec_blk | ||
220 | |||
221 | twofish_enc_blk: | ||
222 | pushq R1 | 219 | pushq R1 |
223 | 220 | ||
224 | /* %rdi contains the ctx address */ | 221 | /* %rdi contains the ctx address */ |
@@ -269,8 +266,9 @@ twofish_enc_blk: | |||
269 | popq R1 | 266 | popq R1 |
270 | movq $1,%rax | 267 | movq $1,%rax |
271 | ret | 268 | ret |
269 | ENDPROC(twofish_enc_blk) | ||
272 | 270 | ||
273 | twofish_dec_blk: | 271 | ENTRY(twofish_dec_blk) |
274 | pushq R1 | 272 | pushq R1 |
275 | 273 | ||
276 | /* %rdi contains the ctx address */ | 274 | /* %rdi contains the ctx address */ |
@@ -320,3 +318,4 @@ twofish_dec_blk: | |||
320 | popq R1 | 318 | popq R1 |
321 | movq $1,%rax | 319 | movq $1,%rax |
322 | ret | 320 | ret |
321 | ENDPROC(twofish_dec_blk) | ||