From patchwork Tue Aug 6 05:54:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia He X-Patchwork-Id: 13754468 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 CEED7C3DA64 for ; Tue, 6 Aug 2024 05:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7siXWw0V8PhoVD6i1tDM4fx2np9ArY62a7a5FCBcTQ4=; b=CK0DH8OYO3eCIfEs5RLGXWaNYb V+wVhtjDWP+tHafZODDl1C6Zt+Uby2JmBJhC7sEhmMSIsCJ7PXlsxmfE/oB8nuVX6DcWKUoH57svs WxzSrJwKFyIGC+A85y1M77Oj1VKWNdk20pueOwf+RpBJRhIyihHw2L8+APu7BLuCzdXw9/krZR5ER 7iIrzyjVaX3pBBl0gvcnOsYliIV/d5GAwCh6NQEOtiWEmWwbORF4tC/RLeWn/ClSPQiw0in/ifdpe 7NM2Bl/Bo/7xghOXFPE+uUEluR95a5m5/d36XMkyUtaH+O+bUlcjiTdDbGmaUw+s11R8OtwlNwGVJ BRucp/IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbDAY-00000000cAR-1LAy; Tue, 06 Aug 2024 05:55:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbDA0-00000000bze-1eSZ for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 05:55:06 +0000 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 9B5BA106F; Mon, 5 Aug 2024 22:55:26 -0700 (PDT) Received: from entos-yitian-01.shanghai.arm.com (entos-yitian-01.shanghai.arm.com [10.169.218.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6BC433F5A1; Mon, 5 Aug 2024 22:54:57 -0700 (PDT) From: Jia He To: Herbert Xu , Andy Polyakov Cc: "David S. Miller" , Catalin Marinas , Will Deacon , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jia He Subject: [PATCH v2] crypto: arm64/poly1305 - move data to rodata section Date: Tue, 6 Aug 2024 05:54:44 +0000 Message-Id: <20240806055444.528932-1-justin.he@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_225504_503663_05EC7A26 X-CRM114-Status: GOOD ( 10.66 ) 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 When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section: > .Lzeros: > .long 0,0,0,0,0,0,0,0 > .asciz "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm" > .align 2 Move it to .rodata which is a more appropriate section for read-only data. There is a limit on how far the label can be from the instruction, hence use "adrp" and low 12bits offset of the label to avoid the compilation error. Signed-off-by: Jia He Tested-by: Daniel Gomez --- v2: - use adrp+offset to avoid compilation error(kernel test bot and Andy) v1: https://lkml.org/lkml/2024/8/2/616 arch/arm64/crypto/poly1305-armv8.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/crypto/poly1305-armv8.pl b/arch/arm64/crypto/poly1305-armv8.pl index cbc980fb02e3..22c9069c0650 100644 --- a/arch/arm64/crypto/poly1305-armv8.pl +++ b/arch/arm64/crypto/poly1305-armv8.pl @@ -473,7 +473,8 @@ poly1305_blocks_neon: subs $len,$len,#64 ldp x9,x13,[$inp,#48] add $in2,$inp,#96 - adr $zeros,.Lzeros + adrp $zeros,.Lzeros + add $zeros,$zeros,#:lo12:.Lzeros lsl $padbit,$padbit,#24 add x15,$ctx,#48 @@ -885,10 +886,13 @@ poly1305_blocks_neon: ret .size poly1305_blocks_neon,.-poly1305_blocks_neon +.pushsection .rodata .align 5 .Lzeros: .long 0,0,0,0,0,0,0,0 .asciz "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm" +.popsection + .align 2 #if !defined(__KERNEL__) && !defined(_WIN64) .comm OPENSSL_armcap_P,4,4