From patchwork Wed Jun 29 18:02:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12900536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60E69C43334 for ; Wed, 29 Jun 2022 18:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nPa4EdP/ShqNDhm9RvjKUrBZ9p5Z7dSwd4rB0Quyzeo=; b=UDJgX3N1nrMA1t h7Xn31f8kvsxG72rbXtyzUvQWzukfimaXaiOKeGSqGv37qIMnnQcfb4ea9k59WJbvc4ZZcAo09H0C S4bhAucfyWuay4G/fGF9Njeav2vlbbmf71CgfZS/rWD6e3mFS3i9FyV5PzHweSQDdZ7NollqvW+aJ 5lIUz8jLXf/FeguopgbCfMpH67ZmJM9EyYkXt7JAPWKKEdi7gcJuFwD2pZDp6jkVGk63qzQJ2gKUR fwlcCEM23BJ30/14PhS3Raoz3sxPnAENxUiPo2LXzeyBMIg/oKK+QWbV3uMC26dlfEjsFQuyPOJHM UgHpbGL2LYYbgfihYq2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6c5j-00DNZr-Ly; Wed, 29 Jun 2022 18:07:09 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6c1Y-00DLmm-08 for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2022 18:02:49 +0000 Received: by mail-pl1-x632.google.com with SMTP id k14so14826836plh.4 for ; Wed, 29 Jun 2022 11:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RlIVn4KhgWNNVucL/eFDrRsCrhfeAFEgYpOovza+X8U=; b=kYtBq9zRlHyBtNkjaB6WwfnYXMPQEXZTfzXGBCHaq3Z/eFaaMq5a1qSgKow3h0Gmma AZwnHDMrMe569ca3/KFlQNG/7bInw5fg+iRDKTb9oNNQCgl0mfZ+S5LqiIPheZaHJJqp TrNcVTGUv0a1tDL2PHv13aJ7jjRoauL0NaVPW0IdeXWBD5t54uD6z5clvSIEhD4a2C0O mTobjdUPMnXIjn/3TxWz0xcno84Jo1Jkpw7Tse7pEextxJPxgr7UsLfR9RIK6xUriD2y SKQ0BUbPG9LQiIsAU9fWhkZLr57mKGSFPVozO1/SnMy9s9qIctQwWvdVU+8zXbzWwWEj Pu9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RlIVn4KhgWNNVucL/eFDrRsCrhfeAFEgYpOovza+X8U=; b=pyXarv1iav+qW4FfkpanySoXmH/noEQ6tnCDKmMBh/E9LudukDCFunmNiLXkduUKhd /2C8HPNYMqhg3jKDoPd9TcTcEv643dDJmln9C8wJL9Klew/vk8HTpp7H3zOh7rDv4vgV IxvkYFZF3z8abcD2ChNNzOUwiXfMlvtVCHmoFmzLTgTnNKVeDgG8IOguOK6flh1xwp5a KlrB2g+ESzCPxNhxVfe3gRZmFM9wTs5RiC9VqNRvJpXOEzEK5/Z3AvQeg53He0/HOZAM x708tJ9Yy+hGnwmPW1ed2WYO5xWbY+3AKx3IPyZbwdk8mf1DkJg9PyfrwHTYZWPnnd0d dmRA== X-Gm-Message-State: AJIora882a5V8yD/mhw/tOVKjQXVw5zDGJPXzP+plxKWMqsuF/4tC/HZ cId8VUQ/3FYFO+DXoAbbRkg= X-Google-Smtp-Source: AGRyM1u0wL+H1cKe+iE7XnYuazmb8EbuO12Eql59TWho68AKJN4v4wc3YyU7wN3nHHctRB7j3mZCgw== X-Received: by 2002:a17:903:40c9:b0:16a:2d26:5553 with SMTP id t9-20020a17090340c900b0016a2d265553mr11235357pld.31.1656525767568; Wed, 29 Jun 2022 11:02:47 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id s7-20020a17090302c700b00168e83eda56sm11736371plk.3.2022.06.29.11.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 11:02:47 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ard Biesheuvel , Nick Desaulniers , Herbert Xu , Florian Fainelli , Russell King , "David S. Miller" , Tony Lindgren , Hans Ulli Kroll , Stefan Agner , Nicolas Pitre , Andre Przywara , "Russell King (Oracle)" , Greg Kroah-Hartman , Catalin Marinas , Jian Cai , linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT), linux-kernel@vger.kernel.org (open list), linux-crypto@vger.kernel.org (open list:CRYPTO API), linux-omap@vger.kernel.org (open list:OMAP2+ SUPPORT), clang-built-linux@googlegroups.com (open list:CLANG/LLVM BUILD SUPPORT), Sasha Levin Subject: [PATCH stable 5.4 05/11] crypto: arm/sha512-neon - avoid ADRL pseudo instruction Date: Wed, 29 Jun 2022 11:02:21 -0700 Message-Id: <20220629180227.3408104-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220629180227.3408104-1-f.fainelli@gmail.com> References: <20220629180227.3408104-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220629_110248_133043_B4B154CB X-CRM114-Status: GOOD ( 17.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ard Biesheuvel commit 0f5e8323777bfc1c1d2cba71242db6a361de03b6 upstream The ADRL pseudo instruction is not an architectural construct, but a convenience macro that was supported by the ARM proprietary assembler and adopted by binutils GAS as well, but only when assembling in 32-bit ARM mode. Therefore, it can only be used in assembler code that is known to assemble in ARM mode only, but as it turns out, the Clang assembler does not implement ADRL at all, and so it is better to get rid of it entirely. So replace the ADRL instruction with a ADR instruction that refers to a nearer symbol, and apply the delta explicitly using an additional instruction. Signed-off-by: Ard Biesheuvel Tested-by: Nick Desaulniers Signed-off-by: Herbert Xu Signed-off-by: Florian Fainelli --- arch/arm/crypto/sha512-armv4.pl | 4 ++-- arch/arm/crypto/sha512-core.S_shipped | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/crypto/sha512-armv4.pl b/arch/arm/crypto/sha512-armv4.pl index 788c17b56ecc..2a0bdf7dd87c 100644 --- a/arch/arm/crypto/sha512-armv4.pl +++ b/arch/arm/crypto/sha512-armv4.pl @@ -212,7 +212,6 @@ $code=<<___; #else .syntax unified # ifdef __thumb2__ -# define adrl adr .thumb # else .code 32 @@ -602,7 +601,8 @@ sha512_block_data_order_neon: dmb @ errata #451034 on early Cortex A8 add $len,$inp,$len,lsl#7 @ len to point at the end of inp VFP_ABI_PUSH - adrl $Ktbl,K512 + adr $Ktbl,.Lsha512_block_data_order + sub $Ktbl,$Ktbl,.Lsha512_block_data_order-K512 vldmia $ctx,{$A-$H} @ load context .Loop_neon: ___ diff --git a/arch/arm/crypto/sha512-core.S_shipped b/arch/arm/crypto/sha512-core.S_shipped index 710ea309769e..cf5a7a70ff00 100644 --- a/arch/arm/crypto/sha512-core.S_shipped +++ b/arch/arm/crypto/sha512-core.S_shipped @@ -79,7 +79,6 @@ #else .syntax unified # ifdef __thumb2__ -# define adrl adr .thumb # else .code 32 @@ -543,7 +542,8 @@ sha512_block_data_order_neon: dmb @ errata #451034 on early Cortex A8 add r2,r1,r2,lsl#7 @ len to point at the end of inp VFP_ABI_PUSH - adrl r3,K512 + adr r3,.Lsha512_block_data_order + sub r3,r3,.Lsha512_block_data_order-K512 vldmia r0,{d16-d23} @ load context .Loop_neon: vshr.u64 d24,d20,#14 @ 0