| .. | .. |
|---|
| 15 | 15 | #include <linux/err.h> |
|---|
| 16 | 16 | #include <linux/crypto.h> |
|---|
| 17 | 17 | #include <linux/delay.h> |
|---|
| 18 | | -#include <linux/hardirq.h> |
|---|
| 18 | +#include <asm/simd.h> |
|---|
| 19 | 19 | #include <asm/switch_to.h> |
|---|
| 20 | 20 | #include <crypto/aes.h> |
|---|
| 21 | 21 | #include <crypto/ghash.h> |
|---|
| 22 | 22 | #include <crypto/scatterwalk.h> |
|---|
| 23 | 23 | #include <crypto/internal/hash.h> |
|---|
| 24 | +#include <crypto/internal/simd.h> |
|---|
| 24 | 25 | #include <crypto/b128ops.h> |
|---|
| 25 | | - |
|---|
| 26 | | -#define IN_INTERRUPT in_interrupt() |
|---|
| 27 | 26 | |
|---|
| 28 | 27 | void gcm_init_p8(u128 htable[16], const u64 Xi[2]); |
|---|
| 29 | 28 | void gcm_gmult_p8(u64 Xi[2], const u128 htable[16]); |
|---|
| .. | .. |
|---|
| 76 | 75 | static inline void __ghash_block(struct p8_ghash_ctx *ctx, |
|---|
| 77 | 76 | struct p8_ghash_desc_ctx *dctx) |
|---|
| 78 | 77 | { |
|---|
| 79 | | - if (!IN_INTERRUPT) { |
|---|
| 78 | + if (crypto_simd_usable()) { |
|---|
| 80 | 79 | preempt_disable(); |
|---|
| 81 | 80 | pagefault_disable(); |
|---|
| 82 | 81 | enable_kernel_vsx(); |
|---|
| .. | .. |
|---|
| 95 | 94 | struct p8_ghash_desc_ctx *dctx, |
|---|
| 96 | 95 | const u8 *src, unsigned int srclen) |
|---|
| 97 | 96 | { |
|---|
| 98 | | - if (!IN_INTERRUPT) { |
|---|
| 97 | + if (crypto_simd_usable()) { |
|---|
| 99 | 98 | preempt_disable(); |
|---|
| 100 | 99 | pagefault_disable(); |
|---|
| 101 | 100 | enable_kernel_vsx(); |
|---|