diff options
| -rw-r--r-- | arch/x86/crypto/ghash-clmulni-intel_asm.S | 11 | ||||
| -rw-r--r-- | arch/x86/include/asm/i387.h | 7 |
2 files changed, 13 insertions, 5 deletions
diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S index 71768d543dbb..59584982fb75 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_asm.S +++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <linux/linkage.h> | 19 | #include <linux/linkage.h> |
| 20 | #include <asm/i387.h> | ||
| 20 | 21 | ||
| 21 | .align 16 | 22 | .align 16 |
| 22 | .Lbswap_mask: | 23 | .Lbswap_mask: |
| @@ -101,7 +102,7 @@ ENTRY(clmul_ghash_mul) | |||
| 101 | movups (%rsi), SHASH | 102 | movups (%rsi), SHASH |
| 102 | movaps .Lbswap_mask, BSWAP | 103 | movaps .Lbswap_mask, BSWAP |
| 103 | # pshufb BSWAP, DATA | 104 | # pshufb BSWAP, DATA |
| 104 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 105 | PSHUFB_XMM5_XMM0 |
| 105 | call __clmul_gf128mul_ble | 106 | call __clmul_gf128mul_ble |
| 106 | # pshufb BSWAP, DATA | 107 | # pshufb BSWAP, DATA |
| 107 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 108 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 |
| @@ -119,12 +120,12 @@ ENTRY(clmul_ghash_update) | |||
| 119 | movups (%rdi), DATA | 120 | movups (%rdi), DATA |
| 120 | movups (%rcx), SHASH | 121 | movups (%rcx), SHASH |
| 121 | # pshufb BSWAP, DATA | 122 | # pshufb BSWAP, DATA |
| 122 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 123 | PSHUFB_XMM5_XMM0 |
| 123 | .align 4 | 124 | .align 4 |
| 124 | .Lupdate_loop: | 125 | .Lupdate_loop: |
| 125 | movups (%rsi), IN1 | 126 | movups (%rsi), IN1 |
| 126 | # pshufb BSWAP, IN1 | 127 | # pshufb BSWAP, IN1 |
| 127 | .byte 0x66, 0x0f, 0x38, 0x00, 0xf5 | 128 | PSHUFB_XMM5_XMM6 |
| 128 | pxor IN1, DATA | 129 | pxor IN1, DATA |
| 129 | call __clmul_gf128mul_ble | 130 | call __clmul_gf128mul_ble |
| 130 | sub $16, %rdx | 131 | sub $16, %rdx |
| @@ -132,7 +133,7 @@ ENTRY(clmul_ghash_update) | |||
| 132 | cmp $16, %rdx | 133 | cmp $16, %rdx |
| 133 | jge .Lupdate_loop | 134 | jge .Lupdate_loop |
| 134 | # pshufb BSWAP, DATA | 135 | # pshufb BSWAP, DATA |
| 135 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 136 | PSHUFB_XMM5_XMM0 |
| 136 | movups DATA, (%rdi) | 137 | movups DATA, (%rdi) |
| 137 | .Lupdate_just_ret: | 138 | .Lupdate_just_ret: |
| 138 | ret | 139 | ret |
| @@ -146,7 +147,7 @@ ENTRY(clmul_ghash_setkey) | |||
| 146 | movaps .Lbswap_mask, BSWAP | 147 | movaps .Lbswap_mask, BSWAP |
| 147 | movups (%rsi), %xmm0 | 148 | movups (%rsi), %xmm0 |
| 148 | # pshufb BSWAP, %xmm0 | 149 | # pshufb BSWAP, %xmm0 |
| 149 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 150 | PSHUFB_XMM5_XMM0 |
| 150 | movaps %xmm0, %xmm1 | 151 | movaps %xmm0, %xmm1 |
| 151 | psllq $1, %xmm0 | 152 | psllq $1, %xmm0 |
| 152 | psrlq $63, %xmm1 | 153 | psrlq $63, %xmm1 |
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 0b20bbb758f2..ebfb8a9e11f7 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | #ifndef _ASM_X86_I387_H | 10 | #ifndef _ASM_X86_I387_H |
| 11 | #define _ASM_X86_I387_H | 11 | #define _ASM_X86_I387_H |
| 12 | 12 | ||
| 13 | #ifndef __ASSEMBLY__ | ||
| 14 | |||
| 13 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 14 | #include <linux/kernel_stat.h> | 16 | #include <linux/kernel_stat.h> |
| 15 | #include <linux/regset.h> | 17 | #include <linux/regset.h> |
| @@ -411,4 +413,9 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk) | |||
| 411 | } | 413 | } |
| 412 | } | 414 | } |
| 413 | 415 | ||
| 416 | #endif /* __ASSEMBLY__ */ | ||
| 417 | |||
| 418 | #define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | ||
| 419 | #define PSHUFB_XMM5_XMM6 .byte 0x66, 0x0f, 0x38, 0x00, 0xf5 | ||
| 420 | |||
| 414 | #endif /* _ASM_X86_I387_H */ | 421 | #endif /* _ASM_X86_I387_H */ |
