]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.1/x86-cpu-amd-set-the-cpb-bit-unconditionally-on-f17h.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.1 / x86-cpu-amd-set-the-cpb-bit-unconditionally-on-f17h.patch
1 From 0237199186e7a4aa5310741f0a6498a20c820fd7 Mon Sep 17 00:00:00 2001
2 From: Jiaxun Yang <jiaxun.yang@flygoat.com>
3 Date: Tue, 20 Nov 2018 11:00:18 +0800
4 Subject: x86/CPU/AMD: Set the CPB bit unconditionally on F17h
5
6 From: Jiaxun Yang <jiaxun.yang@flygoat.com>
7
8 commit 0237199186e7a4aa5310741f0a6498a20c820fd7 upstream.
9
10 Some F17h models do not have CPB set in CPUID even though the CPU
11 supports it. Set the feature bit unconditionally on all F17h.
12
13 [ bp: Rewrite commit message and patch. ]
14
15 Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
16 Signed-off-by: Borislav Petkov <bp@suse.de>
17 Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
18 Cc: "H. Peter Anvin" <hpa@zytor.com>
19 Cc: Ingo Molnar <mingo@redhat.com>
20 Cc: Sherry Hurwitz <sherry.hurwitz@amd.com>
21 Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
22 Cc: Thomas Gleixner <tglx@linutronix.de>
23 Cc: x86-ml <x86@kernel.org>
24 Link: https://lkml.kernel.org/r/20181120030018.5185-1-jiaxun.yang@flygoat.com
25 Signed-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 @@ -819,11 +819,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_stepping <= 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