diff options
Diffstat (limited to 'arch/x86/crypto/aesni-intel_glue.c')
-rw-r--r-- | arch/x86/crypto/aesni-intel_glue.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 545d0ce59818..b3350bd32c60 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <crypto/aes.h> | 28 | #include <crypto/aes.h> |
29 | #include <crypto/cryptd.h> | 29 | #include <crypto/cryptd.h> |
30 | #include <crypto/ctr.h> | 30 | #include <crypto/ctr.h> |
31 | #include <asm/cpu_device_id.h> | ||
31 | #include <asm/i387.h> | 32 | #include <asm/i387.h> |
32 | #include <asm/aes.h> | 33 | #include <asm/aes.h> |
33 | #include <crypto/scatterwalk.h> | 34 | #include <crypto/scatterwalk.h> |
@@ -1253,14 +1254,19 @@ static struct crypto_alg __rfc4106_alg = { | |||
1253 | }; | 1254 | }; |
1254 | #endif | 1255 | #endif |
1255 | 1256 | ||
1257 | |||
1258 | static const struct x86_cpu_id aesni_cpu_id[] = { | ||
1259 | X86_FEATURE_MATCH(X86_FEATURE_AES), | ||
1260 | {} | ||
1261 | }; | ||
1262 | MODULE_DEVICE_TABLE(x86cpu, aesni_cpu_id); | ||
1263 | |||
1256 | static int __init aesni_init(void) | 1264 | static int __init aesni_init(void) |
1257 | { | 1265 | { |
1258 | int err; | 1266 | int err; |
1259 | 1267 | ||
1260 | if (!cpu_has_aes) { | 1268 | if (!x86_match_cpu(aesni_cpu_id)) |
1261 | printk(KERN_INFO "Intel AES-NI instructions are not detected.\n"); | ||
1262 | return -ENODEV; | 1269 | return -ENODEV; |
1263 | } | ||
1264 | 1270 | ||
1265 | if ((err = crypto_fpu_init())) | 1271 | if ((err = crypto_fpu_init())) |
1266 | goto fpu_err; | 1272 | goto fpu_err; |