crypto: xor - Check for osxsave as well as avx in crypto/xor
authorJohn Haxby <john.haxby@oracle.com>
Wed, 14 Aug 2013 15:23:18 +0000 (16:23 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 21 Aug 2013 11:08:35 +0000 (21:08 +1000)
This affects xen pv guests with sufficiently old versions of xen and
sufficiently new hardware.  On such a system, a guest with a btrfs
root won't even boot.

Signed-off-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/include/asm/xor_avx.h

index 7ea79c5..492b298 100644 (file)
@@ -167,12 +167,12 @@ static struct xor_block_template xor_block_avx = {
 
 #define AVX_XOR_SPEED \
 do { \
-       if (cpu_has_avx) \
+       if (cpu_has_avx && cpu_has_osxsave) \
                xor_speed(&xor_block_avx); \
 } while (0)
 
 #define AVX_SELECT(FASTEST) \
-       (cpu_has_avx ? &xor_block_avx : FASTEST)
+       (cpu_has_avx && cpu_has_osxsave ? &xor_block_avx : FASTEST)
 
 #else