All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sha: Enable cpuid check for Intel SHA extensions implementations
@ 2015-08-17 20:44 Tim Chen
  2015-08-17 21:19 ` Dave Hansen
  0 siblings, 1 reply; 10+ messages in thread
From: Tim Chen @ 2015-08-17 20:44 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Herbert Xu, Chandramouli Narayanan, x86, linux-kernel


The Intel Secure Hash Algorithm Extensions are designed to improve the performance
of SHA-1 and SHA-256. This patch adds the check for X86_FEATURE_SHA_NI bit.

The SHA extension guide is found in chapter 8 of the Intel
Architecture Instruction Set Extensions Programming reference:
https://software.intel.com/sites/default/files/managed/07/b7/319433-023.pdf

Signed-off-by: Chandramouli Narayanan <mouli@linux.intel.com>
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
 arch/x86/include/asm/cpufeature.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 3d6606f..7f85580 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -239,6 +239,7 @@
 #define X86_FEATURE_AVX512PF	( 9*32+26) /* AVX-512 Prefetch */
 #define X86_FEATURE_AVX512ER	( 9*32+27) /* AVX-512 Exponential and Reciprocal */
 #define X86_FEATURE_AVX512CD	( 9*32+28) /* AVX-512 Conflict Detection */
+#define X86_FEATURE_SHA_NI	( 9*32+29) /* SHA1/SHA256 Instruction Extensions */
 
 /* Extended state features, CPUID level 0x0000000d:1 (eax), word 10 */
 #define X86_FEATURE_XSAVEOPT	(10*32+ 0) /* XSAVEOPT */
@@ -401,6 +402,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 #define cpu_has_eager_fpu	boot_cpu_has(X86_FEATURE_EAGER_FPU)
 #define cpu_has_topoext		boot_cpu_has(X86_FEATURE_TOPOEXT)
 #define cpu_has_bpext		boot_cpu_has(X86_FEATURE_BPEXT)
+#define cpu_has_sha_ni		boot_cpu_has(X86_FEATURE_SHA_NI)
 
 #if __GNUC__ >= 4
 extern void warn_pre_alternatives(void);
-- 
1.8.3.1



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

end of thread, other threads:[~2015-08-22  9:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-17 20:44 [PATCH] sha: Enable cpuid check for Intel SHA extensions implementations Tim Chen
2015-08-17 21:19 ` Dave Hansen
2015-08-17 22:33   ` Tim Chen
2015-08-18 16:46     ` Thomas Gleixner
2015-08-19 16:49       ` Tim Chen
2015-08-20  4:08         ` Borislav Petkov
2015-08-20 15:03           ` Tim Chen
2015-08-20 20:02             ` Thomas Gleixner
2015-08-21 21:56               ` Tim Chen
2015-08-22  9:21                 ` [tip:x86/cpufeature] x86/cpufeatures: Enable cpuid for Intel SHA extensions tip-bot for Tim Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.