]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/spec: Fix spectre_v1 bug and mitigation indicators
authorJohn Haxby <john.haxby@oracle.com>
Sun, 28 Jan 2018 19:05:12 +0000 (19:05 +0000)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 1 Feb 2018 23:28:57 +0000 (15:28 -0800)
/proc/cpuinfo correctly shows that we have the spectre_v1 bug and
the sysfs vulnerabilities file shows that we have the lfence mitigation
in place.

Orabug: 27470687

Signed-off-by: John Haxby <john.haxby@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/kernel/cpu/bugs_64.c
arch/x86/kernel/cpu/common.c

index 3e437853d21f46a8bbce3f14fdf4753557d5fcc5..aa1c948ca2a542fd387065fc629c6861114eee8a 100644 (file)
@@ -137,7 +137,8 @@ ssize_t cpu_show_spectre_v1(struct device *dev,
 {
        if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1))
                return sprintf(buf, "Not affected\n");
-       return sprintf(buf, "Vulnerable\n");
+       /* At the moment, a single hard-wired mitigation */
+       return sprintf(buf, "Mitigation: lfence\n");
 }
 
 ssize_t cpu_show_spectre_v2(struct device *dev,
index 975a113faefc1b15a537ae32ebd7eda5b96af86a..a59f07bfac5dc8b8b1b60ecddf52e7a65ebcd0bf 100644 (file)
@@ -1074,9 +1074,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
        if (c->x86_vendor != X86_VENDOR_AMD)
                setup_force_cpu_bug(X86_BUG_CPU_MELTDOWN);
 
-       /* Mitigation for SPECTRE_V1 already in place */
-       /* setup_force_cpu_bug(X86_BUG_SPECTRE_V1); */
-
+       setup_force_cpu_bug(X86_BUG_SPECTRE_V1);
        setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
 }