path: root/drivers/crypto/padlock-aes.c
diff options
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>2009-04-21 14:14:37 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2009-06-02 14:04:31 +1000
commitd1c8b0a7692e81b46550bcc493465ed10510cd33 (patch)
tree16a9c6065b23cbd625873797b0e94f1a1e285b43 /drivers/crypto/padlock-aes.c
parent962a9c99496f98041d14d64a9fdcf58050fefb4d (diff)
crypto: padlock - Enable on x86_64
Almost everything stays the same, we need just to use the extended registers on the bit variant. Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/padlock-aes.c')
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)
int cpu = raw_smp_processor_id();
if (cword != per_cpu(last_cword, cpu))
+#ifndef CONFIG_X86_64
asm volatile ("pushfl; popfl");
+ asm volatile ("pushfq; popfq");
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,
asm volatile ("test $1, %%cl;"
"je 1f;"
+#ifndef CONFIG_X86_64
"lea -1(%%ecx), %%eax;"
"mov $1, %%ecx;"
+ "lea -1(%%rcx), %%rax;"
+ "mov $1, %%rcx;"
".byte 0xf3,0x0f,0xa7,0xc8;" /* rep xcryptecb */
+#ifndef CONFIG_X86_64
"mov %%eax, %%ecx;"
+ "mov %%rax, %%rcx;"
".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */
: "+S"(input), "+D"(output)