diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-06-13 22:09:03 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-06-13 22:09:03 -0400 |
commit | 3387e7d69048f5ab02729825f9611754850d9a87 (patch) | |
tree | d7468f1d4a72dc1282a04c6f5bc5953be2b7bdad /arch/x86 | |
parent | d366db605c8c4a9878589bc4a87e55f6063184ac (diff) |
crypto: serpent-sse2/avx - allow both to be built into kernel
Rename serpent-avx assembler functions so that they do not collide with
serpent-sse2 assembler functions when linking both versions in to same
kernel image.
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Johannes Goetzfried <Johannes.Goetzfried@informatik.stud.uni-erlangen.de>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/crypto/serpent-avx-x86_64-asm_64.S | 12 | ||||
-rw-r--r-- | arch/x86/crypto/serpent_avx_glue.c | 2 | ||||
-rw-r--r-- | arch/x86/crypto/serpent_sse2_glue.c | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/serpent-avx.h | 32 | ||||
-rw-r--r-- | arch/x86/include/asm/serpent-sse2.h (renamed from arch/x86/include/asm/serpent.h) | 4 |
5 files changed, 42 insertions, 10 deletions
diff --git a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S index 0ed47a124bac..504106bf04a2 100644 --- a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S +++ b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S | |||
@@ -579,10 +579,10 @@ | |||
579 | vmovdqu x3, (3*4*4)(out); | 579 | vmovdqu x3, (3*4*4)(out); |
580 | 580 | ||
581 | .align 8 | 581 | .align 8 |
582 | .global __serpent_enc_blk_8way | 582 | .global __serpent_enc_blk_8way_avx |
583 | .type __serpent_enc_blk_8way,@function; | 583 | .type __serpent_enc_blk_8way_avx,@function; |
584 | 584 | ||
585 | __serpent_enc_blk_8way: | 585 | __serpent_enc_blk_8way_avx: |
586 | /* input: | 586 | /* input: |
587 | * %rdi: ctx, CTX | 587 | * %rdi: ctx, CTX |
588 | * %rsi: dst | 588 | * %rsi: dst |
@@ -647,10 +647,10 @@ __enc_xor8: | |||
647 | ret; | 647 | ret; |
648 | 648 | ||
649 | .align 8 | 649 | .align 8 |
650 | .global serpent_dec_blk_8way | 650 | .global serpent_dec_blk_8way_avx |
651 | .type serpent_dec_blk_8way,@function; | 651 | .type serpent_dec_blk_8way_avx,@function; |
652 | 652 | ||
653 | serpent_dec_blk_8way: | 653 | serpent_dec_blk_8way_avx: |
654 | /* input: | 654 | /* input: |
655 | * %rdi: ctx, CTX | 655 | * %rdi: ctx, CTX |
656 | * %rsi: dst | 656 | * %rsi: dst |
diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c index 0dc7a26535e5..dd81bab4f11a 100644 --- a/arch/x86/crypto/serpent_avx_glue.c +++ b/arch/x86/crypto/serpent_avx_glue.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <asm/i387.h> | 39 | #include <asm/i387.h> |
40 | #include <asm/xcr.h> | 40 | #include <asm/xcr.h> |
41 | #include <asm/xsave.h> | 41 | #include <asm/xsave.h> |
42 | #include <asm/serpent.h> | 42 | #include <asm/serpent-avx.h> |
43 | #include <crypto/scatterwalk.h> | 43 | #include <crypto/scatterwalk.h> |
44 | #include <linux/workqueue.h> | 44 | #include <linux/workqueue.h> |
45 | #include <linux/spinlock.h> | 45 | #include <linux/spinlock.h> |
diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c index 4b21be85e0a1..deecd25c1299 100644 --- a/arch/x86/crypto/serpent_sse2_glue.c +++ b/arch/x86/crypto/serpent_sse2_glue.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <crypto/lrw.h> | 42 | #include <crypto/lrw.h> |
43 | #include <crypto/xts.h> | 43 | #include <crypto/xts.h> |
44 | #include <asm/i387.h> | 44 | #include <asm/i387.h> |
45 | #include <asm/serpent.h> | 45 | #include <asm/serpent-sse2.h> |
46 | #include <crypto/scatterwalk.h> | 46 | #include <crypto/scatterwalk.h> |
47 | #include <linux/workqueue.h> | 47 | #include <linux/workqueue.h> |
48 | #include <linux/spinlock.h> | 48 | #include <linux/spinlock.h> |
diff --git a/arch/x86/include/asm/serpent-avx.h b/arch/x86/include/asm/serpent-avx.h new file mode 100644 index 000000000000..432deedd2945 --- /dev/null +++ b/arch/x86/include/asm/serpent-avx.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef ASM_X86_SERPENT_AVX_H | ||
2 | #define ASM_X86_SERPENT_AVX_H | ||
3 | |||
4 | #include <linux/crypto.h> | ||
5 | #include <crypto/serpent.h> | ||
6 | |||
7 | #define SERPENT_PARALLEL_BLOCKS 8 | ||
8 | |||
9 | asmlinkage void __serpent_enc_blk_8way_avx(struct serpent_ctx *ctx, u8 *dst, | ||
10 | const u8 *src, bool xor); | ||
11 | asmlinkage void serpent_dec_blk_8way_avx(struct serpent_ctx *ctx, u8 *dst, | ||
12 | const u8 *src); | ||
13 | |||
14 | static inline void serpent_enc_blk_xway(struct serpent_ctx *ctx, u8 *dst, | ||
15 | const u8 *src) | ||
16 | { | ||
17 | __serpent_enc_blk_8way_avx(ctx, dst, src, false); | ||
18 | } | ||
19 | |||
20 | static inline void serpent_enc_blk_xway_xor(struct serpent_ctx *ctx, u8 *dst, | ||
21 | const u8 *src) | ||
22 | { | ||
23 | __serpent_enc_blk_8way_avx(ctx, dst, src, true); | ||
24 | } | ||
25 | |||
26 | static inline void serpent_dec_blk_xway(struct serpent_ctx *ctx, u8 *dst, | ||
27 | const u8 *src) | ||
28 | { | ||
29 | serpent_dec_blk_8way_avx(ctx, dst, src); | ||
30 | } | ||
31 | |||
32 | #endif | ||
diff --git a/arch/x86/include/asm/serpent.h b/arch/x86/include/asm/serpent-sse2.h index d3ef63fe0c81..e6e77dffbdab 100644 --- a/arch/x86/include/asm/serpent.h +++ b/arch/x86/include/asm/serpent-sse2.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef ASM_X86_SERPENT_H | 1 | #ifndef ASM_X86_SERPENT_SSE2_H |
2 | #define ASM_X86_SERPENT_H | 2 | #define ASM_X86_SERPENT_SSE2_H |
3 | 3 | ||
4 | #include <linux/crypto.h> | 4 | #include <linux/crypto.h> |
5 | #include <crypto/serpent.h> | 5 | #include <crypto/serpent.h> |