Skip to content

Commit 7048c21

Browse files
ardbiesheuvelherbertx
authored andcommitted
crypto: arm64/crct10dif - Remove obsolete chunking logic
This is a partial revert of commit fc754c0, which moved the logic into C code which ensures that kernel mode NEON code does not hog the CPU for too long. This is no longer needed now that kernel mode NEON no longer disables preemption, so we can drop this. Reviewed-by: Eric Biggers <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 19630cf commit 7048c21

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

arch/arm64/crypto/crct10dif-ce-glue.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,9 @@ static int crct10dif_update_pmull_p8(struct shash_desc *desc, const u8 *data,
3737
u16 *crc = shash_desc_ctx(desc);
3838

3939
if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && crypto_simd_usable()) {
40-
do {
41-
unsigned int chunk = length;
42-
43-
if (chunk > SZ_4K + CRC_T10DIF_PMULL_CHUNK_SIZE)
44-
chunk = SZ_4K;
45-
46-
kernel_neon_begin();
47-
*crc = crc_t10dif_pmull_p8(*crc, data, chunk);
48-
kernel_neon_end();
49-
data += chunk;
50-
length -= chunk;
51-
} while (length);
40+
kernel_neon_begin();
41+
*crc = crc_t10dif_pmull_p8(*crc, data, length);
42+
kernel_neon_end();
5243
} else {
5344
*crc = crc_t10dif_generic(*crc, data, length);
5445
}
@@ -62,18 +53,9 @@ static int crct10dif_update_pmull_p64(struct shash_desc *desc, const u8 *data,
6253
u16 *crc = shash_desc_ctx(desc);
6354

6455
if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && crypto_simd_usable()) {
65-
do {
66-
unsigned int chunk = length;
67-
68-
if (chunk > SZ_4K + CRC_T10DIF_PMULL_CHUNK_SIZE)
69-
chunk = SZ_4K;
70-
71-
kernel_neon_begin();
72-
*crc = crc_t10dif_pmull_p64(*crc, data, chunk);
73-
kernel_neon_end();
74-
data += chunk;
75-
length -= chunk;
76-
} while (length);
56+
kernel_neon_begin();
57+
*crc = crc_t10dif_pmull_p64(*crc, data, length);
58+
kernel_neon_end();
7759
} else {
7860
*crc = crc_t10dif_generic(*crc, data, length);
7961
}

0 commit comments

Comments
 (0)