From patchwork Wed Jun 29 18:02:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12900537 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 2A9E3C43334 for ; Wed, 29 Jun 2022 18:09:04 +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=UvL7VXZjMi0o1P6VOvhypKClR8UGA9zyVZE33JI4u4c=; b=moHB/uawIsTFx8 knVgLcz7Alp8UqTnKSTpJFoyW8WkH+7q6RPOcj5ECpm9fMG2AnKs18Sm+WXLcGtUGEv5Zem1Z3WNU 1ZkjtOY7K71dbnuUjkFvhc09Kyo+tuEkJouCwVDLKFKfZur969STWa6KSlD2KInFwVBieeJBGSgud QCav37y61F7p2L06TeZrNF2AX6NRxUdi70dhoifFwIPEZJSOmXSQh/pL2K7akYLHdYKNmY7AVtQA+ ptFffGqsT/FTyj8Hcm4nBIwRKSooonEdth5xpG8I5GNBMrVlSj4OdKHS2I86NHLS97nH+oqcFliXE VQcGltwArvDLt7F6T6ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6c6N-00DNr3-6M; Wed, 29 Jun 2022 18:07:47 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6c1Y-00DLqa-QK for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2022 18:02:50 +0000 Received: by mail-pg1-x534.google.com with SMTP id 145so1928571pga.12 for ; Wed, 29 Jun 2022 11:02:46 -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=8m1lytctefJudrhC62eHkDYEhgmvtWB/qfcXy6/Skb0=; b=Og3VmaHDVYdme9hpcGUXsB/YoBRyCbspqGz5cYDeQyxWJv12QFtuEWQirPqoQfKjaX QuyilfFE9G/sv9JaIylOLClgBubpxdV9/yZXFXXcNZH66qYXBP5uG0KbcmaCGNDCOqUU zgkXdiTQJPhOtg5jxhfjBkvU8/z+oVZfv8drCXetbzHZnQQErk+HBa74j7sGhqp8R/Km vQiqb1pykIDAkpdz/FJELVDwg4TBIAvcBgvrNT8Zp1EMRJWIZNsAikJPKjY7DqwsfyWs epF2QVxZBPzk4f2KOrLyONXZf392rLG52xmCjqJMQiOpoysYmxzkW2LYV0mRkuFIaMOr 0hqA== 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=8m1lytctefJudrhC62eHkDYEhgmvtWB/qfcXy6/Skb0=; b=eN6rjW9AKldiYQjG38OUjQYdq7Vz7pljiXgLI/DWp7G0hTakIF3wtME2/TMRc1jQOD kPNWCDu2Q2jhpNwZ0vtlGjZbKjx+Vy4+zfoZW2xgr/71svfPXfA7b256RM0JBR4DIl5V JLz1op5+Hl+PCb6GuXeaPititC/3wYHCOCHMtlPS2Ac3FYKcdJD5RpmuQXc4UXn+cwY5 5p8TW/ItTyVqbrcFdkHtlmK6iPHW2OiJoMEXetc4YqJ3h3LC65NkCqYRHyhvGp0zTOyQ b9gCUlXWfxBZlQEYD4ZHQosauA2WVSP0/vGsZikbym1kuVwEKeJMtZaKb8jJyjEiXFX+ S//A== X-Gm-Message-State: AJIora9X9d+M1cdzAqpUJrAjKxWZcbUdcB/G5uj+faTWyiav+ov+BGSB xFOor/AUiA1MHCee5bbwqTE= X-Google-Smtp-Source: AGRyM1tVWGP61GpsjRkF+zlIx0GKOr26quUmb5y+nvydkxThM/bfBZLQF+0wLXNbHOyOzYt/11XQlA== X-Received: by 2002:a63:82c6:0:b0:40d:c2d8:b910 with SMTP id w189-20020a6382c6000000b0040dc2d8b910mr3912728pgd.309.1656525765785; Wed, 29 Jun 2022 11:02:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 11:02:45 -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 04/11] crypto: arm/sha256-neon - avoid ADRL pseudo instruction Date: Wed, 29 Jun 2022 11:02:20 -0700 Message-Id: <20220629180227.3408104-5-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_903167_7F1E1081 X-CRM114-Status: GOOD ( 16.85 ) 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 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 --- arch/arm/crypto/sha256-armv4.pl | 4 ++-- arch/arm/crypto/sha256-core.S_shipped | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/crypto/sha256-armv4.pl b/arch/arm/crypto/sha256-armv4.pl index a03cf4dfb781..d927483985c2 100644 --- 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 diff --git a/arch/arm/crypto/sha256-core.S_shipped b/arch/arm/crypto/sha256-core.S_shipped index 054aae0edfce..9deb515f3c9f 100644 --- 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