* Please apply to stable 4.9 kernel
@ 2018-07-05 10:41 Juergen Gross
2018-07-05 18:01 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Juergen Gross @ 2018-07-05 10:41 UTC (permalink / raw)
To: stable
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Hi Greg,
please apply the attched backported patch to the 4.9 stable tree.
It is needed to boot Xen PV guests (broken since commit
c43b4ff972a986c85bdd8dc1aa05fe23b29ef99c which I didn't realize
due to my kernel parameters when testing).
Juergen
[-- Attachment #2: 0001-x86-cpu-Re-apply-forced-caps-every-time-CPU-caps-are.patch --]
[-- Type: text/x-patch, Size: 2326 bytes --]
>From cc2872574d060fb3d35fd28c81327ee887f540ef Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Thu, 5 Jul 2018 12:29:48 +0200
Subject: [PATCH-for-4.9-stable] x86/cpu: Re-apply forced caps every time CPU caps are re-read
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: Juergen Gross <jgross@suse.com>
---
upstream commit: 60d3450167433f2d099ce2869dc52dd9e7dc9b29
needed for Xen PV guests to boot, was broken since commit
c43b4ff972a986c85bdd8dc1aa05fe23b29ef99c
---
arch/x86/kernel/cpu/common.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index b0fd028b2eee..7a4279d8a902 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -848,6 +848,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)
--
2.13.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Please apply to stable 4.9 kernel
@ 2018-07-05 13:11 Juergen Gross
2018-07-05 18:01 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Juergen Gross @ 2018-07-05 13:11 UTC (permalink / raw)
To: stable
[-- Attachment #1: Type: text/plain, Size: 86 bytes --]
Hi Greg,
please apply the attched backported patch to the 4.9 stable tree.
Juergen
[-- Attachment #2: 0001-x86-xen-Add-call-of-speculative_store_bypass_ht_init.patch --]
[-- Type: text/x-patch, Size: 1973 bytes --]
>From d429761a575c3b444662ae73911c383e64248da1 Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Thu, 5 Jul 2018 14:33:15 +0200
Subject: [PATCH] x86/xen: Add call of speculative_store_bypass_ht_init() to PV
paths
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>
---
Backport to stable 4.9 of upstream commit: 74899d92e66663dc7671a8017b3146dcd4735f3b
---
arch/x86/xen/smp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index a11540e51f62..8eca26ef6471 100644
--- 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);
@@ -375,6 +378,8 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
}
set_cpu_sibling_map(0);
+ speculative_store_bypass_ht_init();
+
xen_pmu_init(0);
if (xen_smp_intr_init(0))
--
2.13.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Please apply to stable 4.9 kernel
2018-07-05 10:41 Juergen Gross
@ 2018-07-05 18:01 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2018-07-05 18:01 UTC (permalink / raw)
To: Juergen Gross; +Cc: stable
On Thu, Jul 05, 2018 at 12:41:52PM +0200, Juergen Gross wrote:
> Hi Greg,
>
> please apply the attched backported patch to the 4.9 stable tree.
> It is needed to boot Xen PV guests (broken since commit
> c43b4ff972a986c85bdd8dc1aa05fe23b29ef99c which I didn't realize
> due to my kernel parameters when testing).
This backport does not apply to the 4.9.y kernel tree :(
Can you fix it up and try again?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Please apply to stable 4.9 kernel
2018-07-05 13:11 Please apply to stable 4.9 kernel Juergen Gross
@ 2018-07-05 18:01 ` Greg KH
2018-07-05 18:07 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2018-07-05 18:01 UTC (permalink / raw)
To: Juergen Gross; +Cc: stable
On Thu, Jul 05, 2018 at 03:11:31PM +0200, Juergen Gross wrote:
> Hi Greg,
>
> please apply the attched backported patch to the 4.9 stable tree.
Also does not apply at all. What are you diffing these against?
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Please apply to stable 4.9 kernel
2018-07-05 18:01 ` Greg KH
@ 2018-07-05 18:07 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2018-07-05 18:07 UTC (permalink / raw)
To: Juergen Gross; +Cc: stable
On Thu, Jul 05, 2018 at 08:01:58PM +0200, Greg KH wrote:
> On Thu, Jul 05, 2018 at 03:11:31PM +0200, Juergen Gross wrote:
> > Hi Greg,
> >
> > please apply the attched backported patch to the 4.9 stable tree.
>
> Also does not apply at all. What are you diffing these against?a
Ugh, my fault for both of these, nevermind, these work, sorry for the
noise...
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-05 18:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-05 13:11 Please apply to stable 4.9 kernel Juergen Gross
2018-07-05 18:01 ` Greg KH
2018-07-05 18:07 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2018-07-05 10:41 Juergen Gross
2018-07-05 18:01 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).