]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Jul 2018 11:25:25 +0000 (13:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Jul 2018 11:25:25 +0000 (13:25 +0200)
added patches:
x86-cpu-re-apply-forced-caps-every-time-cpu-caps-are-re-read.patch
x86-xen-add-call-of-speculative_store_bypass_ht_init-to-pv-paths.patch

queue-4.4/series
queue-4.4/x86-cpu-re-apply-forced-caps-every-time-cpu-caps-are-re-read.patch [new file with mode: 0644]
queue-4.4/x86-xen-add-call-of-speculative_store_bypass_ht_init-to-pv-paths.patch [new file with mode: 0644]

index 561ce55e2a7606196bdaaf803bda3261bae5a563..37630f9326834406e4069c5e193a2eed1d05d870 100644 (file)
@@ -95,3 +95,5 @@ x86-bugs-remove-x86_spec_ctrl_set.patch
 x86-bugs-rework-spec_ctrl-base-and-mask-logic.patch
 x86-speculation-kvm-implement-support-for-virt_spec_ctrl-ls_cfg.patch
 x86-bugs-rename-ssbd_no-to-ssb_no.patch
+x86-xen-add-call-of-speculative_store_bypass_ht_init-to-pv-paths.patch
+x86-cpu-re-apply-forced-caps-every-time-cpu-caps-are-re-read.patch
diff --git a/queue-4.4/x86-cpu-re-apply-forced-caps-every-time-cpu-caps-are-re-read.patch b/queue-4.4/x86-cpu-re-apply-forced-caps-every-time-cpu-caps-are-re-read.patch
new file mode 100644 (file)
index 0000000..dc5d319
--- /dev/null
@@ -0,0 +1,58 @@
+From bdda88b5f410398f03ec6bb294cce07173232ea8 Mon Sep 17 00:00:00 2001
+From: Andy Lutomirski <luto@kernel.org>
+Date: Wed, 18 Jan 2017 11:15:39 -0800
+Subject: x86/cpu: Re-apply forced caps every time CPU caps are re-read
+
+From: Andy Lutomirski <luto@kernel.org>
+
+commit 60d3450167433f2d099ce2869dc52dd9e7dc9b29 upstream.
+
+Calling get_cpu_cap() will reset a bunch of CPU features.  This will
+cause the system to lose track of force-set and force-cleared
+features in the words that are reset until the end of CPU
+initialization.  This can cause X86_FEATURE_FPU, for example, to
+change back and forth during boot and potentially confuse CPU setup.
+
+To minimize the chance of confusion, re-apply forced caps every time
+get_cpu_cap() is called.
+
+Signed-off-by: Andy Lutomirski <luto@kernel.org>
+Reviewed-by: Borislav Petkov <bp@suse.de>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Cc: Fenghua Yu <fenghua.yu@intel.com>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Matthew Whitehead <tedheadster@gmail.com>
+Cc: Oleg Nesterov <oleg@redhat.com>
+Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Rik van Riel <riel@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
+Link: http://lkml.kernel.org/r/c817eb373d2c67c2c81413a70fc9b845fa34a37e.1484705016.git.luto@kernel.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/cpu/common.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/arch/x86/kernel/cpu/common.c
++++ b/arch/x86/kernel/cpu/common.c
+@@ -803,6 +803,13 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
+       init_scattered_cpuid_features(c);
+       init_speculation_control(c);
++
++      /*
++       * Clear/Set all flags overridden by options, after probe.
++       * This needs to happen each time we re-probe, which may happen
++       * several times during CPU initialization.
++       */
++      apply_forced_caps(c);
+ }
+ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
diff --git a/queue-4.4/x86-xen-add-call-of-speculative_store_bypass_ht_init-to-pv-paths.patch b/queue-4.4/x86-xen-add-call-of-speculative_store_bypass_ht_init-to-pv-paths.patch
new file mode 100644 (file)
index 0000000..1ca33f9
--- /dev/null
@@ -0,0 +1,65 @@
+From 9dee2b7c4d4868423d9812c969b0b724fdf780c6 Mon Sep 17 00:00:00 2001
+From: Juergen Gross <jgross@suse.com>
+Date: Thu, 21 Jun 2018 10:43:31 +0200
+Subject: x86/xen: Add call of speculative_store_bypass_ht_init() to PV paths
+
+From: Juergen Gross <jgross@suse.com>
+
+commit 74899d92e66663dc7671a8017b3146dcd4735f3b upstream.
+
+Commit:
+
+  1f50ddb4f418 ("x86/speculation: Handle HT correctly on AMD")
+
+... added speculative_store_bypass_ht_init() to the per-CPU initialization sequence.
+
+speculative_store_bypass_ht_init() needs to be called on each CPU for
+PV guests, too.
+
+Reported-by: Brian Woods <brian.woods@amd.com>
+Tested-by: Brian Woods <brian.woods@amd.com>
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Cc: <stable@vger.kernel.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: boris.ostrovsky@oracle.com
+Cc: xen-devel@lists.xenproject.org
+Fixes: 1f50ddb4f4189243c05926b842dc1a0332195f31 ("x86/speculation: Handle HT correctly on AMD")
+Link: https://lore.kernel.org/lkml/20180621084331.21228-1-jgross@suse.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/xen/smp.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/x86/xen/smp.c
++++ b/arch/x86/xen/smp.c
+@@ -28,6 +28,7 @@
+ #include <xen/interface/vcpu.h>
+ #include <xen/interface/xenpmu.h>
++#include <asm/spec-ctrl.h>
+ #include <asm/xen/interface.h>
+ #include <asm/xen/hypercall.h>
+@@ -87,6 +88,8 @@ static void cpu_bringup(void)
+       cpu_data(cpu).x86_max_cores = 1;
+       set_cpu_sibling_map(cpu);
++      speculative_store_bypass_ht_init();
++
+       xen_setup_cpu_clockevents();
+       notify_cpu_starting(cpu);
+@@ -357,6 +360,8 @@ static void __init xen_smp_prepare_cpus(
+       }
+       set_cpu_sibling_map(0);
++      speculative_store_bypass_ht_init();
++
+       xen_pmu_init(0);
+       if (xen_smp_intr_init(0))