]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.107/xen-set-cpu-capabilities-from-xen_start_kernel.patch
Fix up backported ptrace patch
[thirdparty/kernel/stable-queue.git] / releases / 4.9.107 / xen-set-cpu-capabilities-from-xen_start_kernel.patch
1 From foo@baz Sat Jun 2 15:10:07 CEST 2018
2 From: Juergen Gross <jgross@suse.com>
3 Date: Wed, 30 May 2018 13:09:57 +0200
4 Subject: xen: set cpu capabilities from xen_start_kernel()
5 To: stable@vger.kernel.org, xen-devel@lists.xenproject.org
6 Cc: dwmw@amazon.co.uk, boris.ostrovsky@oracle.com, Juergen Gross <jgross@suse.com>
7 Message-ID: <20180530110958.19413-3-jgross@suse.com>
8
9 From: Juergen Gross <jgross@suse.com>
10
11 Upstream commit: 0808e80cb760de2733c0527d2090ed2205a1eef8 ("xen: set
12 cpu capabilities from xen_start_kernel()")
13
14 There is no need to set the same capabilities for each cpu
15 individually. This can easily be done for all cpus when starting the
16 kernel.
17
18 Signed-off-by: Juergen Gross <jgross@suse.com>
19 Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 ---
22 arch/x86/xen/enlighten.c | 18 +++++++++---------
23 1 file changed, 9 insertions(+), 9 deletions(-)
24
25 --- a/arch/x86/xen/enlighten.c
26 +++ b/arch/x86/xen/enlighten.c
27 @@ -472,6 +472,14 @@ static void __init xen_init_cpuid_mask(v
28 cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
29 }
30
31 +static void __init xen_init_capabilities(void)
32 +{
33 + if (xen_pv_domain()) {
34 + setup_clear_cpu_cap(X86_BUG_SYSRET_SS_ATTRS);
35 + setup_force_cpu_cap(X86_FEATURE_XENPV);
36 + }
37 +}
38 +
39 static void xen_set_debugreg(int reg, unsigned long val)
40 {
41 HYPERVISOR_set_debugreg(reg, val);
42 @@ -1634,6 +1642,7 @@ asmlinkage __visible void __init xen_sta
43
44 xen_init_irq_ops();
45 xen_init_cpuid_mask();
46 + xen_init_capabilities();
47
48 #ifdef CONFIG_X86_LOCAL_APIC
49 /*
50 @@ -1978,14 +1987,6 @@ bool xen_hvm_need_lapic(void)
51 }
52 EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);
53
54 -static void xen_set_cpu_features(struct cpuinfo_x86 *c)
55 -{
56 - if (xen_pv_domain()) {
57 - clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
58 - set_cpu_cap(c, X86_FEATURE_XENPV);
59 - }
60 -}
61 -
62 static void xen_pin_vcpu(int cpu)
63 {
64 static bool disable_pinning;
65 @@ -2032,7 +2033,6 @@ const struct hypervisor_x86 x86_hyper_xe
66 .init_platform = xen_hvm_guest_init,
67 #endif
68 .x2apic_available = xen_x2apic_para_available,
69 - .set_cpu_features = xen_set_cpu_features,
70 .pin_vcpu = xen_pin_vcpu,
71 };
72 EXPORT_SYMBOL(x86_hyper_xen);