]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0084-x86-cpufeatures-Enable-new-SSE-AVX-AVX512-CPU-featur.patch
bf5c981dadcab89e4245a929ac5d587c729e883b
[pve-kernel.git] / patches / kernel / 0084-x86-cpufeatures-Enable-new-SSE-AVX-AVX512-CPU-featur.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Gayatri Kammela <gayatri.kammela@intel.com>
3 Date: Mon, 30 Oct 2017 18:20:29 -0700
4 Subject: [PATCH] x86/cpufeatures: Enable new SSE/AVX/AVX512 CPU features
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 CVE-2017-5754
10
11 Add a few new SSE/AVX/AVX512 instruction groups/features for enumeration
12 in /proc/cpuinfo: AVX512_VBMI2, GFNI, VAES, VPCLMULQDQ, AVX512_VNNI,
13 AVX512_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
22 Detailed information of CPUID bits for these features can be found
23 in the Intel Architecture Instruction Set Extensions and Future Features
24 Programming Interface document (refer to Table 1-1. and Table 1-2.).
25 A copy of this document is available at
26 https://bugzilla.kernel.org/show_bug.cgi?id=197239
27
28 Signed-off-by: Gayatri Kammela <gayatri.kammela@intel.com>
29 Acked-by: Thomas Gleixner <tglx@linutronix.de>
30 Cc: Andi Kleen <andi.kleen@intel.com>
31 Cc: Fenghua Yu <fenghua.yu@intel.com>
32 Cc: Linus Torvalds <torvalds@linux-foundation.org>
33 Cc: Peter Zijlstra <peterz@infradead.org>
34 Cc: Ravi Shankar <ravi.v.shankar@intel.com>
35 Cc: Ricardo Neri <ricardo.neri@intel.com>
36 Cc: Yang Zhong <yang.zhong@intel.com>
37 Cc: bp@alien8.de
38 Link: http://lkml.kernel.org/r/1509412829-23380-1-git-send-email-gayatri.kammela@intel.com
39 Signed-off-by: Ingo Molnar <mingo@kernel.org>
40 (cherry picked from commit c128dbfa0f879f8ce7b79054037889b0b2240728)
41 Signed-off-by: Andy Whitcroft <apw@canonical.com>
42 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
43 (cherry picked from commit b29eb29c5aca4708d66fa977db40c779366636a2)
44 Signed-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
50 diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
51 index 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 */
67 diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c
68 index 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 --
85 2.14.2
86