[PATCH v2 18/19] crypto: x86 - standardize not loaded prints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Standardize the prints that additional required CPU features are not
present along with the main CPU features (e.g., OSXSAVE is not
present along with AVX).

Although modules are not supposed to print unless loaded and
active, these are existing exceptions.

Signed-off-by: Robert Elliott <elliott@xxxxxxx>
---
 arch/x86/crypto/aegis128-aesni-glue.c      | 4 +++-
 arch/x86/crypto/aria_aesni_avx_glue.c      | 4 ++--
 arch/x86/crypto/camellia_aesni_avx2_glue.c | 5 +++--
 arch/x86/crypto/camellia_aesni_avx_glue.c  | 5 +++--
 arch/x86/crypto/cast5_avx_glue.c           | 3 ++-
 arch/x86/crypto/cast6_avx_glue.c           | 3 ++-
 arch/x86/crypto/crc32-pclmul_glue.c        | 4 +++-
 arch/x86/crypto/nhpoly1305-avx2-glue.c     | 4 +++-
 arch/x86/crypto/serpent_avx2_glue.c        | 8 +++++---
 arch/x86/crypto/serpent_avx_glue.c         | 3 ++-
 arch/x86/crypto/sm3_avx_glue.c             | 7 ++++---
 arch/x86/crypto/sm4_aesni_avx2_glue.c      | 5 +++--
 arch/x86/crypto/sm4_aesni_avx_glue.c       | 5 +++--
 arch/x86/crypto/twofish_avx_glue.c         | 3 ++-
 14 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/arch/x86/crypto/aegis128-aesni-glue.c b/arch/x86/crypto/aegis128-aesni-glue.c
index e8eaf79ef220..aa94b9f8703c 100644
--- a/arch/x86/crypto/aegis128-aesni-glue.c
+++ b/arch/x86/crypto/aegis128-aesni-glue.c
@@ -281,8 +281,10 @@ static int __init crypto_aegis128_aesni_module_init(void)
 
 	if (!boot_cpu_has(X86_FEATURE_XMM2) ||
 	    !boot_cpu_has(X86_FEATURE_AES) ||
-	    !cpu_has_xfeatures(XFEATURE_MASK_SSE, NULL))
+	    !cpu_has_xfeatures(XFEATURE_MASK_SSE, NULL)) {
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (SSE2, AESNI) not supported\n");
 		return -ENODEV;
+	}
 
 	ret = simd_register_aeads_compat(&crypto_aegis128_aesni_alg, 1,
 					  &simd_alg);
diff --git a/arch/x86/crypto/aria_aesni_avx_glue.c b/arch/x86/crypto/aria_aesni_avx_glue.c
index d58fb995a266..24982450a125 100644
--- a/arch/x86/crypto/aria_aesni_avx_glue.c
+++ b/arch/x86/crypto/aria_aesni_avx_glue.c
@@ -176,13 +176,13 @@ static int __init aria_avx_init(void)
 	if (!boot_cpu_has(X86_FEATURE_AVX) ||
 	    !boot_cpu_has(X86_FEATURE_AES) ||
 	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
-		pr_info("AVX or AES-NI instructions are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX, AES-NI, OSXSAVE) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU extended feature '%s' is not supported\n", feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/camellia_aesni_avx2_glue.c b/arch/x86/crypto/camellia_aesni_avx2_glue.c
index e6c4ed1e40d2..bc6862077984 100644
--- a/arch/x86/crypto/camellia_aesni_avx2_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c
@@ -123,13 +123,14 @@ static int __init camellia_aesni_init(void)
 	    !boot_cpu_has(X86_FEATURE_AVX2) ||
 	    !boot_cpu_has(X86_FEATURE_AES) ||
 	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
-		pr_info("AVX2 or AES-NI instructions are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX, AVX2, AESNI, OSXSAVE) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/camellia_aesni_avx_glue.c b/arch/x86/crypto/camellia_aesni_avx_glue.c
index 6a9eadf0fe90..96e7e1accb6c 100644
--- a/arch/x86/crypto/camellia_aesni_avx_glue.c
+++ b/arch/x86/crypto/camellia_aesni_avx_glue.c
@@ -121,13 +121,14 @@ static int __init camellia_aesni_init(void)
 	if (!boot_cpu_has(X86_FEATURE_AVX) ||
 	    !boot_cpu_has(X86_FEATURE_AES) ||
 	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
-		pr_info("AVX or AES-NI instructions are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX, AESNI, OSXSAVE) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c
index b5ae17c3ac53..89650fffb550 100644
--- a/arch/x86/crypto/cast5_avx_glue.c
+++ b/arch/x86/crypto/cast5_avx_glue.c
@@ -114,7 +114,8 @@ static int __init cast5_init(void)
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+		feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/cast6_avx_glue.c b/arch/x86/crypto/cast6_avx_glue.c
index d1c14a5f80d7..d69f62ac9553 100644
--- a/arch/x86/crypto/cast6_avx_glue.c
+++ b/arch/x86/crypto/cast6_avx_glue.c
@@ -114,7 +114,8 @@ static int __init cast6_init(void)
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/crc32-pclmul_glue.c b/arch/x86/crypto/crc32-pclmul_glue.c
index c56d3d3ab0a0..4cf86f8f9428 100644
--- a/arch/x86/crypto/crc32-pclmul_glue.c
+++ b/arch/x86/crypto/crc32-pclmul_glue.c
@@ -192,8 +192,10 @@ static int __init crc32_pclmul_mod_init(void)
 {
 	int ret;
 
-	if (!x86_match_cpu(module_cpu_ids))
+	if (!x86_match_cpu(module_cpu_ids)) {
+		pr_info("CPU-optimized crypto module not loaded, required CPU feature (PCLMULQDQ) not supported\n");
 		return -ENODEV;
+	}
 
 	ret = crypto_register_shash(&alg);
 	if (!ret)
diff --git a/arch/x86/crypto/nhpoly1305-avx2-glue.c b/arch/x86/crypto/nhpoly1305-avx2-glue.c
index 2dc7b618771f..834bf64bb160 100644
--- a/arch/x86/crypto/nhpoly1305-avx2-glue.c
+++ b/arch/x86/crypto/nhpoly1305-avx2-glue.c
@@ -74,8 +74,10 @@ static int __init nhpoly1305_mod_init(void)
 		return -ENODEV;
 
 	if (!boot_cpu_has(X86_FEATURE_AVX2) ||
-	    !boot_cpu_has(X86_FEATURE_OSXSAVE))
+	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX2, OSXSAVE) not supported\n");
 		return -ENODEV;
+	}
 
 	ret = crypto_register_shash(&nhpoly1305_alg);
 	if (!ret)
diff --git a/arch/x86/crypto/serpent_avx2_glue.c b/arch/x86/crypto/serpent_avx2_glue.c
index bf59addaf804..4bd59ccea69a 100644
--- a/arch/x86/crypto/serpent_avx2_glue.c
+++ b/arch/x86/crypto/serpent_avx2_glue.c
@@ -112,13 +112,15 @@ static int __init serpent_avx2_init(void)
 
 		return -ENODEV;
 
-	if (!boot_cpu_has(X86_FEATURE_AVX2) || !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
-		pr_info("AVX2 instructions are not detected.\n");
+	if (!boot_cpu_has(X86_FEATURE_AVX2) ||
+	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX2, OSXSAVE) not supported\n");
 		return -ENODEV;
 	}
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/serpent_avx_glue.c b/arch/x86/crypto/serpent_avx_glue.c
index 7b0c02a61552..853b48677d2b 100644
--- a/arch/x86/crypto/serpent_avx_glue.c
+++ b/arch/x86/crypto/serpent_avx_glue.c
@@ -121,7 +121,8 @@ static int __init serpent_init(void)
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/sm3_avx_glue.c b/arch/x86/crypto/sm3_avx_glue.c
index 532f07b05745..5250fee79147 100644
--- a/arch/x86/crypto/sm3_avx_glue.c
+++ b/arch/x86/crypto/sm3_avx_glue.c
@@ -131,18 +131,19 @@ static int __init sm3_avx_mod_init(void)
 		return -ENODEV;
 
 	if (!boot_cpu_has(X86_FEATURE_AVX)) {
-		pr_info("AVX instruction are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, required CPU feature (AVX) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!boot_cpu_has(X86_FEATURE_BMI2)) {
-		pr_info("BMI2 instruction are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, required CPU feature (BMI2) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/sm4_aesni_avx2_glue.c b/arch/x86/crypto/sm4_aesni_avx2_glue.c
index 42819ee5d36d..cdd7ca92ca61 100644
--- a/arch/x86/crypto/sm4_aesni_avx2_glue.c
+++ b/arch/x86/crypto/sm4_aesni_avx2_glue.c
@@ -152,13 +152,14 @@ static int __init sm4_init(void)
 	    !boot_cpu_has(X86_FEATURE_AVX2) ||
 	    !boot_cpu_has(X86_FEATURE_AES) ||
 	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
-		pr_info("AVX2 or AES-NI instructions are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX, AVX2, AESNI, OSXSAVE) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/sm4_aesni_avx_glue.c b/arch/x86/crypto/sm4_aesni_avx_glue.c
index 8a25376d341f..a2ae3d1e0a4a 100644
--- a/arch/x86/crypto/sm4_aesni_avx_glue.c
+++ b/arch/x86/crypto/sm4_aesni_avx_glue.c
@@ -468,13 +468,14 @@ static int __init sm4_init(void)
 	if (!boot_cpu_has(X86_FEATURE_AVX) ||
 	    !boot_cpu_has(X86_FEATURE_AES) ||
 	    !boot_cpu_has(X86_FEATURE_OSXSAVE)) {
-		pr_info("AVX or AES-NI instructions are not detected.\n");
+		pr_info("CPU-optimized crypto module not loaded, all required CPU features (AVX, AESNI, OSXSAVE) not supported\n");
 		return -ENODEV;
 	}
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM,
 				&feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c
index ccf016bf6ef2..70167dd01816 100644
--- a/arch/x86/crypto/twofish_avx_glue.c
+++ b/arch/x86/crypto/twofish_avx_glue.c
@@ -123,7 +123,8 @@ static int __init twofish_init(void)
 		return -ENODEV;
 
 	if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, &feature_name)) {
-		pr_info("CPU feature '%s' is not supported.\n", feature_name);
+		pr_info("CPU-optimized crypto module not loaded, CPU extended feature '%s' is not supported\n",
+			feature_name);
 		return -ENODEV;
 	}
 
-- 
2.37.3




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux