hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/vmx/ghash.c
....@@ -15,15 +15,14 @@
1515 #include <linux/err.h>
1616 #include <linux/crypto.h>
1717 #include <linux/delay.h>
18
-#include <linux/hardirq.h>
18
+#include <asm/simd.h>
1919 #include <asm/switch_to.h>
2020 #include <crypto/aes.h>
2121 #include <crypto/ghash.h>
2222 #include <crypto/scatterwalk.h>
2323 #include <crypto/internal/hash.h>
24
+#include <crypto/internal/simd.h>
2425 #include <crypto/b128ops.h>
25
-
26
-#define IN_INTERRUPT in_interrupt()
2726
2827 void gcm_init_p8(u128 htable[16], const u64 Xi[2]);
2928 void gcm_gmult_p8(u64 Xi[2], const u128 htable[16]);
....@@ -76,7 +75,7 @@
7675 static inline void __ghash_block(struct p8_ghash_ctx *ctx,
7776 struct p8_ghash_desc_ctx *dctx)
7877 {
79
- if (!IN_INTERRUPT) {
78
+ if (crypto_simd_usable()) {
8079 preempt_disable();
8180 pagefault_disable();
8281 enable_kernel_vsx();
....@@ -95,7 +94,7 @@
9594 struct p8_ghash_desc_ctx *dctx,
9695 const u8 *src, unsigned int srclen)
9796 {
98
- if (!IN_INTERRUPT) {
97
+ if (crypto_simd_usable()) {
9998 preempt_disable();
10099 pagefault_disable();
101100 enable_kernel_vsx();