[RFC PATCH 4/9] arm64: aes-neonbs: move frame pop to end of function

Ard Biesheuvel ardb at kernel.org
Wed Oct 13 08:22:38 PDT 2021


In order to decomplicate the generation of CFI unwind metadata for the
AES-CTR routine, which would involve preserving/restoring the virtual
register set to convey that the state during the handling of inputs less
than 8 blocks [which is emitted out of line] equals the state before the
frame pop, let's just move it to the end of the function.

Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
---
 arch/arm64/crypto/aes-neonbs-core.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/crypto/aes-neonbs-core.S b/arch/arm64/crypto/aes-neonbs-core.S
index a3405b8c344b..7104b54448dc 100644
--- a/arch/arm64/crypto/aes-neonbs-core.S
+++ b/arch/arm64/crypto/aes-neonbs-core.S
@@ -966,10 +966,6 @@ CPU_LE(	rev		x8, x8		)
 
 	b		99b
 
-.Lctr_done:
-	frame_pop
-	ret
-
 	/*
 	 * If we are handling the tail of the input (x6 != NULL), return the
 	 * final keystream block back to the caller.
@@ -998,4 +994,8 @@ CPU_LE(	rev		x8, x8		)
 7:	cbz		x25, 8b
 	st1		{v5.16b}, [x25]
 	b		8b
+
+.Lctr_done:
+	frame_pop
+	ret
 SYM_FUNC_END(aesbs_ctr_encrypt)
-- 
2.30.2




More information about the linux-arm-kernel mailing list