aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.9.21/0061-x86-mm-32-Move-setup_clear_cpu_cap-X86_FEATURE_PCID-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.9.21/0061-x86-mm-32-Move-setup_clear_cpu_cap-X86_FEATURE_PCID-.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.9.21/0061-x86-mm-32-Move-setup_clear_cpu_cap-X86_FEATURE_PCID-.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.9.21/0061-x86-mm-32-Move-setup_clear_cpu_cap-X86_FEATURE_PCID-.patch b/common/recipes-kernel/linux/linux-yocto-4.9.21/0061-x86-mm-32-Move-setup_clear_cpu_cap-X86_FEATURE_PCID-.patch
new file mode 100644
index 00000000..4149b72c
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.9.21/0061-x86-mm-32-Move-setup_clear_cpu_cap-X86_FEATURE_PCID-.patch
@@ -0,0 +1,48 @@
+From 1c6a584ef5f1c7ad9b8adef6ca862824541f361a Mon Sep 17 00:00:00 2001
+From: Andy Lutomirski <luto@kernel.org>
+Date: Sun, 17 Sep 2017 09:03:50 -0700
+Subject: [PATCH 061/103] x86/mm/32: Move setup_clear_cpu_cap(X86_FEATURE_PCID)
+ earlier
+
+commit b8b7abaed7a49b350f8ba659ddc264b04931d581 upstream.
+
+Otherwise we might have the PCID feature bit set during cpu_init().
+
+This is just for robustness. I haven't seen any actual bugs here.
+
+Signed-off-by: Andy Lutomirski <luto@kernel.org>
+Cc: Borislav Petkov <bpetkov@suse.de>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Fixes: cba4671af755 ("x86/mm: Disable PCID on 32-bit kernels")
+Link: http://lkml.kernel.org/r/b16dae9d6b0db5d9801ddbebbfd83384097c61f3.1505663533.git.luto@kernel.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/cpu/common.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
+index 8339b43..7b9ae04 100644
+--- a/arch/x86/kernel/cpu/common.c
++++ b/arch/x86/kernel/cpu/common.c
+@@ -890,6 +890,14 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
+ setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
+
+ fpu__init_system(c);
++
++#ifdef CONFIG_X86_32
++ /*
++ * Regardless of whether PCID is enumerated, the SDM says
++ * that it can't be enabled in 32-bit mode.
++ */
++ setup_clear_cpu_cap(X86_FEATURE_PCID);
++#endif
+ }
+
+ void __init early_cpu_init(void)
+--
+2.7.4
+