diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/crypto/padlock-aes.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/crypto/padlock-aes.c')
-rw-r--r-- | drivers/crypto/padlock-aes.c | 13 |
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 | ||
67 | static DEFINE_PER_CPU(struct cword *, last_cword); | 68 | static 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 | ||
153 | ok: | 154 | ok: |
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 | ||
177 | static inline void padlock_store_cword(struct cword *cword) | 178 | static 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 | /* |