From patchwork Sat Apr 11 13:32:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 6201541 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 BA6749F313 for ; Sat, 11 Apr 2015 13:33:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B80CD202E5 for ; Sat, 11 Apr 2015 13:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE926202B4 for ; Sat, 11 Apr 2015 13:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754889AbbDKNcr (ORCPT ); Sat, 11 Apr 2015 09:32:47 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:38435 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754196AbbDKNcq (ORCPT ); Sat, 11 Apr 2015 09:32:46 -0400 Received: by wiun10 with SMTP id n10so24303551wiu.1 for ; Sat, 11 Apr 2015 06:32:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h/GzhMLIoBnCKlg0Xfl9DLeLf6H3v0lUwqFUQ6iP5G8=; b=VaHOSgg+oufHNSZQBE1Bv3QITbhEZ/XBqgMEsi9tcUKgGXB1LQUpwqV02EodSmXlAC XYur/3HFO3bE6aoGi/SxF+sz9SKJthJqwvJu/ImiD+3I8irhQVe9SCi47cevFwGh2bJE wPnwv8q/J/aob/PdNPOSbyxFN0sxz5kZjDObSb6yMf3N9Y8ku8jpNJ7jmKzsY55Ye31J HMEUt1AziAxVq01itKZUuNHfyUjTgtZUQJDuE0aUdXZIupKy53GK+7Shcw7gaxXe1TfY Hn/hjw4W2v6MEWpF+kbbDXgcD1c7vQ+9mgqiQj9uKK+BuqNknRQ2mqnaH2ytdg8lVhtv I+tQ== X-Gm-Message-State: ALoCoQlRvC9h2utSIIqoi88swhJSRIXujdStaQ7tpGbpAfip231oQ+tYkipS91jkFnD/aTJfc1BV X-Received: by 10.180.99.42 with SMTP id en10mr1623362wib.83.1428759165473; Sat, 11 Apr 2015 06:32:45 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.5.25]) by mx.google.com with ESMTPSA id n3sm2807173wja.36.2015.04.11.06.32.42 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Apr 2015 06:32:44 -0700 (PDT) From: Ard Biesheuvel To: herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, davem@davemloft.net, arnd@arndb.de Cc: Ard Biesheuvel Subject: [PATCH] crypto: arm: workaround for building with old binutils Date: Sat, 11 Apr 2015 15:32:34 +0200 Message-Id: <1428759154-16251-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 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=unavailable 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 From: Arnd Bergmann How about something like this: A warning will be emitted by make when descending into the arch/arm/crypto directory, but only if any ARMv8 Crypto modules were in fact selected. /home/ard/linux-2.6/arch/arm/crypto/Makefile:22: These ARMv8 Crypto Extensions modules need binutils 2.23 or higher /home/ard/linux-2.6/arch/arm/crypto/Makefile:23: aes-arm-ce.o sha1-arm-ce.o sha2-arm-ce.o ghash-arm-ce.o ----------------->8------------------ Old versions of binutils (before 2.23) do not yet understand the crypto-neon-fp-armv8 fpu instructions, and an attempt to build these files results in a build failure: arch/arm/crypto/aes-ce-core.S:133: Error: selected processor does not support ARM mode `vld1.8 {q10-q11},[ip]!' arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aese.8 q0,q8' arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aesmc.8 q0,q0' arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aese.8 q0,q9' arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aesmc.8 q0,q0' Since the affected versions are still in widespread use, and this breaks 'allmodconfig' builds, we should try to at least get a successful kernel build. Unfortunately, I could not come up with a way to make the Kconfig symbol depend on the binutils version, which would be the nicest solution. Instead, this patch uses the 'as-instr' Kbuild macro to find out whether the support is present in the assembler, and otherwise emits a non-fatal warning indicating which selected modules could not be built. Signed-off-by: Arnd Bergmann Link: http://storage.kernelci.org/next/next-20150410/arm-allmodconfig/build.log Fixes: 864cbeed4ab22d ("crypto: arm - add support for SHA1 using ARMv8 Crypto Instructions") [ard.biesheuvel: - omit modules entirely instead of building empty ones if binutils is too old - update commit log accordingly] Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Makefile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile index b37597ad979c..fc5150702b64 100644 --- a/arch/arm/crypto/Makefile +++ b/arch/arm/crypto/Makefile @@ -4,14 +4,25 @@ obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o obj-$(CONFIG_CRYPTO_AES_ARM_BS) += aes-arm-bs.o -obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o obj-$(CONFIG_CRYPTO_SHA1_ARM_NEON) += sha1-arm-neon.o obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o obj-$(CONFIG_CRYPTO_SHA512_ARM) += sha512-arm.o -obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o -obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o -obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o + +ce-obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o +ce-obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o +ce-obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o +ce-obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o + +ifneq ($(ce-obj-y)$(ce-obj-m),) +ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y) +obj-y += $(ce-obj-y) +obj-m += $(ce-obj-m) +else +$(warning These ARMv8 Crypto Extensions modules need binutils 2.23 or higher) +$(warning $(ce-obj-y) $(ce-obj-m)) +endif +endif aes-arm-y := aes-armv4.o aes_glue.o aes-arm-bs-y := aesbs-core.o aesbs-glue.o