diff options
Diffstat (limited to 'arch/x86/crypto/aesni-intel_glue.c')
-rw-r--r-- | arch/x86/crypto/aesni-intel_glue.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 2577613fb32b..feee8ff1d05e 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c | |||
@@ -94,6 +94,10 @@ asmlinkage void aesni_cbc_enc(struct crypto_aes_ctx *ctx, u8 *out, | |||
94 | const u8 *in, unsigned int len, u8 *iv); | 94 | const u8 *in, unsigned int len, u8 *iv); |
95 | asmlinkage void aesni_cbc_dec(struct crypto_aes_ctx *ctx, u8 *out, | 95 | asmlinkage void aesni_cbc_dec(struct crypto_aes_ctx *ctx, u8 *out, |
96 | const u8 *in, unsigned int len, u8 *iv); | 96 | const u8 *in, unsigned int len, u8 *iv); |
97 | |||
98 | int crypto_fpu_init(void); | ||
99 | void crypto_fpu_exit(void); | ||
100 | |||
97 | #ifdef CONFIG_X86_64 | 101 | #ifdef CONFIG_X86_64 |
98 | asmlinkage void aesni_ctr_enc(struct crypto_aes_ctx *ctx, u8 *out, | 102 | asmlinkage void aesni_ctr_enc(struct crypto_aes_ctx *ctx, u8 *out, |
99 | const u8 *in, unsigned int len, u8 *iv); | 103 | const u8 *in, unsigned int len, u8 *iv); |
@@ -1257,6 +1261,8 @@ static int __init aesni_init(void) | |||
1257 | return -ENODEV; | 1261 | return -ENODEV; |
1258 | } | 1262 | } |
1259 | 1263 | ||
1264 | if ((err = crypto_fpu_init())) | ||
1265 | goto fpu_err; | ||
1260 | if ((err = crypto_register_alg(&aesni_alg))) | 1266 | if ((err = crypto_register_alg(&aesni_alg))) |
1261 | goto aes_err; | 1267 | goto aes_err; |
1262 | if ((err = crypto_register_alg(&__aesni_alg))) | 1268 | if ((err = crypto_register_alg(&__aesni_alg))) |
@@ -1334,6 +1340,7 @@ blk_ecb_err: | |||
1334 | __aes_err: | 1340 | __aes_err: |
1335 | crypto_unregister_alg(&aesni_alg); | 1341 | crypto_unregister_alg(&aesni_alg); |
1336 | aes_err: | 1342 | aes_err: |
1343 | fpu_err: | ||
1337 | return err; | 1344 | return err; |
1338 | } | 1345 | } |
1339 | 1346 | ||
@@ -1363,6 +1370,8 @@ static void __exit aesni_exit(void) | |||
1363 | crypto_unregister_alg(&blk_ecb_alg); | 1370 | crypto_unregister_alg(&blk_ecb_alg); |
1364 | crypto_unregister_alg(&__aesni_alg); | 1371 | crypto_unregister_alg(&__aesni_alg); |
1365 | crypto_unregister_alg(&aesni_alg); | 1372 | crypto_unregister_alg(&aesni_alg); |
1373 | |||
1374 | crypto_fpu_exit(); | ||
1366 | } | 1375 | } |
1367 | 1376 | ||
1368 | module_init(aesni_init); | 1377 | module_init(aesni_init); |