diff options
Diffstat (limited to 'drivers/crypto/padlock-aes.c')
| -rw-r--r-- | drivers/crypto/padlock-aes.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index 856b3cc25583..87f92c39b5f0 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c | |||
| @@ -154,7 +154,11 @@ static inline void padlock_reset_key(struct cword *cword) | |||
| 154 | int cpu = raw_smp_processor_id(); | 154 | int cpu = raw_smp_processor_id(); |
| 155 | 155 | ||
| 156 | if (cword != per_cpu(last_cword, cpu)) | 156 | if (cword != per_cpu(last_cword, cpu)) |
| 157 | #ifndef CONFIG_X86_64 | ||
| 157 | asm volatile ("pushfl; popfl"); | 158 | asm volatile ("pushfl; popfl"); |
| 159 | #else | ||
| 160 | asm volatile ("pushfq; popfq"); | ||
| 161 | #endif | ||
| 158 | } | 162 | } |
| 159 | 163 | ||
| 160 | static inline void padlock_store_cword(struct cword *cword) | 164 | static inline void padlock_store_cword(struct cword *cword) |
| @@ -208,10 +212,19 @@ static inline void padlock_xcrypt_ecb(const u8 *input, u8 *output, void *key, | |||
| 208 | 212 | ||
| 209 | asm volatile ("test $1, %%cl;" | 213 | asm volatile ("test $1, %%cl;" |
| 210 | "je 1f;" | 214 | "je 1f;" |
| 215 | #ifndef CONFIG_X86_64 | ||
| 211 | "lea -1(%%ecx), %%eax;" | 216 | "lea -1(%%ecx), %%eax;" |
| 212 | "mov $1, %%ecx;" | 217 | "mov $1, %%ecx;" |
| 218 | #else | ||
| 219 | "lea -1(%%rcx), %%rax;" | ||
| 220 | "mov $1, %%rcx;" | ||
| 221 | #endif | ||
| 213 | ".byte 0xf3,0x0f,0xa7,0xc8;" /* rep xcryptecb */ | 222 | ".byte 0xf3,0x0f,0xa7,0xc8;" /* rep xcryptecb */ |
| 223 | #ifndef CONFIG_X86_64 | ||
| 214 | "mov %%eax, %%ecx;" | 224 | "mov %%eax, %%ecx;" |
| 225 | #else | ||
| 226 | "mov %%rax, %%rcx;" | ||
| 227 | #endif | ||
| 215 | "1:" | 228 | "1:" |
| 216 | ".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */ | 229 | ".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */ |
| 217 | : "+S"(input), "+D"(output) | 230 | : "+S"(input), "+D"(output) |
