Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a068b94d authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu
Browse files

crypto: arm/speck - fix building in Thumb2 mode



Building the kernel with CONFIG_THUMB2_KERNEL=y and
CONFIG_CRYPTO_SPECK_NEON set fails with the following errors:

    arch/arm/crypto/speck-neon-core.S: Assembler messages:

    arch/arm/crypto/speck-neon-core.S:419: Error: r13 not allowed here -- `bic sp,#0xf'
    arch/arm/crypto/speck-neon-core.S:423: Error: r13 not allowed here -- `bic sp,#0xf'
    arch/arm/crypto/speck-neon-core.S:427: Error: r13 not allowed here -- `bic sp,#0xf'
    arch/arm/crypto/speck-neon-core.S:431: Error: r13 not allowed here -- `bic sp,#0xf'

The problem is that the 'bic' instruction can't operate on the 'sp'
register in Thumb2 mode.  Fix it by using a temporary register.  This
isn't in the main loop, so the performance difference is negligible.
This also matches what aes-neonbs-core.S does.

Reported-by: default avatarStefan Agner <stefan@agner.ch>
Fixes: ede96221 ("crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS")
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: default avatarStefan Agner <stefan@agner.ch>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 837bf7cc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -272,9 +272,11 @@
	 * Allocate stack space to store 128 bytes worth of tweaks.  For
	 * performance, this space is aligned to a 16-byte boundary so that we
	 * can use the load/store instructions that declare 16-byte alignment.
	 * For Thumb2 compatibility, don't do the 'bic' directly on 'sp'.
	 */
	sub		sp, #128
	bic		sp, #0xf
	sub		r12, sp, #128
	bic		r12, #0xf
	mov		sp, r12

.if \n == 64
	// Load first tweak