]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0082-x86-cpufeatures-Enable-new-SSE-AVX-AVX512-CPU-featur.patch
update ABI file
[pve-kernel.git] / patches / kernel / 0082-x86-cpufeatures-Enable-new-SSE-AVX-AVX512-CPU-featur.patch
CommitLineData
59d5af67 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
321d628a
FG
2From: Gayatri Kammela <gayatri.kammela@intel.com>
3Date: Mon, 30 Oct 2017 18:20:29 -0700
59d5af67 4Subject: [PATCH] x86/cpufeatures: Enable new SSE/AVX/AVX512 CPU features
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11Add a few new SSE/AVX/AVX512 instruction groups/features for enumeration
12in /proc/cpuinfo: AVX512_VBMI2, GFNI, VAES, VPCLMULQDQ, AVX512_VNNI,
13AVX512_BITALG.
14
15 CPUID.(EAX=7,ECX=0):ECX[bit 6] AVX512_VBMI2
16 CPUID.(EAX=7,ECX=0):ECX[bit 8] GFNI
17 CPUID.(EAX=7,ECX=0):ECX[bit 9] VAES
18 CPUID.(EAX=7,ECX=0):ECX[bit 10] VPCLMULQDQ
19 CPUID.(EAX=7,ECX=0):ECX[bit 11] AVX512_VNNI
20 CPUID.(EAX=7,ECX=0):ECX[bit 12] AVX512_BITALG
21
22Detailed information of CPUID bits for these features can be found
23in the Intel Architecture Instruction Set Extensions and Future Features
24Programming Interface document (refer to Table 1-1. and Table 1-2.).
25A copy of this document is available at
26https://bugzilla.kernel.org/show_bug.cgi?id=197239
27
28Signed-off-by: Gayatri Kammela <gayatri.kammela@intel.com>
29Acked-by: Thomas Gleixner <tglx@linutronix.de>
30Cc: Andi Kleen <andi.kleen@intel.com>
31Cc: Fenghua Yu <fenghua.yu@intel.com>
32Cc: Linus Torvalds <torvalds@linux-foundation.org>
33Cc: Peter Zijlstra <peterz@infradead.org>
34Cc: Ravi Shankar <ravi.v.shankar@intel.com>
35Cc: Ricardo Neri <ricardo.neri@intel.com>
36Cc: Yang Zhong <yang.zhong@intel.com>
37Cc: bp@alien8.de
38Link: http://lkml.kernel.org/r/1509412829-23380-1-git-send-email-gayatri.kammela@intel.com
39Signed-off-by: Ingo Molnar <mingo@kernel.org>
40(cherry picked from commit c128dbfa0f879f8ce7b79054037889b0b2240728)
41Signed-off-by: Andy Whitcroft <apw@canonical.com>
42Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
43(cherry picked from commit b29eb29c5aca4708d66fa977db40c779366636a2)
44Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
45---
46 arch/x86/include/asm/cpufeatures.h | 6 ++++++
47 arch/x86/kernel/cpu/cpuid-deps.c | 6 ++++++
48 2 files changed, 12 insertions(+)
49
50diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
51index f4e145c4b06f..c465bd6613ed 100644
52--- a/arch/x86/include/asm/cpufeatures.h
53+++ b/arch/x86/include/asm/cpufeatures.h
54@@ -297,6 +297,12 @@
55 #define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/
56 #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */
57 #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */
58+#define X86_FEATURE_AVX512_VBMI2 (16*32+ 6) /* Additional AVX512 Vector Bit Manipulation Instructions */
59+#define X86_FEATURE_GFNI (16*32+ 8) /* Galois Field New Instructions */
60+#define X86_FEATURE_VAES (16*32+ 9) /* Vector AES */
61+#define X86_FEATURE_VPCLMULQDQ (16*32+ 10) /* Carry-Less Multiplication Double Quadword */
62+#define X86_FEATURE_AVX512_VNNI (16*32+ 11) /* Vector Neural Network Instructions */
63+#define X86_FEATURE_AVX512_BITALG (16*32+12) /* Support for VPOPCNT[B,W] and VPSHUF-BITQMB */
64 #define X86_FEATURE_AVX512_VPOPCNTDQ (16*32+14) /* POPCNT for vectors of DW/QW */
65 #define X86_FEATURE_LA57 (16*32+16) /* 5-level page tables */
66 #define X86_FEATURE_RDPID (16*32+22) /* RDPID instruction */
67diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c
68index c1d49842a411..c21f22d836ad 100644
69--- a/arch/x86/kernel/cpu/cpuid-deps.c
70+++ b/arch/x86/kernel/cpu/cpuid-deps.c
71@@ -50,6 +50,12 @@ const static struct cpuid_dep cpuid_deps[] = {
72 { X86_FEATURE_AVX512BW, X86_FEATURE_AVX512F },
73 { X86_FEATURE_AVX512VL, X86_FEATURE_AVX512F },
74 { X86_FEATURE_AVX512VBMI, X86_FEATURE_AVX512F },
75+ { X86_FEATURE_AVX512_VBMI2, X86_FEATURE_AVX512VL },
76+ { X86_FEATURE_GFNI, X86_FEATURE_AVX512VL },
77+ { X86_FEATURE_VAES, X86_FEATURE_AVX512VL },
78+ { X86_FEATURE_VPCLMULQDQ, X86_FEATURE_AVX512VL },
79+ { X86_FEATURE_AVX512_VNNI, X86_FEATURE_AVX512VL },
80+ { X86_FEATURE_AVX512_BITALG, X86_FEATURE_AVX512VL },
81 { X86_FEATURE_AVX512_4VNNIW, X86_FEATURE_AVX512F },
82 { X86_FEATURE_AVX512_4FMAPS, X86_FEATURE_AVX512F },
83 { X86_FEATURE_AVX512_VPOPCNTDQ, X86_FEATURE_AVX512F },
84--
852.14.2
86