From patchwork Tue Sep 17 08:50:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 173882 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp847440ill; Tue, 17 Sep 2019 01:50:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsRV3LmX26S7/ZRGyeriTGbGtdB02Ivj2suJA+xcI7T4fWraxP2vUmMG2Nlh4UpNN9RRo0 X-Received: by 2002:aa7:d607:: with SMTP id c7mr3484780edr.286.1568710224274; Tue, 17 Sep 2019 01:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568710224; cv=none; d=google.com; s=arc-20160816; b=XoTona8rimfQ8nXIahFNuVwcUSLKwj/AWWZ1q+7umDUuPMk36hYjKerbHYwUGR0Zy8 D8zGkwJau52UjYZRw7F3cpiLmDvtn7avXzAnbep5I0boDFmPNSahYfJxculI55jVMhBp S7ZGtpN7U/czvkcuLWmNbFUTzD4s/7SD7imijDmPylLiyZAeHBWKVhQSVjomvCgDegg8 VxOnjWojp0b6qQmmZygEMWbsO7hzvLoRJudzILUCy6TW7H5m4PoU9Pkhj+g0exbO8BrK eh0isbyk7NiGRhYKcd8CVm/3gf3yjq7wH2NyrxRXAszSPtyMN5Ra4qb0F7kSn+LGj6AK r1Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=zTWR43FDou9WAzRxjbQnIKVbh9jsI3YAGJPVast+jI8=; b=fy8VYdlUC/WIbuy2yH5NLqsXMY1VkZsF31JdY4haegR4zT1RsN32wDuxWeBnbHFkYU zvEjqz2xfQ5teRAckBwX42TX29cbHD9CDNrgU29AKoaVIzLa/8dUrGxCHxJb6+2czmYN NxIp/IkC3eNwaJ8w6mSoDa4y5I8DGgntbqq4MDK0s0SDEjyQx8KiopofamWL18cr2kGs C8lMFfPFDkuN6cu3GAHXX6U3rpZsh6KTaGvNfrgqnyly7g+nWOaMTa4Q424M8HFanTZK 3BNsiVFiXukJ3F61PD/9mwk7HrzitGkC8zVXuJ+QvrEDKoWS/MDAqCCUcfymTr/Zwbu9 JCTw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si1025995edk.16.2019.09.17.01.50.24; Tue, 17 Sep 2019 01:50:24 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389207AbfIQIuT (ORCPT + 3 others); Tue, 17 Sep 2019 04:50:19 -0400 Received: from foss.arm.com ([217.140.110.172]:53120 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389188AbfIQIuT (ORCPT ); Tue, 17 Sep 2019 04:50:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BD84E28; Tue, 17 Sep 2019 01:50:18 -0700 (PDT) Received: from e111045-lin.cambridge.arm.com (e120756.arm.com [10.1.39.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C4B63F575; Tue, 17 Sep 2019 01:50:18 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, Ard Biesheuvel Subject: [PATCH 1/2] crypto: arm/aes-ce - build for v8 architecture explicitly Date: Tue, 17 Sep 2019 09:50:00 +0100 Message-Id: <20190917085001.792-1-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Ard Biesheuvel The NEON/Crypto Extensions based AES implementation for 32-bit ARM can be built in a kernel that targets ARMv6 CPUs and higher, even though the actual code will not be able to run on that generation, but it allows for a portable image to be generated that can will use the special instructions only when they are available. Since those instructions are part of a FPU profile rather than a CPU profile, we don't override the architecture in the assembler code, and most of the scalar code is simple enough to be ARMv6 compatible. However, that changes with commit c61b1607ed4fbbf2, which introduces calls to the movw/movt instructions, which are v7+ only. So override the architecture in the .S file to armv8-a, which matches the architecture specification in the crypto-neon-fp-armv8 FPU specificier that we already using. Note that using armv7-a here may trigger an issue with the upcoming Clang 10 release, which no longer permits .arch/.fpu combinations it views as incompatible. Reported-by: kbuild test robot Fixes: c61b1607ed4fbbf2("crypto: arm/aes-ce - implement ciphertext stealing ...") Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/aes-ce-core.S | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/arch/arm/crypto/aes-ce-core.S b/arch/arm/crypto/aes-ce-core.S index b978cdf133af..4d1707388d94 100644 --- a/arch/arm/crypto/aes-ce-core.S +++ b/arch/arm/crypto/aes-ce-core.S @@ -9,6 +9,7 @@ #include .text + .arch armv8-a .fpu crypto-neon-fp-armv8 .align 3 From patchwork Tue Sep 17 08:50:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 173883 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp847443ill; Tue, 17 Sep 2019 01:50:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaHQ8az/cxwDW60kSisF7tHf9I+GuM4GVWrvIO7CAlKNRk+aOn/0BSAkc1YmBFNnnl2Ha3 X-Received: by 2002:aa7:c995:: with SMTP id c21mr3506370edt.129.1568710224569; Tue, 17 Sep 2019 01:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568710224; cv=none; d=google.com; s=arc-20160816; b=ux21d+XG80jxgrPpq0p0hXb6UEpLz2uav6QBjsAwuG4tOHNQhOFnRSQCa4Q/KmJ+RZ OBMQvJTKZbQotG1Vzcc8FLz3EihTA8yDMB7aC+ydbgFX7ZBCednoS6zr5Xa1lD24bDgj tr39K2JGoQof5WCdjmqLb4b+whPTVC46lEoDVlOUDF9nBefqyb77tTCf3N7WLuClBhPO JkbZYJ5spCGtMh1THNj+Gbe/fa/oj7VygH2BCKpBKbY9XLRP9O3a6wJqm/I3IGbA1Ld8 ST0ivHvGXMGl9FG12EXFPT+cvqA/OnM/+j4AEMN32N+NfGFgBw/O1cSjW1ZIvkMYKtAo iYdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=h3uy3/zuXaqe/NahJvaso8GOvAUcguuKMpl3VTMZFQE=; b=r5GUsvSe74k6RAxwU7drVoWL46nme5wkUhkdydQyzbH2srfp/js1esuvjyfzkF9oXZ if6fk8kiUYQOd8xPLZCgTBQSHSnr1PpC4kbpR/P+ft3wh0UTChIKAD2WY7Q7/2MKBvvt nafWQOnQ8KxSYJSyznppYfyneg/luEYt9EKqA4gdDnKTyvNWHhrv72lbbAf4yiZJBR6f z+gH64z/00G2bsv5oQU0QqRAbmEc6O72iZbTk+r0Sou4ftVju4SH9CuSdzB64WXgPoLo 4DoRQT0zMR3Cn/18ZY/Cvik/2MlgGV9Era/LHNiZYdvPOFqpMJKGZPA/fsxViTw+dP1E Ug7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si1025995edk.16.2019.09.17.01.50.24; Tue, 17 Sep 2019 01:50:24 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389188AbfIQIuU (ORCPT + 3 others); Tue, 17 Sep 2019 04:50:20 -0400 Received: from foss.arm.com ([217.140.110.172]:53126 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728698AbfIQIuU (ORCPT ); Tue, 17 Sep 2019 04:50:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90B69142F; Tue, 17 Sep 2019 01:50:19 -0700 (PDT) Received: from e111045-lin.cambridge.arm.com (e120756.arm.com [10.1.39.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F3B063F575; Tue, 17 Sep 2019 01:50:18 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, Ard Biesheuvel Subject: [PATCH 2/2] crypto: arm/aes-ce - add dependency on AES library Date: Tue, 17 Sep 2019 09:50:01 +0100 Message-Id: <20190917085001.792-2-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917085001.792-1-ard.biesheuvel@arm.com> References: <20190917085001.792-1-ard.biesheuvel@arm.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Ard Biesheuvel The ARM accelerated AES driver depends on the new AES library for its non-SIMD fallback so express this in its Kconfig declaration. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index b24df84a1d7a..043b0b18bf7e 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -98,6 +98,7 @@ config CRYPTO_AES_ARM_CE tristate "Accelerated AES using ARMv8 Crypto Extensions" depends on KERNEL_MODE_NEON select CRYPTO_BLKCIPHER + select CRYPTO_LIB_AES select CRYPTO_SIMD help Use an implementation of AES in CBC, CTR and XTS modes that uses