crypto/modes/modes_lcl.h: let STRICT_ALIGNMENT be on ARMv7.
authorAndy Polyakov <appro@openssl.org>
Sat, 13 Apr 2013 18:57:37 +0000 (20:57 +0200)
committerAndy Polyakov <appro@openssl.org>
Sat, 13 Apr 2013 19:19:16 +0000 (21:19 +0200)
While ARMv7 in general is capable of unaligned access, not all instructions
actually are. And trouble is that compiler doesn't seem to differentiate
those capable and incapable of unaligned access. Side effect is that kernel
goes into endless loop retrying same instruction triggering unaligned trap.
Problem was observed in xts128.c and ccm128.c modules. It's possible to
resolve it by using (volatile u32*) casts, but letting STRICT_ALIGNMENT
be feels more appropriate.
(cherry picked from commit 3bdd80521a81d50ade4214053cd9b293f920a77b)

crypto/modes/modes_lcl.h

index b6dc3c336fe09c0c627bc431e7e7089227ebf7d5..934e8c8515e1fdd8800eee07670b43c879417d21 100644 (file)
@@ -29,10 +29,7 @@ typedef unsigned char u8;
 #if defined(__i386)    || defined(__i386__)    || \
     defined(__x86_64)  || defined(__x86_64__)  || \
     defined(_M_IX86)   || defined(_M_AMD64)    || defined(_M_X64) || \
 #if defined(__i386)    || defined(__i386__)    || \
     defined(__x86_64)  || defined(__x86_64__)  || \
     defined(_M_IX86)   || defined(_M_AMD64)    || defined(_M_X64) || \
-    defined(__s390__)  || defined(__s390x__)   || \
-    ( (defined(__arm__)        || defined(__arm)) && \
-      (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
-       defined(__ARM_ARCH_7R__)        || defined(__ARM_ARCH_7M__)) )
+    defined(__s390__)  || defined(__s390x__)
 # undef STRICT_ALIGNMENT
 #endif
 
 # undef STRICT_ALIGNMENT
 #endif