From: Greg Kroah-Hartman Date: Mon, 23 Jul 2018 11:25:25 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.4.144~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=665be48d0c912d6983cdc40cd22f2821787aea75;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches 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 --- diff --git a/queue-4.4/series b/queue-4.4/series index 561ce55e2a7..37630f93268 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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 index 00000000000..dc5d3196730 --- /dev/null +++ b/queue-4.4/x86-cpu-re-apply-forced-caps-every-time-cpu-caps-are-re-read.patch @@ -0,0 +1,58 @@ +From bdda88b5f410398f03ec6bb294cce07173232ea8 Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +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 + +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 +Reviewed-by: Borislav Petkov +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Dave Hansen +Cc: Fenghua Yu +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Matthew Whitehead +Cc: Oleg Nesterov +Cc: One Thousand Gnomes +Cc: Peter Zijlstra +Cc: Rik van Riel +Cc: Thomas Gleixner +Cc: Yu-cheng Yu +Link: http://lkml.kernel.org/r/c817eb373d2c67c2c81413a70fc9b845fa34a37e.1484705016.git.luto@kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Srivatsa S. Bhat +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..1ca33f9919e --- /dev/null +++ b/queue-4.4/x86-xen-add-call-of-speculative_store_bypass_ht_init-to-pv-paths.patch @@ -0,0 +1,65 @@ +From 9dee2b7c4d4868423d9812c969b0b724fdf780c6 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +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 + +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 +Tested-by: Brian Woods +Signed-off-by: Juergen Gross +Cc: +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +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 +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Srivatsa S. Bhat +Signed-off-by: Greg Kroah-Hartman +--- + 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 + #include + ++#include + #include + #include + +@@ -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))