From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ard Biesheuvel <ardb@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 5.4 10/16] crypto: arm/sha512-neon - avoid ADRL pseudo instruction
Date: Thu, 30 Jun 2022 15:47:04 +0200 [thread overview]
Message-ID: <20220630133231.243227230@linuxfoundation.org> (raw)
In-Reply-To: <20220630133230.936488203@linuxfoundation.org>
From: Ard Biesheuvel <ardb@kernel.org>
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 <ardb@kernel.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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
next prev parent reply other threads:[~2022-06-30 14:06 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 13:46 [PATCH 5.4 00/16] 5.4.203-rc1 review Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 5.4 01/16] drm: remove drm_fb_helper_modinit Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 5.4 02/16] clocksource/drivers/ixp4xx: remove __init from ixp4xx_timer_setup() Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 5.4 03/16] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 5.4 04/16] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 5.4 05/16] net: mscc: ocelot: allow unregistered IP multicast flooding Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 06/16] ARM: 8989/1: use .fpu assembler directives instead of assembler arguments Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 07/16] ARM: 8990/1: use VFP assembler mnemonics in register load/store macros Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 08/16] ARM: 8971/1: replace the sole use of a symbol with its definition Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 09/16] crypto: arm/sha256-neon - avoid ADRL pseudo instruction Greg Kroah-Hartman
2022-06-30 13:47 ` Greg Kroah-Hartman [this message]
2022-06-30 13:47 ` [PATCH 5.4 11/16] ARM: 8933/1: replace Sun/Solaris style flag on section directive Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 12/16] ARM: 8929/1: use APSR_nzcv instead of r15 as mrc operand Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 13/16] ARM: OMAP2+: drop unnecessary adrl Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 14/16] ARM: 9029/1: Make iwmmxt.S support Clangs integrated assembler Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 15/16] crypto: arm - use Kconfig based compiler checks for crypto opcodes Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.4 16/16] crypto: arm/ghash-ce - define fpu before fpu registers are referenced Greg Kroah-Hartman
2022-06-30 22:45 ` [PATCH 5.4 00/16] 5.4.203-rc1 review Florian Fainelli
2022-06-30 23:10 ` Shuah Khan
2022-07-01 0:57 ` Guenter Roeck
2022-07-01 7:34 ` Naresh Kamboju
2022-07-01 10:37 ` Sudip Mukherjee
2022-07-04 8:08 ` Samuel Zou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220630133231.243227230@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=ardb@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox