On 1 April 2014 14:37, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> wrote: > On 1 April 2014 13:23, kbuild test robot <fengguang.wu@xxxxxxxxx> wrote: >> tree: git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git master >> head: 8ceee72808d1ae3fb191284afc2257a2be964725 >> commit: 8ceee72808d1ae3fb191284afc2257a2be964725 [60/60] crypto: ghash-clmulni-intel - use C implementation for setkey() >> reproduce: make C=1 CF=-D__CHECK_ENDIAN__ >> >> >> sparse warnings: (new ones prefixed by >>) >> >>>> arch/x86/crypto/ghash-clmulni-intel_glue.c:71:25: sparse: cast to restricted __be64 >>>> arch/x86/crypto/ghash-clmulni-intel_glue.c:72:25: sparse: cast to restricted __be64 >> > > Sigh. > > The sparse warnings /without/ the be64 casts are even worse. > > The obvious fix is not to use a be128 for the key, as it is obviously > an opaque type that just represents a byte array. > So, Herbert, if you prefer, I can rework this patch to use be128 > instead of u128 inside struct ghash_ctx, but it will have some fallout Sorry, I meant 'use u128 instead of be128' > throughout the file. Or instead, we cast to '__force __be64', > basically just telling sparse to shut up ... > -- Ard. >> vim +71 arch/x86/crypto/ghash-clmulni-intel_glue.c >> >> 65 } >> 66 >> 67 /* perform multiplication by 'x' in GF(2^128) */ >> 68 a = be64_to_cpu(x->a); >> 69 b = be64_to_cpu(x->b); >> 70 >> > 71 ctx->shash.a = (__be64)((b << 1) | (a >> 63)); >> > 72 ctx->shash.b = (__be64)((a << 1) | (b >> 63)); >> 73 >> 74 if (a >> 63) >> 75 ctx->shash.b ^= cpu_to_be64(0xc2); >> >> --- >> 0-DAY kernel build testing backend Open Source Technology Center >> http://lists.01.org/mailman/listinfo/kbuild Intel Corporation -- 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