From patchwork Sat Apr 11 08:48:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 6201181 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5EFDD9F1C4 for ; Sat, 11 Apr 2015 08:49:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D5D0202AE for ; Sat, 11 Apr 2015 08:49:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E5A120265 for ; Sat, 11 Apr 2015 08:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbbDKItA (ORCPT ); Sat, 11 Apr 2015 04:49:00 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:54689 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbbDKIs5 (ORCPT ); Sat, 11 Apr 2015 04:48:57 -0400 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0LzYuY-1ZTbtE0poA-014j0T; Sat, 11 Apr 2015 10:48:46 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , "samitolvanen@google.com" , "linux-crypto@vger.kernel.org" , "herbert@gondor.apana.org.au" Subject: Re: [PATCH v2] crypto/arm: accelerated SHA-512 using ARM generic ASM and NEON Date: Sat, 11 Apr 2015 10:48:44 +0200 Message-ID: <2845656.4sNJ3XBxnz@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1428676148-28210-1-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 X-Provags-ID: V03:K0:lNEqMQ4MmPp/IqYL29gZygV43M9OPFuHze7lIYChrEX3VsaI4OS xk5keG8sXgjnjmTP//nlHUNsHiFWsrvlN8p7wKAMoVJPUCZT7jUOngn0cdsq4t0V6KHJaxB LPzXEoQkh8m8U99sYTNJO7hyUMO7rUYr46YJaXs5P3R1+S8K6Jc2MgAupTNjV7VS45mm9CE BG+qfULWHtEtCceM+GMCg== X-UI-Out-Filterresults: notjunk:1; Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Saturday 11 April 2015 09:35:15 Ard Biesheuvel wrote: > On 10 April 2015 at 22:23, Ard Biesheuvel wrote: > > > >> On 10 apr. 2015, at 22:08, Arnd Bergmann wrote: > >> > >>> On Friday 10 April 2015 16:29:08 Ard Biesheuvel wrote: > >>> +#if __ARM_MAX_ARCH__>=7 > >>> +.arch armv7-a > >>> +.fpu neon > >>> + > >> > >> This will cause a build failure on an ARMv7-M build, which is incompatible > >> with .arch armv7-a and .fpu neon. > >> > > > > The neon part depends on CONFIG_KERNEL_MODE_NEON, which would never be set for that platform, I suppose > > On second thought, that is not entirely true, but I still don't think > there is problem here: > the .arch/.fpu declarations are understood perfectly fine by GAS when > targeting ARMv7-M. Only, it will emit code that is incompatible with > it. However, this code is invoked at runtime only if a NEON unit has > been detected, so it will just be ignored on ARMv7-M Sorry, I should have collected my findings better when replying to your patch. What I remembered was that I saw a problem in this area in linux-next with randconfig builds, but I did not notice that it was for a different file, and I had not double-checked that patch yet in order to send it out. See below for the patch I'm currently using for my randconfig builder. Before you apply this, please check again which files are affected, as it's possible that there are other modules that suffer from the same problem. Arnd 8<----------- Subject: [PATCH] ARM: crypto: avoid sha256 code on ARMv7-M The sha256 assembly implementation can deal with all architecture levels from ARMv4 to ARMv7-A, but not with ARMv7-M. Enabling it in an ARMv7-M kernel results in this build failure: arm-linux-gnueabi-ld: error: arch/arm/crypto/sha256_glue.o: Conflicting architecture profiles M/A arm-linux-gnueabi-ld: failed to merge target specific data of file arch/arm/crypto/sha256_glue.o This adds a Kconfig dependency to prevent the code from being disabled for ARMv7-M. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index 458729d2ce22..76463da22f81 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -49,6 +49,7 @@ config CRYPTO_SHA2_ARM_CE config CRYPTO_SHA256_ARM tristate "SHA-224/256 digest algorithm (ARM-asm and NEON)" select CRYPTO_HASH + depends on !CPU_V7M help SHA-256 secure hash standard (DFIPS 180-2) implemented using optimized ARM assembler and NEON, when available.