linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: linux-crypto@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	herbert@gondor.apana.org.au,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v3 07/10] crypto: arm64/aes - avoid literals for cross-module symbol references
Date: Sat, 28 Jan 2017 23:25:36 +0000	[thread overview]
Message-ID: <1485645939-17126-8-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1485645939-17126-1-git-send-email-ard.biesheuvel@linaro.org>

Using simple adrp/add pairs to refer to the AES lookup tables exposed by
the generic AES driver (which could be loaded far away from this driver
when KASLR is in effect) was unreliable at module load time before commit
41c066f2c4d4 ("arm64: assembler: make adr_l work in modules under KASLR"),
which is why the AES code used literals instead.

So now we can get rid of the literals, and switch to the adr_l macro.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/crypto/aes-cipher-core.S | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/crypto/aes-cipher-core.S b/arch/arm64/crypto/aes-cipher-core.S
index 37590ab8121a..cd58c61e6677 100644
--- a/arch/arm64/crypto/aes-cipher-core.S
+++ b/arch/arm64/crypto/aes-cipher-core.S
@@ -89,8 +89,8 @@ CPU_BE(	rev		w8, w8		)
 	eor		w7, w7, w11
 	eor		w8, w8, w12
 
-	ldr		tt, =\ttab
-	ldr		lt, =\ltab
+	adr_l		tt, \ttab
+	adr_l		lt, \ltab
 
 	tbnz		rounds, #1, 1f
 
@@ -111,9 +111,6 @@ CPU_BE(	rev		w8, w8		)
 	stp		w5, w6, [out]
 	stp		w7, w8, [out, #8]
 	ret
-
-	.align		4
-	.ltorg
 	.endm
 
 	.align		5
-- 
2.7.4

  parent reply	other threads:[~2017-01-28 23:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-28 23:25 [PATCH v3 00/10] crypto - AES for ARM/arm64 updates for v4.11 (round #2) Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 01/10] crypto: arm64/aes-neon-bs - honour iv_out requirement in CTR mode Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 02/10] crypto: arm/aes-ce - remove cra_alignmask Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 03/10] crypto: arm/chacha20 " Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 04/10] crypto: arm64/aes-ce-ccm " Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 05/10] crypto: arm64/aes-blk " Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 06/10] crypto: arm64/chacha20 " Ard Biesheuvel
2017-01-28 23:25 ` Ard Biesheuvel [this message]
2017-01-28 23:25 ` [PATCH v3 08/10] crypto: arm64/aes - performance tweak Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 09/10] crypto: arm64/aes-neon-blk - tweak performance for low end cores Ard Biesheuvel
2017-01-28 23:25 ` [PATCH v3 10/10] crypto: arm64/aes - replace scalar fallback with plain NEON fallback Ard Biesheuvel
2017-02-03 10:22 ` [PATCH v3 00/10] crypto - AES for ARM/arm64 updates for v4.11 (round #2) Herbert Xu

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=1485645939-17126-8-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@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;
as well as URLs for NNTP newsgroup(s).