]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.142/x86-cpu-probe-cpuid-leaf-6-even-when-cpuid_level-6.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.142 / x86-cpu-probe-cpuid-leaf-6-even-when-cpuid_level-6.patch
1 From 3df8d9208569ef0b2313e516566222d745f3b94b Mon Sep 17 00:00:00 2001
2 From: Andy Lutomirski <luto@kernel.org>
3 Date: Thu, 15 Dec 2016 10:14:42 -0800
4 Subject: x86/cpu: Probe CPUID leaf 6 even when cpuid_level == 6
5
6 From: Andy Lutomirski <luto@kernel.org>
7
8 commit 3df8d9208569ef0b2313e516566222d745f3b94b upstream.
9
10 A typo (or mis-merge?) resulted in leaf 6 only being probed if
11 cpuid_level >= 7.
12
13 Fixes: 2ccd71f1b278 ("x86/cpufeature: Move some of the scattered feature bits to x86_capability")
14 Signed-off-by: Andy Lutomirski <luto@kernel.org>
15 Acked-by: Borislav Petkov <bp@alien8.de>
16 Cc: Brian Gerst <brgerst@gmail.com>
17 Link: http://lkml.kernel.org/r/6ea30c0e9daec21e488b54761881a6dfcf3e04d0.1481825597.git.luto@kernel.org
18 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
19 Cc: Brad Spengler <spender@grsecurity.net>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 arch/x86/kernel/cpu/common.c | 7 ++++---
24 1 file changed, 4 insertions(+), 3 deletions(-)
25
26 --- a/arch/x86/kernel/cpu/common.c
27 +++ b/arch/x86/kernel/cpu/common.c
28 @@ -686,13 +686,14 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
29 c->x86_capability[CPUID_1_EDX] = edx;
30 }
31
32 + /* Thermal and Power Management Leaf: level 0x00000006 (eax) */
33 + if (c->cpuid_level >= 0x00000006)
34 + c->x86_capability[CPUID_6_EAX] = cpuid_eax(0x00000006);
35 +
36 /* Additional Intel-defined flags: level 0x00000007 */
37 if (c->cpuid_level >= 0x00000007) {
38 cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx);
39 -
40 c->x86_capability[CPUID_7_0_EBX] = ebx;
41 -
42 - c->x86_capability[CPUID_6_EAX] = cpuid_eax(0x00000006);
43 c->x86_capability[CPUID_7_ECX] = ecx;
44 }
45