.. | .. |
---|
32 | 32 | #include <linux/kernel.h> |
---|
33 | 33 | #include <linux/crc32.h> |
---|
34 | 34 | #include <crypto/internal/hash.h> |
---|
| 35 | +#include <crypto/internal/simd.h> |
---|
35 | 36 | |
---|
36 | 37 | #include <asm/cpufeatures.h> |
---|
37 | 38 | #include <asm/cpu_device_id.h> |
---|
38 | | -#include <asm/fpu/api.h> |
---|
| 39 | +#include <asm/simd.h> |
---|
39 | 40 | |
---|
40 | 41 | #define CHKSUM_BLOCK_SIZE 1 |
---|
41 | 42 | #define CHKSUM_DIGEST_SIZE 4 |
---|
.. | .. |
---|
54 | 55 | unsigned int iremainder; |
---|
55 | 56 | unsigned int prealign; |
---|
56 | 57 | |
---|
57 | | - if (len < PCLMUL_MIN_LEN + SCALE_F_MASK || !irq_fpu_usable()) |
---|
| 58 | + if (len < PCLMUL_MIN_LEN + SCALE_F_MASK || !crypto_simd_usable()) |
---|
58 | 59 | return crc32_le(crc, p, len); |
---|
59 | 60 | |
---|
60 | 61 | if ((long)p & SCALE_F_MASK) { |
---|
.. | .. |
---|
93 | 94 | { |
---|
94 | 95 | u32 *mctx = crypto_shash_ctx(hash); |
---|
95 | 96 | |
---|
96 | | - if (keylen != sizeof(u32)) { |
---|
97 | | - crypto_shash_set_flags(hash, CRYPTO_TFM_RES_BAD_KEY_LEN); |
---|
| 97 | + if (keylen != sizeof(u32)) |
---|
98 | 98 | return -EINVAL; |
---|
99 | | - } |
---|
100 | 99 | *mctx = le32_to_cpup((__le32 *)key); |
---|
101 | 100 | return 0; |
---|
102 | 101 | } |
---|
.. | .. |
---|
171 | 170 | }; |
---|
172 | 171 | |
---|
173 | 172 | static const struct x86_cpu_id crc32pclmul_cpu_id[] = { |
---|
174 | | - X86_FEATURE_MATCH(X86_FEATURE_PCLMULQDQ), |
---|
| 173 | + X86_MATCH_FEATURE(X86_FEATURE_PCLMULQDQ, NULL), |
---|
175 | 174 | {} |
---|
176 | 175 | }; |
---|
177 | 176 | MODULE_DEVICE_TABLE(x86cpu, crc32pclmul_cpu_id); |
---|