Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp664202iog; Thu, 30 Jun 2022 07:58:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sN3ihivh4KGtVelZwZv+Y4H0Y7y+qPj0xx8/aHBykGDPnFNZOOJIEclGmObm+ndEpZV1D7 X-Received: by 2002:a17:903:2c2:b0:168:e323:d471 with SMTP id s2-20020a17090302c200b00168e323d471mr15857550plk.147.1656601123722; Thu, 30 Jun 2022 07:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656601123; cv=none; d=google.com; s=arc-20160816; b=uD9A3+E0u1XMZfzo4syWVvvl+mEi5dRiudQ3HY41UIyhtmF9FU9GIKag2ReDg0RTIg mFvdgGuU9yf2h8ssu6V7TFEBcU8XJns8dr3UUStqfGhiZgsxjoomW0Dfd63d3yOGBRPW Mm2pqNtbTyHRi6QWQ5Zd1al3VHjak5Mc0SDzh1wDBLutTASWV+WlhtVDQq/gFJagNkzq Jxj1arJiUFr2ZtTA8VA391k8yi9+z1l/KMdNqqWEVWKSvsMdk5AkClB5c3OrAhbcj8Sg pD02DSnMbzVAPU3jwwddkukvd6DB2gQ9VyH1GKbI8lLuHderFcNXIqU0KkVkUZmuu9WE 4GTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xvbn8h6Kt7ArdWBEtDKNDmdkV+7tdFYf0EoddC9gqP8=; b=x3Zs25iWoH2Nj+cNgvnCQIMDyH/XzCWkbw5log+C8cM7W6LEPyVw8Cxu8zbojIyH61 QS2aD74G9s/mX9eRTnnDnYwWO+NKvpY4mPsnbzynzz4zgvmTuv3rIjCyYCtF74u+wiJ4 6AHQOZCcM6zNC+vboc6uPHtX7ILAFzHt6d3nyNXpUOnWl007A+94jxzcebVyYS6f352N doJ8ESuz2E6sZvSWMUzwyPbYzoI4usa8MSdH5FhZNLjTL17LEmC16/vsu33uqO9noO4f 5jcrnNmoI1Mjb3/c9XcjeEZjWHaM0Yg6F8INqk7Csb5vBmc4IbqEpfiK+WR2pJG9y2Y/ A0rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tOCnsTJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902f79000b0015827ec0073si27610386pln.452.2022.06.30.07.58.28; Thu, 30 Jun 2022 07:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tOCnsTJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236136AbiF3OGH (ORCPT + 99 others); Thu, 30 Jun 2022 10:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236474AbiF3OFe (ORCPT ); Thu, 30 Jun 2022 10:05:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F226EEA2; Thu, 30 Jun 2022 06:53:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 56C176210F; Thu, 30 Jun 2022 13:53:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6163EC34115; Thu, 30 Jun 2022 13:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597226; bh=B38O70NoaMcu4XQpJfrxymGHgtMsHJvKZHqlKigsZx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tOCnsTJq0DHvO/x2wrtpPhmShPGn3srI4Rri7ABdPS9TDnTvJ4nTJGLSZmJ+oS6V1 glEi9nfJJVk5VcLpsSnQeTfJgXu6BdMQ9bEb1LSl6iogg7KASVaz7r6PXXNZ2/DQIb LIpCVcgC/oHsvn+vaiz7DJQYK+jso6KH2EzE+9oQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Ard Biesheuvel , Nick Desaulniers , Herbert Xu , Florian Fainelli Subject: [PATCH 5.4 10/16] crypto: arm/sha512-neon - avoid ADRL pseudo instruction Date: Thu, 30 Jun 2022 15:47:04 +0200 Message-Id: <20220630133231.243227230@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133230.936488203@linuxfoundation.org> References: <20220630133230.936488203@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Signed-off-by: Greg Kroah-Hartman --- arch/arm/crypto/sha512-armv4.pl | 4 ++-- arch/arm/crypto/sha512-core.S_shipped | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- 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: ___ --- 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