Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5762686imm; Mon, 23 Jul 2018 05:46:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfLOUHkBvkwI8E0mwBmPQQUhxRZhyx+7ZyOWV7lc7LWoQnjoUT+hmTAwsOvcee+jRsw2no7 X-Received: by 2002:a63:4f63:: with SMTP id p35-v6mr12164589pgl.167.1532349979276; Mon, 23 Jul 2018 05:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532349979; cv=none; d=google.com; s=arc-20160816; b=OrBLwDFuJJwi1XL8Ybrh7x1PJpZoSctJtrKp8kfc8rzQXbC0vpovks7ONPgqg/jAOY BhZuhrkC/vZCugxHFM/mgK2ZA1OqfTFIM41x2m+aEYj9m11UTTobQhOZqC6nGJUc3WN5 Z1ItoIvHfAUBA3uT5JFZmeNRmTYLFXq507y3ZIt6GKf8xT49Cqjly5fyJFrXXScCyGw9 PstR2oKSB7jjR6eKiiU+BkFVyTq9N91V0gsVt1TGdnbzWEasNJJdDUAvhU2VWw39TxXd fgq+P/+7xRtsV47Z0AIUlNAD3nbMwA+mOIr8qFU1+kFXNKGmVxcUdt/IKCztSwPvj1+f +0lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=obWUaorxo0T6pB7vVekvB0uOJmNo07+p+Wy1zQUJMno=; b=bA727ByrnhgdpE5K1nNeCNHv7DVMp+AaFStXXfqWDdlVDld1vyde68SEo6XVrkwRwr rIRiHDq4OAP+iKmceE+bL5jXDoS9G16Bp+LUBr/KInCGfhETMmqYqtdtgk2jecspdwjg tttNwp/H1ZccwZBXHniP8CKfZJ2NYjKCqS1f4NKjcvttDHDjMiM+IY4vnY1j9a4a/uQs xQ7ntjlxxymSSBgrkSn1ioWdZ3AG1m6+irPtU20F7DNdxlEObx9jPVudJ8+OdE3zU9Cl jhqiu3Oftbn//TfOlbVnYR5Xs+oRvBohQwsTgz8sDbJ/xLNiz1cQZJFJeTksG/xavlPF seWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1-v6si8523051pgg.643.2018.07.23.05.46.04; Mon, 23 Jul 2018 05:46:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388416AbeGWNpy (ORCPT + 99 others); Mon, 23 Jul 2018 09:45:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49768 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388102AbeGWNpy (ORCPT ); Mon, 23 Jul 2018 09:45:54 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E9F07CAB; Mon, 23 Jul 2018 12:44:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Boris Ostrovsky , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 046/107] xen: set cpu capabilities from xen_start_kernel() Date: Mon, 23 Jul 2018 14:41:40 +0200 Message-Id: <20180723122415.189796152@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Juergen Gross Upstream commit: 0808e80cb760de2733c0527d2090ed2205a1eef8 ("xen: set cpu capabilities from xen_start_kernel()") There is no need to set the same capabilities for each cpu individually. This can easily be done for all cpus when starting the kernel. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Greg Kroah-Hartman Signed-off-by: Srivatsa S. Bhat Reviewed-by: Matt Helsley (VMware) Reviewed-by: Alexey Makhalov Reviewed-by: Bo Gan Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/enlighten.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -460,6 +460,14 @@ static void __init xen_init_cpuid_mask(v cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32)); } +static void __init xen_init_capabilities(void) +{ + if (xen_pv_domain()) { + setup_clear_cpu_cap(X86_BUG_SYSRET_SS_ATTRS); + setup_force_cpu_cap(X86_FEATURE_XENPV); + } +} + static void xen_set_debugreg(int reg, unsigned long val) { HYPERVISOR_set_debugreg(reg, val); @@ -1587,6 +1595,7 @@ asmlinkage __visible void __init xen_sta xen_init_irq_ops(); xen_init_cpuid_mask(); + xen_init_capabilities(); #ifdef CONFIG_X86_LOCAL_APIC /* @@ -1883,14 +1892,6 @@ bool xen_hvm_need_lapic(void) } EXPORT_SYMBOL_GPL(xen_hvm_need_lapic); -static void xen_set_cpu_features(struct cpuinfo_x86 *c) -{ - if (xen_pv_domain()) { - clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS); - set_cpu_cap(c, X86_FEATURE_XENPV); - } -} - const struct hypervisor_x86 x86_hyper_xen = { .name = "Xen", .detect = xen_platform, @@ -1898,7 +1899,6 @@ const struct hypervisor_x86 x86_hyper_xe .init_platform = xen_hvm_guest_init, #endif .x2apic_available = xen_x2apic_para_available, - .set_cpu_features = xen_set_cpu_features, }; EXPORT_SYMBOL(x86_hyper_xen);