|
23 | 23 | #include <linux/err.h> |
24 | 24 | #include <linux/crypto.h> |
25 | 25 | #include <linux/delay.h> |
26 | | -#include <linux/hardirq.h> |
| 26 | +#include <asm/simd.h> |
27 | 27 | #include <asm/switch_to.h> |
28 | 28 | #include <crypto/aes.h> |
29 | 29 | #include <crypto/ghash.h> |
30 | 30 | #include <crypto/scatterwalk.h> |
31 | 31 | #include <crypto/internal/hash.h> |
| 32 | +#include <crypto/internal/simd.h> |
32 | 33 | #include <crypto/b128ops.h> |
33 | 34 |
|
34 | | -#define IN_INTERRUPT in_interrupt() |
35 | | - |
36 | 35 | void gcm_init_p8(u128 htable[16], const u64 Xi[2]); |
37 | 36 | void gcm_gmult_p8(u64 Xi[2], const u128 htable[16]); |
38 | 37 | void gcm_ghash_p8(u64 Xi[2], const u128 htable[16], |
@@ -131,7 +130,7 @@ static int p8_ghash_update(struct shash_desc *desc, |
131 | 130 | struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm)); |
132 | 131 | struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc); |
133 | 132 |
|
134 | | - if (IN_INTERRUPT) { |
| 133 | + if (!crypto_simd_usable()) { |
135 | 134 | return crypto_shash_update(&dctx->fallback_desc, src, |
136 | 135 | srclen); |
137 | 136 | } else { |
@@ -182,7 +181,7 @@ static int p8_ghash_final(struct shash_desc *desc, u8 *out) |
182 | 181 | struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm)); |
183 | 182 | struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc); |
184 | 183 |
|
185 | | - if (IN_INTERRUPT) { |
| 184 | + if (!crypto_simd_usable()) { |
186 | 185 | return crypto_shash_final(&dctx->fallback_desc, out); |
187 | 186 | } else { |
188 | 187 | if (dctx->bytes) { |
|
0 commit comments