public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/raid6: correctly check for assembler capabilities
@ 2015-01-23  8:29 Jan Beulich
  2015-01-23 16:16 ` Thomas Gleixner
  2015-02-03 20:31 ` Paul Bolle
  0 siblings, 2 replies; 15+ messages in thread
From: Jan Beulich @ 2015-01-23  8:29 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: james.t.kukunas, neilb, linux-kernel

Just like for AVX2 (which simply needs an #if -> #ifdef conversion),
SSSE3 assembler support should be checked for before using it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
Cc: Neil Brown <neilb@suse.de>
---
 arch/x86/Makefile       |    1 +
 lib/raid6/algos.c       |    2 +-
 lib/raid6/recov_avx2.c  |    2 +-
 lib/raid6/recov_ssse3.c |    6 ++++++
 4 files changed, 9 insertions(+), 2 deletions(-)

--- 3.19-rc5/arch/x86/Makefile
+++ 3.19-rc5-raid6-SSSE3/arch/x86/Makefile
@@ -148,6 +148,7 @@ cfi-sections := $(call as-instr,.cfi_sec
 
 # does binutils support specific instructions?
 asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)
+asinstr += $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1)
 asinstr += $(call as-instr,crc32l %eax$(comma)%eax,-DCONFIG_AS_CRC32=1)
 avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1)
 avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1)
--- 3.19-rc5/lib/raid6/algos.c
+++ 3.19-rc5-raid6-SSSE3/lib/raid6/algos.c
@@ -89,10 +89,10 @@ void (*raid6_datap_recov)(int, size_t, i
 EXPORT_SYMBOL_GPL(raid6_datap_recov);
 
 const struct raid6_recov_calls *const raid6_recov_algos[] = {
-#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
 #ifdef CONFIG_AS_AVX2
 	&raid6_recov_avx2,
 #endif
+#ifdef CONFIG_AS_SSSE3
 	&raid6_recov_ssse3,
 #endif
 	&raid6_recov_intx1,
--- 3.19-rc5/lib/raid6/recov_avx2.c
+++ 3.19-rc5-raid6-SSSE3/lib/raid6/recov_avx2.c
@@ -8,7 +8,7 @@
  * of the License.
  */
 
-#if CONFIG_AS_AVX2
+#ifdef CONFIG_AS_AVX2
 
 #include <linux/raid/pq.h>
 #include "x86.h"
--- 3.19-rc5/lib/raid6/recov_ssse3.c
+++ 3.19-rc5-raid6-SSSE3/lib/raid6/recov_ssse3.c
@@ -7,6 +7,8 @@
  * of the License.
  */
 
+#ifdef CONFIG_AS_SSSE3
+
 #include <linux/raid/pq.h>
 #include "x86.h"
 
@@ -330,3 +332,7 @@ const struct raid6_recov_calls raid6_rec
 #endif
 	.priority = 1,
 };
+
+#else
+#warning "your version of binutils lacks SSSE3 support"
+#endif




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-06-16 20:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23  8:29 [PATCH] x86/raid6: correctly check for assembler capabilities Jan Beulich
2015-01-23 16:16 ` Thomas Gleixner
2015-01-28  5:02   ` NeilBrown
2015-02-03 20:31 ` Paul Bolle
2015-02-03 20:50   ` NeilBrown
2015-02-03 21:03     ` Paul Bolle
2015-02-03 21:09       ` NeilBrown
2015-02-03 21:24         ` Valentin Rothberg
2015-02-04  7:51       ` Jan Beulich
2015-06-16 19:46       ` H. Peter Anvin
2015-06-16 19:56         ` Paul Bolle
2015-06-16 20:05           ` H. Peter Anvin
2015-06-16 20:37             ` Paul Bolle
2015-06-16 20:42               ` H. Peter Anvin
2015-06-16 20:51                 ` Paul Bolle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox