Herbert Xu a écrit :
Séguier Régis <rseguier@xxxxxxxxxxxxxx> wrote:
Hi,
With 2.6.31, at boot time,i got this error.
The previous version i use was 2.6.31-rc6 and work fine for me.
cpuidle: using governor menu
padlock: Using VIA PadLock ACE for AES algorithm.
general protection fault: 0000 [#1] PREEMPT
last sysfs file:
Pid: 83, comm: cryptomgr_test Not tainted (2.6.31EPIA_NAB7500 #311)
CN896-8251
EIP: 0060:[<c1247ef5>] EFLAGS: 00010202 CPU: 0
EIP is at padlock_sha1_finup+0x1a2/0x1f3
EAX: 00000000 EBX: 00000003 ECX: 00000003 EDX: 00000001
ESI: f734f000 EDI: f7367c88 EBP: f7367d18 ESP: f7367c18
This looks like an alignment fault.
Can you please try this patch? Thanks!
diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c
index 76cb6b3..fe007b6 100644
--- a/drivers/crypto/padlock-sha.c
+++ b/drivers/crypto/padlock-sha.c
@@ -24,6 +24,12 @@
#include <asm/i387.h>
#include "padlock.h"
+#ifdef CONFIG_64BIT
+#define STACK_ALIGN 16
+#else
+#define STACK_ALIGN 4
+#endif
+
struct padlock_sha_desc {
struct shash_desc fallback;
};
@@ -64,7 +70,8 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in,
/* We can't store directly to *out as it may be unaligned. */
/* BTW Don't reduce the buffer size below 128 Bytes!
* PadLock microcode needs it that big. */
- char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT)));
+ char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN];
+ char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
struct sha1_state state;
unsigned int space;
@@ -128,7 +135,8 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in,
/* We can't store directly to *out as it may be unaligned. */
/* BTW Don't reduce the buffer size below 128 Bytes!
* PadLock microcode needs it that big. */
- char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT)));
+ char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN];
+ char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
struct sha256_state state;
unsigned int space;
it's good for me now.
Thanks.
--
Régis Séguier
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html