Subject: [PATCH] [crypto] geode: fix not inplace encryption

Currently the Geode AES module fails to encrypt or decrypt if
the coherent bits are not set what is currently the case if the
encryption does not occur inplace. However, the encryption works
on my Geode machine _only_ if the coherent bits are always set.

Cc: Jordan Crouse <[email protected]>
Signed-off-by: Sebastian Siewior <[email protected]>
---
drivers/crypto/geode-aes.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index f2d4fba..0ca92d4 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -81,8 +81,7 @@ geode_aes_crypt(struct geode_aes_op *op)
* we don't need to worry
*/

- if (op->src == op->dst)
- flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
+ flags |= (AES_CTRL_DCA | AES_CTRL_SCA);

if (op->dir == AES_DIR_ENCRYPT)
flags |= AES_CTRL_ENCRYPT;
--
1.5.3.4


2007-11-06 21:32:09

by Jordan Crouse

[permalink] [raw]
Subject: Re: geode: fix not inplace encryption

On 06/11/07 21:01 +0100, Sebastian Siewior wrote:
> Currently the Geode AES module fails to encrypt or decrypt if
> the coherent bits are not set what is currently the case if the
> encryption does not occur inplace. However, the encryption works
> on my Geode machine _only_ if the coherent bits are always set.
>
> Cc: Jordan Crouse <[email protected]>
> Signed-off-by: Sebastian Siewior <[email protected]>

Acked-by: Jordan Crouse <[email protected]>

Anything in the cache is suspect - turning on coherency is the best plan
to be rock solid.

> ---
> drivers/crypto/geode-aes.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
> index f2d4fba..0ca92d4 100644
> --- a/drivers/crypto/geode-aes.c
> +++ b/drivers/crypto/geode-aes.c
> @@ -81,8 +81,7 @@ geode_aes_crypt(struct geode_aes_op *op)
> * we don't need to worry
> */
>
> - if (op->src == op->dst)
> - flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
> + flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
>
> if (op->dir == AES_DIR_ENCRYPT)
> flags |= AES_CTRL_ENCRYPT;
> --
> 1.5.3.4
>
>
>

--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.

2007-11-10 11:39:21

by Herbert Xu

[permalink] [raw]
Subject: Re: geode: fix not inplace encryption

On Tue, Nov 06, 2007 at 02:30:40PM -0700, Jordan Crouse wrote:
> On 06/11/07 21:01 +0100, Sebastian Siewior wrote:
> > Currently the Geode AES module fails to encrypt or decrypt if
> > the coherent bits are not set what is currently the case if the
> > encryption does not occur inplace. However, the encryption works
> > on my Geode machine _only_ if the coherent bits are always set.
> >
> > Cc: Jordan Crouse <[email protected]>
> > Signed-off-by: Sebastian Siewior <[email protected]>
>
> Acked-by: Jordan Crouse <[email protected]>
>
> Anything in the cache is suspect - turning on coherency is the best plan
> to be rock solid.

Patch applied. 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

Subject: Re: geode: fix not inplace encryption

* Herbert Xu | 2007-11-10 19:39:14 [+0800]:

>On Tue, Nov 06, 2007 at 02:30:40PM -0700, Jordan Crouse wrote:
>> On 06/11/07 21:01 +0100, Sebastian Siewior wrote:
>> > Currently the Geode AES module fails to encrypt or decrypt if
>> > the coherent bits are not set what is currently the case if the
>> > encryption does not occur inplace. However, the encryption works
>> > on my Geode machine _only_ if the coherent bits are always set.
>> >
>> > Cc: Jordan Crouse <[email protected]>
>> > Signed-off-by: Sebastian Siewior <[email protected]>
>>
>> Acked-by: Jordan Crouse <[email protected]>
>>
>> Anything in the cache is suspect - turning on coherency is the best plan
>> to be rock solid.
>
>Patch applied. Thanks.
I haven't seen this patch in your crypto tree. Do you think about
pushing this into .24?

Sebastian

2007-11-11 11:05:46

by Herbert Xu

[permalink] [raw]
Subject: Re: geode: fix not inplace encryption

On Sat, Nov 10, 2007 at 09:58:19PM +0100, Sebastian Siewior wrote:
>
> I haven't seen this patch in your crypto tree. Do you think about
> pushing this into .24?

Yes I'll take care of that.

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