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>
9 From: Juergen Gross <jgross@suse.com>
11 Upstream commit: 0808e80cb760de2733c0527d2090ed2205a1eef8 ("xen: set
12 cpu capabilities from xen_start_kernel()")
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
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>
22 arch/x86/xen/enlighten.c | 18 +++++++++---------
23 1 file changed, 9 insertions(+), 9 deletions(-)
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));
31 +static void __init xen_init_capabilities(void)
33 + if (xen_pv_domain()) {
34 + setup_clear_cpu_cap(X86_BUG_SYSRET_SS_ATTRS);
35 + setup_force_cpu_cap(X86_FEATURE_XENPV);
39 static void xen_set_debugreg(int reg, unsigned long val)
41 HYPERVISOR_set_debugreg(reg, val);
42 @@ -1634,6 +1642,7 @@ asmlinkage __visible void __init xen_sta
45 xen_init_cpuid_mask();
46 + xen_init_capabilities();
48 #ifdef CONFIG_X86_LOCAL_APIC
50 @@ -1978,14 +1987,6 @@ bool xen_hvm_need_lapic(void)
52 EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);
54 -static void xen_set_cpu_features(struct cpuinfo_x86 *c)
56 - if (xen_pv_domain()) {
57 - clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
58 - set_cpu_cap(c, X86_FEATURE_XENPV);
62 static void xen_pin_vcpu(int cpu)
64 static bool disable_pinning;
65 @@ -2032,7 +2033,6 @@ const struct hypervisor_x86 x86_hyper_xe
66 .init_platform = xen_hvm_guest_init,
68 .x2apic_available = xen_x2apic_para_available,
69 - .set_cpu_features = xen_set_cpu_features,
70 .pin_vcpu = xen_pin_vcpu,
72 EXPORT_SYMBOL(x86_hyper_xen);