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: 47091 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F1CF520553 for ; Sat, 11 Apr 2015 13:32:57 +0000 (UTC) Received: by wiun10 with SMTP id n10sf1849834wiu.1 for ; Sat, 11 Apr 2015 06:32:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=Tp0CvUXDWz60qB5BkNMZrwLHkdcPV+B6gQEJfVllcmE=; b=PixOIT6fTtLxM08txK2uOWzyfclFYYdJ2OB1OAD15aLxGAnl4QTpunlSRfuSJTdN9j CuxnF6tEAVTp3cy6zaT6zxNJeCy3ivJYb1c/OUsdTbWvZs3wRzC2ewTA7KRyIXUn5Dj9 YgrU6cwvQ4p97vTDjZ3KkwNwDMBKlzD06lAboaahvFVjuYObT2sbSqtYf9f8Pe8h3ElH Hp1Ak6G6Bjep8nHDqbsIQlq/Ux0+9cWLe8ShZCy0bR6EV10PU3r28coDbi52nSny0lKh LDBKCYhDT7D5PcBmSYTwr2Ygb+wbdHjXM9kbagNaExf8QlfHX/s2DOS0+EWKJTmtkZFo Z6zA== X-Gm-Message-State: ALoCoQlTCTrbkudcvo0VtKYE8Ycc1GX09ESnW5t4r22OItpjiH45f5h8ZR1qMe0NGmtm0kgl9V29 X-Received: by 10.194.95.67 with SMTP id di3mr1024250wjb.0.1428759177268; Sat, 11 Apr 2015 06:32:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.65 with SMTP id c1ls197746lae.46.gmail; Sat, 11 Apr 2015 06:32:57 -0700 (PDT) X-Received: by 10.112.90.201 with SMTP id by9mr5482937lbb.30.1428759177074; Sat, 11 Apr 2015 06:32:57 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id r2si3853157lbf.41.2015.04.11.06.32.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Apr 2015 06:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by layy10 with SMTP id y10so30264825lay.0 for ; Sat, 11 Apr 2015 06:32:56 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr5475386lac.41.1428759176893; Sat, 11 Apr 2015 06:32:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp310352lbt; Sat, 11 Apr 2015 06:32:55 -0700 (PDT) X-Received: by 10.70.65.39 with SMTP id u7mr11108582pds.11.1428759174929; Sat, 11 Apr 2015 06:32:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id in9si7305747pbc.194.2015.04.11.06.32.53; Sat, 11 Apr 2015 06:32:54 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755314AbbDKNct (ORCPT + 27 others); Sat, 11 Apr 2015 09:32:49 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34480 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753813AbbDKNcq (ORCPT ); Sat, 11 Apr 2015 09:32:46 -0400 Received: by widjs5 with SMTP id js5so33358928wid.1 for ; Sat, 11 Apr 2015 06:32:45 -0700 (PDT) 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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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