From patchwork Tue Feb 28 14:36:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 94616 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1348891qgi; Tue, 28 Feb 2017 06:37:08 -0800 (PST) X-Received: by 10.98.3.3 with SMTP id 3mr2845332pfd.95.1488292628145; Tue, 28 Feb 2017 06:37:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si1948450pli.158.2017.02.28.06.37.08; Tue, 28 Feb 2017 06:37:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751769AbdB1OhH (ORCPT + 1 other); Tue, 28 Feb 2017 09:37:07 -0500 Received: from mail-wr0-f177.google.com ([209.85.128.177]:36225 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbdB1OhG (ORCPT ); Tue, 28 Feb 2017 09:37:06 -0500 Received: by mail-wr0-f177.google.com with SMTP id u108so10177231wrb.3 for ; Tue, 28 Feb 2017 06:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=mbYHBP1UoVzTL42a8kkkaSlgG5j1YM4w4xjvK3bgz80=; b=A9f2cdxKdaIvpyEF9jt/wJyICzPpzkmj3gUnfYlk4/Uk8AHCMyh3eUcuudm5fpgA9a AYvcZU4m/Y0wdVtBDPpjEfCaRazrdxZnbu77Em3TkdQ92itg6Q3tWh/xpveFKMLv3+SM ajFYs/uo4w+s4452KcN8VzbnlYlcpCcmJOu18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mbYHBP1UoVzTL42a8kkkaSlgG5j1YM4w4xjvK3bgz80=; b=lzN8astXLkdhMrTGG64OEBJ01YLZ6/lbk8iBXqM6udFoFb9yyig6vV2VxB0tgnC4x6 7lc/l8YHWnJTly+aT5e4C8nAionXw0pT0WrLrMyHKLb8tNtLwmX5ZxpQM2MTOb3nDcbg YUJBWdP6sNxYi3ktyDnb3suSymFxOKwcMcRemOjszB9K9drYK8FehZnbDJ6Xz91LLpj7 uIanjDX6OYxsqYiG7sqQrgRkSB1odggrTsGzNq6kvko+KXcskM+hhLd3P/7tdSjxGJTe s8E3jmpRMwh5EPmqtP1Fv9em2ebWVe6w8o/yHEF/DHiIDQa1B2LIQb5xtlLgEJOrlaim 3nVQ== X-Gm-Message-State: AMke39kvz8IJ2kdABwLY3yZbCgkFF2+kY6Iwt26rs9LwiS3xceDgXUbrmkoP4gzxsmOkmohC X-Received: by 10.223.138.250 with SMTP id z55mr2885076wrz.130.1488292624883; Tue, 28 Feb 2017 06:37:04 -0800 (PST) Received: from localhost.localdomain ([105.149.201.216]) by smtp.gmail.com with ESMTPSA id c9sm2934066wmf.18.2017.02.28.06.37.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 06:37:04 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, arnd@arndb.de Cc: herbert@gondor.apana.org.au, jonathanh@nvidia.com, Ard Biesheuvel Subject: [PATCH 1/2] crypto: arm/crc32 - fix build error with outdated binutils Date: Tue, 28 Feb 2017 14:36:56 +0000 Message-Id: <1488292617-27317-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Annotate a vmov instruction with an explicit element size of 32 bits. This is inferred by recent toolchains, but apparently, older versions need some help figuring this out. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/crc32-ce-core.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/arm/crypto/crc32-ce-core.S b/arch/arm/crypto/crc32-ce-core.S index e63d400dc5c1..5cbd4a6fedad 100644 --- a/arch/arm/crypto/crc32-ce-core.S +++ b/arch/arm/crypto/crc32-ce-core.S @@ -135,7 +135,7 @@ ENTRY(crc32c_pmull_le) vld1.8 {q3-q4}, [BUF, :128]! vmov.i8 qzr, #0 vmov.i8 qCONSTANT, #0 - vmov dCONSTANTl[0], CRC + vmov.32 dCONSTANTl[0], CRC veor.8 d2, d2, dCONSTANTl sub LEN, LEN, #0x40 cmp LEN, #0x40 From patchwork Tue Feb 28 14:36:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 94617 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1349019qgi; Tue, 28 Feb 2017 06:37:27 -0800 (PST) X-Received: by 10.99.36.3 with SMTP id k3mr2968557pgk.136.1488292647087; Tue, 28 Feb 2017 06:37:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si1937373pgj.250.2017.02.28.06.37.26; Tue, 28 Feb 2017 06:37:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbdB1OhT (ORCPT + 1 other); Tue, 28 Feb 2017 09:37:19 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:34975 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbdB1OhR (ORCPT ); Tue, 28 Feb 2017 09:37:17 -0500 Received: by mail-wm0-f54.google.com with SMTP id v186so87084978wmd.0 for ; Tue, 28 Feb 2017 06:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jUfrP4iIjw6iDDWZlwX4C3xlMbdoYFzSjfiaQc1oi4Q=; b=jUNnj7jmlaI2G3SLfCtiw5+yYyHuGxC89JHCsXKJ+3WyK5x1acygbUlMuH4E0Jh5vd sgWumrw9H0uliOpGX/E5iSBBPJKGeYQm93+rpEbDmGr3XOZHWj+dxDY2WY+nSw5LdGBc aFDY1/ZX0znk47w+5ojr8RDoSgFfN0oXt8qDs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jUfrP4iIjw6iDDWZlwX4C3xlMbdoYFzSjfiaQc1oi4Q=; b=ZH+87G0AlZc3dgkBsrZNIiN60engiGC7Ge+I89QmzEKxnaY3qvwJjZsTImMwS1yDiX WCXbJSsmT8o9vLTn1la2L3OUn8oV6qp/dg9w5uYoYE9ASsFwr4gX7sXwMNWRz2rRmyd9 1F0eCI9e30r9yLVhIkqKUCfHsb2B9wkv7wP7nRPSLzW0Wl6TuPJdHjwA0JnyCUqMka// Y+bSKWg1EL426+eVUWBtAJq2qUOUY2jGJxggaVvntEB6rTIaqeIes5b+u46QqpplTEaf INvK/xuKrogQDR9h8UXQi9moq8VC6UaUiGOzWvq1avz4yLfRqgDyhe07H3hiisjE2dXA em+g== X-Gm-Message-State: AMke39lEFpljHDMqz5TE6x5nk1KFyRpSKYr65BLCh8YgOiuRaeU+BZda56KfFMc4B49lz1iG X-Received: by 10.28.227.213 with SMTP id a204mr2610981wmh.120.1488292627082; Tue, 28 Feb 2017 06:37:07 -0800 (PST) Received: from localhost.localdomain ([105.149.201.216]) by smtp.gmail.com with ESMTPSA id c9sm2934066wmf.18.2017.02.28.06.37.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 06:37:06 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, arnd@arndb.de Cc: herbert@gondor.apana.org.au, jonathanh@nvidia.com, Ard Biesheuvel Subject: [PATCH 2/2] crypto: arm - add build time test for CRC instruction support Date: Tue, 28 Feb 2017 14:36:57 +0000 Message-Id: <1488292617-27317-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488292617-27317-1-git-send-email-ard.biesheuvel@linaro.org> References: <1488292617-27317-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The accelerated CRC32 module for ARM may use either the scalar CRC32 instructions, the NEON 64x64 to 128 bit polynomial multiplication (vmull.p64) instruction, or both, depending on what the current CPU supports. However, this also requires support in binutils, and as it turns out, versions of binutils exist that support the vmull.p64 instruction but not the crc32 instructions. So refactor the Makefile logic so that this module only gets built if binutils has support for both. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.7.4 Acked-by: Jon Hunter Tested-by: Jon Hunter diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile index 1822c4697278..f2215fbeed13 100644 --- a/arch/arm/crypto/Makefile +++ b/arch/arm/crypto/Makefile @@ -15,7 +15,17 @@ 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 ce-obj-$(CONFIG_CRYPTO_CRCT10DIF_ARM_CE) += crct10dif-arm-ce.o -ce-obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o +crc-obj-$(CONFIG_CRYPTO_CRC32_ARM_CE) += crc32-arm-ce.o + +ifneq ($(crc-obj-y)$(crc-obj-m),) +ifeq ($(call as-instr,.arch armv8-a\n.arch_extension crc,y,n),y) +ce-obj-y += $(crc-obj-y) +ce-obj-m += $(crc-obj-m) +else +$(warning These CRC Extensions modules need binutils 2.23 or higher) +$(warning $(crc-obj-y) $(crc-obj-m)) +endif +endif ifneq ($(ce-obj-y)$(ce-obj-m),) ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y)