]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
x86/cpu/AMD: Fix erratum 1076 (CPB bit)
authorBorislav Petkov <bp@suse.de>
Thu, 7 Sep 2017 17:08:21 +0000 (19:08 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 May 2018 07:59:19 +0000 (09:59 +0200)
CPUID Fn8000_0007_EDX[CPB] is wrongly 0 on models up to B1. But they do
support CPB (AMD's Core Performance Boosting cpufreq CPU feature), so fix that.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170907170821.16021-1-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
CVE-2018-3639 (x86)

(cherry picked from commit f7f3dc00f61261cdc9ccd8b886f21bc4dffd6fd9)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/cpu/amd.c

index 3bdd6ef99771abe5954de4d99bf0e6692c512b62..71225dba26c442e604c1dc37df84df325dbe4291 100644 (file)
@@ -749,6 +749,16 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
        }
 }
 
        }
 }
 
+static void init_amd_zn(struct cpuinfo_x86 *c)
+{
+       /*
+        * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects
+        * all up to and including B1.
+        */
+       if (c->x86_model <= 1 && c->x86_mask <= 1)
+               set_cpu_cap(c, X86_FEATURE_CPB);
+}
+
 static void init_amd(struct cpuinfo_x86 *c)
 {
        u32 dummy;
 static void init_amd(struct cpuinfo_x86 *c)
 {
        u32 dummy;
@@ -779,6 +789,7 @@ static void init_amd(struct cpuinfo_x86 *c)
        case 0x10: init_amd_gh(c); break;
        case 0x12: init_amd_ln(c); break;
        case 0x15: init_amd_bd(c); break;
        case 0x10: init_amd_gh(c); break;
        case 0x12: init_amd_ln(c); break;
        case 0x15: init_amd_bd(c); break;
+       case 0x17: init_amd_zn(c); break;
        }
 
        /*
        }
 
        /*