lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 21 Apr 2020 16:39:47 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     x86@...nel.org, Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        "H . Peter Anvin" <hpa@...or.com>
Cc:     "Jason A . Donenfeld" <Jason@...c4.com>,
        linux-crypto@...r.kernel.org,
        Masahiro Yamada <masahiroy@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] raid6/algos.c: refactor raid6_algos array for x86

Factor out the common pointer references.

Common for i386 and x86_64:
  raid6_avx512x2
  raid6_avx512x1
  raid6_avx2x2
  raid6_avx2x1
  raid6_sse2x2
  raid6_sse2x1
  raid6_sse1x2

Only for i386:
  raid6_sse1x1
  raid6_mmxx2
  raid6_mmxx1

Only for x86_64:
  raid6_avx512x4
  raid6_avx2x4
  raid6_sse2x4

Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
---

 lib/raid6/algos.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index 978fa19efbbf..c0f2fd6e0621 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -30,32 +30,28 @@ EXPORT_SYMBOL_GPL(raid6_call);
 
 const struct raid6_calls * const raid6_algos[] = {
 #ifdef CONFIG_X86
-#if defined(CONFIG_X86_32)
 #ifdef CONFIG_AS_AVX512
-	&raid6_avx512x2,
-	&raid6_avx512x1,
-#endif
-	&raid6_avx2x2,
-	&raid6_avx2x1,
-	&raid6_sse2x2,
-	&raid6_sse2x1,
-	&raid6_sse1x2,
-	&raid6_sse1x1,
-	&raid6_mmxx2,
-	&raid6_mmxx1,
-#endif
 #if defined(CONFIG_X86_64)
-#ifdef CONFIG_AS_AVX512
 	&raid6_avx512x4,
+#endif
 	&raid6_avx512x2,
 	&raid6_avx512x1,
 #endif
+#ifdef CONFIG_X86_64
 	&raid6_avx2x4,
+#endif
 	&raid6_avx2x2,
 	&raid6_avx2x1,
+#ifdef CONFIG_X86_64
 	&raid6_sse2x4,
+#endif
 	&raid6_sse2x2,
 	&raid6_sse2x1,
+	&raid6_sse1x2,
+#ifdef CONFIG_X86_32
+	&raid6_sse1x1,
+	&raid6_mmxx2,
+	&raid6_mmxx1,
 #endif
 #endif /* CONFIG_X86 */
 #ifdef CONFIG_ALTIVEC
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ