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)