2009-05-10 16:03:58

by Harald Welte

[permalink] [raw]
Subject: [PATCH] Enable VIA PadLock on x86_64

[CRYPTO] Support VIA PadLock hardware crypto on x86-64

The VIA Nano CPU supports x86_64, so it is now wrong to assume PadLock
would only exist on X86_32 builds.

This patch just alters Kconfig to reflect this fact, as well as a trivial
one-line fix to an assembly statement in padlock-aes.c

Signed-off-by: Harald Welte <[email protected]>

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 01afd75..39eedd4 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -12,7 +12,7 @@ if CRYPTO_HW

config CRYPTO_DEV_PADLOCK
tristate "Support for VIA PadLock ACE"
- depends on X86_32 && !UML
+ depends on !UML
select CRYPTO_ALGAPI
help
Some VIA processors come with an integrated crypto engine
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index 3f0fdd1..d3f6e32 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))
+#ifdef CONFIG_X86_32
asm volatile ("pushfl; popfl");
+#else
+ asm volatile ("pushf; popf");
+#endif
}

static inline void padlock_store_cword(struct cword *cword)

--
- Harald Welte <[email protected]> http://linux.via.com.tw/
============================================================================
VIA Open Source Liaison


2009-05-10 16:29:06

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] Enable VIA PadLock on x86_64

On Mon, May 11, 2009 at 12:03:41AM +0800, Harald Welte wrote:
> [CRYPTO] Support VIA PadLock hardware crypto on x86-64
>
> The VIA Nano CPU supports x86_64, so it is now wrong to assume PadLock
> would only exist on X86_32 builds.
>
> This patch just alters Kconfig to reflect this fact, as well as a trivial
> one-line fix to an assembly statement in padlock-aes.c
>
> Signed-off-by: Harald Welte <[email protected]>

A similar patch is already in cryptodev. Thanks!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2009-05-11 02:58:44

by Harald Welte

[permalink] [raw]
Subject: Re: [PATCH] Enable VIA PadLock on x86_64

On Mon, May 11, 2009 at 12:03:41AM +0800, Harald Welte wrote:
> [CRYPTO] Support VIA PadLock hardware crypto on x86-64

Sorry, I should have read the list archives before posting.

Please apply the more correct patch from Sebastian Andrzej Siewior
as available since March 14 at
http://www.mail-archive.com/[email protected]/msg03024.html

Is there any reason I'm missing that this patch is not mainline yet? It's
a quite trivial bugfix. So please consider this mail as a polite reminder :)

Thanks in advance.

--
- Harald Welte <[email protected]> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)

2009-05-15 05:59:14

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] Enable VIA PadLock on x86_64

On Mon, May 11, 2009 at 10:29:01AM +0800, Harald Welte wrote:
> On Mon, May 11, 2009 at 12:03:41AM +0800, Harald Welte wrote:
> > [CRYPTO] Support VIA PadLock hardware crypto on x86-64
>
> Sorry, I should have read the list archives before posting.
>
> Please apply the more correct patch from Sebastian Andrzej Siewior
> as available since March 14 at
> http://www.mail-archive.com/[email protected]/msg03024.html
>
> Is there any reason I'm missing that this patch is not mainline yet? It's
> a quite trivial bugfix. So please consider this mail as a polite reminder :)

It's in cryptodev and should be in the release after 2.6.30.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt