aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/padlock-aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/crypto/padlock-aes.c')
-rw-r--r--drivers/crypto/padlock-aes.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index 84c51e177269..2e992bc8015b 100644
--- a/drivers/crypto/padlock-aes.c
+++ b/drivers/crypto/padlock-aes.c
@@ -17,6 +17,7 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/percpu.h> 18#include <linux/percpu.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/slab.h>
20#include <asm/byteorder.h> 21#include <asm/byteorder.h>
21#include <asm/processor.h> 22#include <asm/processor.h>
22#include <asm/i387.h> 23#include <asm/i387.h>
@@ -64,7 +65,7 @@ struct aes_ctx {
64 u32 *D; 65 u32 *D;
65}; 66};
66 67
67static DEFINE_PER_CPU(struct cword *, last_cword); 68static DEFINE_PER_CPU(struct cword *, paes_last_cword);
68 69
69/* Tells whether the ACE is capable to generate 70/* Tells whether the ACE is capable to generate
70 the extended key for a given key_len. */ 71 the extended key for a given key_len. */
@@ -152,9 +153,9 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
152 153
153ok: 154ok:
154 for_each_online_cpu(cpu) 155 for_each_online_cpu(cpu)
155 if (&ctx->cword.encrypt == per_cpu(last_cword, cpu) || 156 if (&ctx->cword.encrypt == per_cpu(paes_last_cword, cpu) ||
156 &ctx->cword.decrypt == per_cpu(last_cword, cpu)) 157 &ctx->cword.decrypt == per_cpu(paes_last_cword, cpu))
157 per_cpu(last_cword, cpu) = NULL; 158 per_cpu(paes_last_cword, cpu) = NULL;
158 159
159 return 0; 160 return 0;
160} 161}
@@ -166,7 +167,7 @@ static inline void padlock_reset_key(struct cword *cword)
166{ 167{
167 int cpu = raw_smp_processor_id(); 168 int cpu = raw_smp_processor_id();
168 169
169 if (cword != per_cpu(last_cword, cpu)) 170 if (cword != per_cpu(paes_last_cword, cpu))
170#ifndef CONFIG_X86_64 171#ifndef CONFIG_X86_64
171 asm volatile ("pushfl; popfl"); 172 asm volatile ("pushfl; popfl");
172#else 173#else
@@ -176,7 +177,7 @@ static inline void padlock_reset_key(struct cword *cword)
176 177
177static inline void padlock_store_cword(struct cword *cword) 178static inline void padlock_store_cword(struct cword *cword)
178{ 179{
179 per_cpu(last_cword, raw_smp_processor_id()) = cword; 180 per_cpu(paes_last_cword, raw_smp_processor_id()) = cword;
180} 181}
181 182
182/* 183/*