hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/crypto/crct10dif-vpmsum_glue.c
....@@ -1,22 +1,20 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Calculate a CRC T10-DIF with vpmsum acceleration
34 *
45 * Copyright 2017, Daniel Axtens, IBM Corporation.
56 * [based on crc32c-vpmsum_glue.c]
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version 2
10
- * of the License, or (at your option) any later version.
117 */
128
139 #include <linux/crc-t10dif.h>
1410 #include <crypto/internal/hash.h>
11
+#include <crypto/internal/simd.h>
1512 #include <linux/init.h>
1613 #include <linux/module.h>
1714 #include <linux/string.h>
1815 #include <linux/kernel.h>
1916 #include <linux/cpufeature.h>
17
+#include <asm/simd.h>
2018 #include <asm/switch_to.h>
2119
2220 #define VMX_ALIGN 16
....@@ -32,7 +30,7 @@
3230 unsigned int tail;
3331 u32 crc = crci;
3432
35
- if (len < (VECTOR_BREAKPOINT + VMX_ALIGN) || in_interrupt())
33
+ if (len < (VECTOR_BREAKPOINT + VMX_ALIGN) || !crypto_simd_usable())
3634 return crc_t10dif_generic(crc, p, len);
3735
3836 if ((unsigned long)p & VMX_ALIGN_MASK) {