summaryrefslogtreecommitdiff
path: root/drivers/crypto/vmx/aes_cbc.c
diff options
context:
space:
mode:
authorLeonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>2015-07-13 19:51:39 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2015-07-14 09:56:48 +0300
commit2d6f0600b2cd755959527230ef5a6fba97bb762a (patch)
treedaecab27712eeca306e75969d9d0ef988feda758 /drivers/crypto/vmx/aes_cbc.c
parent72cd7b44bc99376b3f3c93cedcd052663fcdf705 (diff)
downloadlinux-2d6f0600b2cd755959527230ef5a6fba97bb762a.tar.xz
crypto: vmx - Adding enable_kernel_vsx() to access VSX instructions
vmx-crypto driver make use of some VSX instructions which are only available if VSX is enabled. Running in cases where VSX are not enabled vmx-crypto fails in a VSX exception. In order to fix this enable_kernel_vsx() was added to turn on VSX instructions for vmx-crypto. Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/vmx/aes_cbc.c')
-rw-r--r--drivers/crypto/vmx/aes_cbc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/vmx/aes_cbc.c b/drivers/crypto/vmx/aes_cbc.c
index 7299995c78ec..0b8fe2ec5315 100644
--- a/drivers/crypto/vmx/aes_cbc.c
+++ b/drivers/crypto/vmx/aes_cbc.c
@@ -85,6 +85,7 @@ static int p8_aes_cbc_setkey(struct crypto_tfm *tfm, const u8 *key,
preempt_disable();
pagefault_disable();
enable_kernel_altivec();
+ enable_kernel_vsx();
ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key);
ret += aes_p8_set_decrypt_key(key, keylen * 8, &ctx->dec_key);
pagefault_enable();
@@ -115,6 +116,7 @@ static int p8_aes_cbc_encrypt(struct blkcipher_desc *desc,
preempt_disable();
pagefault_disable();
enable_kernel_altivec();
+ enable_kernel_vsx();
blkcipher_walk_init(&walk, dst, src, nbytes);
ret = blkcipher_walk_virt(desc, &walk);
@@ -155,6 +157,7 @@ static int p8_aes_cbc_decrypt(struct blkcipher_desc *desc,
preempt_disable();
pagefault_disable();
enable_kernel_altivec();
+ enable_kernel_vsx();
blkcipher_walk_init(&walk, dst, src, nbytes);
ret = blkcipher_walk_virt(desc, &walk);