Skip to content

Commit 0c8f838

Browse files
Ard Biesheuvelherbertx
authored andcommitted
crypto: arm64/aes-blk - yield NEON after every block of input
Avoid excessive scheduling delays under a preemptible kernel by yielding the NEON after every block of input. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 7b67ae4 commit 0c8f838

File tree

2 files changed

+216
-130
lines changed

2 files changed

+216
-130
lines changed

arch/arm64/crypto/aes-ce.S

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,21 @@
3030
.endm
3131

3232
/* prepare for encryption with key in rk[] */
33-
.macro enc_prepare, rounds, rk, ignore
34-
load_round_keys \rounds, \rk
33+
.macro enc_prepare, rounds, rk, temp
34+
mov \temp, \rk
35+
load_round_keys \rounds, \temp
3536
.endm
3637

3738
/* prepare for encryption (again) but with new key in rk[] */
38-
.macro enc_switch_key, rounds, rk, ignore
39-
load_round_keys \rounds, \rk
39+
.macro enc_switch_key, rounds, rk, temp
40+
mov \temp, \rk
41+
load_round_keys \rounds, \temp
4042
.endm
4143

4244
/* prepare for decryption with key in rk[] */
43-
.macro dec_prepare, rounds, rk, ignore
44-
load_round_keys \rounds, \rk
45+
.macro dec_prepare, rounds, rk, temp
46+
mov \temp, \rk
47+
load_round_keys \rounds, \temp
4548
.endm
4649

4750
.macro do_enc_Nx, de, mc, k, i0, i1, i2, i3

0 commit comments

Comments
 (0)