Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp654308iog; Thu, 30 Jun 2022 07:45:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3kYuvWVRZPJxt88NrmyWynx8AiUxaqZxqns+ophikBVG3KoLfb3RNdYJI5+jtzsifAcM7 X-Received: by 2002:a17:907:2d22:b0:726:34e6:52f6 with SMTP id gs34-20020a1709072d2200b0072634e652f6mr8806846ejc.371.1656600354548; Thu, 30 Jun 2022 07:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656600354; cv=none; d=google.com; s=arc-20160816; b=hMh0Z1d5CA1+2LJPfbk3DCxREw9G4H/hYYxHwMaUb1QolHRSj4w94taVLsbszWvdIm jRq1Ek0wsyD1lvH08unpzqCkTdFmywrZ+I3Ho62vaqB7txQaPmi/nzvX0S/niT8AVGqZ gbXdIM6A2MOF8J0g/UPl/5Vnc04tvNuy7o5sDCaRGpMxCl1ittUc0M6IVxUrTkdpVUbR RUuMh5arYENaElCx9CnrINqwAiw0LJ3divRcvlVpf2OL4sCq4QlsYiH8MOkkQG+nlB0h 8dcqSPWErwxqGyQN++RYxmhAvPWgpJo+GfMvlpoPzhUe6IncA+baWWXn6AgqwJVvvT2R JkQA== 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=neGmOl4U48El64XtC+MjVTZNkPb9CfYusZTaC4dmxzI=; b=FbKJMk76XSc7NEPOxiCmmqKqBuJDICKTX5Q1+QtDahPp1aVGnzhwAJwQ4/YtiaBfsy 3RYHXJJqiHQDagOjNHgv/Jh84/XK/aR1qJUEtoWJ90ZdxzfxToM06H2wsdbcG/3Z4uDG JVtVpWzTPJGMGOT85GGOlJkTdFrp1CrILs1meC6lRA0vbsQ0jENt68ZgTIK7N83uNOJj dMQzdnazgdRggpRchF3lm/Ywxzsw8gw6Zp0/WyLwVsABy5Xu5dyXrfKHbO2ZQ0D3eHZa 6F5iLi+h+LhWe/0fvMnpqO6Mz9kaqNjxsw6X1q+POm4N/kNWNY++1DMtCCMo+eUvOv3C pt3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oEII0HoQ; 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 sd39-20020a1709076e2700b0070dcedd6ca2si19124134ejc.713.2022.06.30.07.45.28; Thu, 30 Jun 2022 07:45:54 -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=oEII0HoQ; 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 S236414AbiF3OFz (ORCPT + 99 others); Thu, 30 Jun 2022 10:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236404AbiF3OFZ (ORCPT ); Thu, 30 Jun 2022 10:05:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E77F16EE91; Thu, 30 Jun 2022 06:53:50 -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 9831061FF6; Thu, 30 Jun 2022 13:53:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C28BC34115; Thu, 30 Jun 2022 13:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597224; bh=RGsatybUy2IVoxQlTGrXAd1ewMgnrCmqFCingxAVs00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oEII0HoQzYVzPc9gJ5EowZQicahnr/oxloswEQ3HOwaDVXbj0SHpPB5cSEoaXuRyt ijCdfBR/sbzO/9jT+JhSZ2UxGpZNJFd6OP9MWCOJW8UtcRp5QE2WISXo4BxnVJd3x3 GVz8yCKBpPoQdgX1HxqMvfwRN4I4LHidBDm5sbL0= 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 09/16] crypto: arm/sha256-neon - avoid ADRL pseudo instruction Date: Thu, 30 Jun 2022 15:47:03 +0200 Message-Id: <20220630133231.213267670@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 54781938ec342cadbe2d76669ef8d3294d909974 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/sha256-armv4.pl | 4 ++-- arch/arm/crypto/sha256-core.S_shipped | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/arch/arm/crypto/sha256-armv4.pl +++ b/arch/arm/crypto/sha256-armv4.pl @@ -175,7 +175,6 @@ $code=<<___; #else .syntax unified # ifdef __thumb2__ -# define adrl adr .thumb # else .code 32 @@ -471,7 +470,8 @@ sha256_block_data_order_neon: stmdb sp!,{r4-r12,lr} sub $H,sp,#16*4+16 - adrl $Ktbl,K256 + adr $Ktbl,.Lsha256_block_data_order + sub $Ktbl,$Ktbl,#.Lsha256_block_data_order-K256 bic $H,$H,#15 @ align for 128-bit stores mov $t2,sp mov sp,$H @ alloca --- a/arch/arm/crypto/sha256-core.S_shipped +++ b/arch/arm/crypto/sha256-core.S_shipped @@ -56,7 +56,6 @@ #else .syntax unified # ifdef __thumb2__ -# define adrl adr .thumb # else .code 32 @@ -1885,7 +1884,8 @@ sha256_block_data_order_neon: stmdb sp!,{r4-r12,lr} sub r11,sp,#16*4+16 - adrl r14,K256 + adr r14,.Lsha256_block_data_order + sub r14,r14,#.Lsha256_block_data_order-K256 bic r11,r11,#15 @ align for 128-bit stores mov r12,sp mov sp,r11 @ alloca