]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/x86-cpu-amd-set-the-cpb-bit-unconditionally-on-f17h.patch
drop perf-trace-support-multiple-vfs_getname-probes.patch from 4.4 and 4.9 queues
[thirdparty/kernel/stable-queue.git] / queue-4.4 / x86-cpu-amd-set-the-cpb-bit-unconditionally-on-f17h.patch
CommitLineData
f3365dcf
GKH
1From 0237199186e7a4aa5310741f0a6498a20c820fd7 Mon Sep 17 00:00:00 2001
2From: Jiaxun Yang <jiaxun.yang@flygoat.com>
3Date: Tue, 20 Nov 2018 11:00:18 +0800
4Subject: x86/CPU/AMD: Set the CPB bit unconditionally on F17h
5
6From: Jiaxun Yang <jiaxun.yang@flygoat.com>
7
8commit 0237199186e7a4aa5310741f0a6498a20c820fd7 upstream.
9
10Some F17h models do not have CPB set in CPUID even though the CPU
11supports it. Set the feature bit unconditionally on all F17h.
12
13 [ bp: Rewrite commit message and patch. ]
14
15Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
16Signed-off-by: Borislav Petkov <bp@suse.de>
17Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
18Cc: "H. Peter Anvin" <hpa@zytor.com>
19Cc: Ingo Molnar <mingo@redhat.com>
20Cc: Sherry Hurwitz <sherry.hurwitz@amd.com>
21Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
22Cc: Thomas Gleixner <tglx@linutronix.de>
23Cc: x86-ml <x86@kernel.org>
24Link: https://lkml.kernel.org/r/20181120030018.5185-1-jiaxun.yang@flygoat.com
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26
27---
28 arch/x86/kernel/cpu/amd.c | 8 +++-----
29 1 file changed, 3 insertions(+), 5 deletions(-)
30
31--- a/arch/x86/kernel/cpu/amd.c
32+++ b/arch/x86/kernel/cpu/amd.c
33@@ -716,11 +716,9 @@ static void init_amd_bd(struct cpuinfo_x
34 static void init_amd_zn(struct cpuinfo_x86 *c)
35 {
36 set_cpu_cap(c, X86_FEATURE_ZEN);
37- /*
38- * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects
39- * all up to and including B1.
40- */
41- if (c->x86_model <= 1 && c->x86_mask <= 1)
42+
43+ /* Fix erratum 1076: CPB feature bit not being set in CPUID. */
44+ if (!cpu_has(c, X86_FEATURE_CPB))
45 set_cpu_cap(c, X86_FEATURE_CPB);
46 }
47