uas-ignore-uas-for-norelsys-ns1068-x-chips.patch
e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch
x86-documentation-add-pti-description.patch
-sysfs-cpu-add-vulnerability-folder.patch
-x86-cpu-implement-cpu-vulnerabilites-sysfs-functions.patch
x86-cpu-factor-out-application-of-forced-cpu-caps.patch
x86-cpufeatures-make-cpu-bugs-sticky.patch
x86-cpufeatures-add-x86_bug_cpu_insecure.patch
x86-pti-rename-bug_cpu_insecure-to-bug_cpu_meltdown.patch
-x86-cpu-merge-bugs.c-and-bugs_64.c.patch
x86-cpufeatures-add-x86_bug_spectre_v.patch
+x86-cpu-merge-bugs.c-and-bugs_64.c.patch
+sysfs-cpu-add-vulnerability-folder.patch
+x86-cpu-implement-cpu-vulnerabilites-sysfs-functions.patch
x86-cpu-amd-make-lfence-a-serializing-instruction.patch
x86-cpu-amd-use-lfence_rdtsc-in-preference-to-mfence_rdtsc.patch
sysfs-cpu-fix-typos-in-vulnerability-documentation.patch
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lkml.kernel.org/r/20180107214913.177414879@linutronix.de
+Signed-off-by: Razvan Ghitulete <rga@amazon.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
#include <asm/bugs.h>
#include <asm/processor.h>
#include <asm/processor-flags.h>
-@@ -49,3 +50,31 @@ void __init check_bugs(void)
-
- fpu__init_check_bugs();
+@@ -67,3 +68,31 @@ void __init check_bugs(void)
+ set_memory_4k((unsigned long)__va(0), 1);
+ #endif
}
+
+#ifdef CONFIG_SYSFS
+{
+ if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
+ return sprintf(buf, "Not affected\n");
-+ if (boot_cpu_has(X86_FEATURE_PTI))
++ if (boot_cpu_has(X86_FEATURE_KAISER))
+ return sprintf(buf, "Mitigation: PTI\n");
+ return sprintf(buf, "Vulnerable\n");
+}
obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
-@@ -17,6 +17,8 @@
+@@ -16,6 +16,8 @@
#include <asm/msr.h>
#include <asm/paravirt.h>
#include <asm/alternative.h>
void __init check_bugs(void)
{
-@@ -29,11 +31,13 @@ void __init check_bugs(void)
+@@ -28,11 +30,13 @@ void __init check_bugs(void)
#endif
identify_boot_cpu();
/*
* Check whether we are able to run this kernel safely on SMP.
*
-@@ -49,6 +53,20 @@ void __init check_bugs(void)
+@@ -48,4 +52,18 @@ void __init check_bugs(void)
alternative_instructions();
fpu__init_check_bugs();
+ set_memory_4k((unsigned long)__va(0), 1);
+#endif
}
-
- #ifdef CONFIG_SYSFS
--- a/arch/x86/kernel/cpu/bugs_64.c
+++ /dev/null
@@ -1,33 +0,0 @@