Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3647267ybd; Tue, 25 Jun 2019 06:15:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgcbGvEEtWDmPWPC8cRz593jtdMSIn5ChRV1Fbj4yWQZMraxTrjBg62o3RdxHdrT09a62R X-Received: by 2002:a63:fb4b:: with SMTP id w11mr38574641pgj.415.1561468556069; Tue, 25 Jun 2019 06:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561468556; cv=none; d=google.com; s=arc-20160816; b=PtIAwyxt94OnIWI44/RQOmjdMo0iDfhhxREgAEMn/NC4q4I2h1DqAZXSy/gZfUf6ks /B8sHtFVlTWh5YguJRq9cZ/2KMTyem3flg9gnzCIDy/9NdGSoNlQHATrhKmtVTrfmUod PdggZ/baBTu7jcdZM/1QcfZC/KJsIuAJOAJl/x1hn3MTmGXwHWKN4h3l7/lMlfebuW7k e2yuUITlvvit201QfvzuM6c/ls5Og639GES5YhGZIz4JYxZeUh29TcoXodNbo2xkre2K GPLlEWw2e8VtDELOzOwETyzkdtwB22CGix+LRzKRfitH5LW8ReQZODSUpIhCG0rTYiaK lygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=EMb96t5WuJs0JYsPKdZC7E6ogPsiS0s7Bn+LAKFUFOo=; b=OflA9//I+M8w/tVm+DD1D9zTc7S4DxX8KdWlOEeAIl9MH5dW93X9GwBKtvmoPYF0TT OjOKmdkuxlRBsEaXi2qpcyZuBz/8pTiuF73FU6+U6faom+W7xUWvBzpen1pE0YhPmo4U WqgZm0bi8uylkcqVIQ2WP/zVXnJiow7V7g+WmF5R6GsSI7tNOgqIAKnb7MqRBSA7Cuw7 SnLcHEdcqHCuzC3uME3a++dSD6k2wbNNwW9diNwKhVyDo602s8c/fplA0srQuxMr90YV vFIN0IbTKjSxX6vwCf89FzA7rB8wVFjKfnLyJSQqlzo5ALOYKcpVOcpucGmnm85/5LHD W+xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=RkcP6ugO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a69si330375pla.178.2019.06.25.06.15.40; Tue, 25 Jun 2019 06:15:56 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=RkcP6ugO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732486AbfFYMBB (ORCPT + 99 others); Tue, 25 Jun 2019 08:01:01 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:39112 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728365AbfFYMBA (ORCPT ); Tue, 25 Jun 2019 08:01:00 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5PBwX7f034947; Tue, 25 Jun 2019 12:00:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=EMb96t5WuJs0JYsPKdZC7E6ogPsiS0s7Bn+LAKFUFOo=; b=RkcP6ugO5B/V6L4Gii2r0I1mE75z/MSvzTdT69uvlEwGcewX/RDt5usbISd03uSsM8z8 LrRqJEVtJTtndV+h46oiYyCeE8gLWfDjydbFTwxYLN/FDRTn0H2XHq+CLsiezo/2ffIu OXpBGcXKwaHA0iwZv+BwN2kOzTv7bHL5XlxzVRpSFn81vZP3PZmKkadbWn4VYeLc8Mso sM5H+qKQMczF0szdapkQMXBk/VLpj4i8hPpR4QQ7rBT2RecLun4/KMyEl70HpM/lrl3r kMdRJjSrh2W7cirJenv4USgSjdNCt8kGheEjYnt739I26wPeJfvc88WgHAbf9a3WpfTh Aw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2t9cyqbuda-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2019 12:00:14 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5PBxTGE065052; Tue, 25 Jun 2019 12:00:14 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2t9acc2gty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2019 12:00:13 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5PC0Cwn012306; Tue, 25 Jun 2019 12:00:12 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Jun 2019 05:00:11 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, hpa@zytor.com, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, peterz@infradead.org, srinivas.eeda@oracle.com, Zhenzhong Duan , Waiman Long , Ingo Molnar , Dou Liyang Subject: [PATCH v2 7/7] Revert "x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized" Date: Mon, 24 Jun 2019 20:02:59 +0800 Message-Id: <1561377779-28036-8-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561377779-28036-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561377779-28036-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9298 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906250097 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9298 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906250097 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit ca5d376e17072c1b60c3fee66f3be58ef018952d. Commit 8990cac6e5ea ("x86/jump_label: Initialize static branching early") adds jump_label_init() call in setup_arch() to make static keys initialized early, so we could use the original simpler code again. Signed-off-by: Zhenzhong Duan Cc: Waiman Long Cc: Peter Zijlstra (Intel) Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Dou Liyang --- arch/x86/kernel/smpboot.c | 3 +-- arch/x86/xen/spinlock.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 362dd89..44472ca 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1308,8 +1308,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) pr_info("CPU0: "); print_cpu_info(&cpu_data(0)); - native_pv_lock_init(); - uv_system_init(); set_mtrr_aps_delayed_init(); @@ -1339,6 +1337,7 @@ void __init native_smp_prepare_boot_cpu(void) /* already set me in cpu_online_mask in boot_cpu_init() */ cpumask_set_cpu(me, cpu_callout_mask); cpu_set_state_online(me); + native_pv_lock_init(); } void __init calculate_max_logical_packages(void) diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 3776122..6deb490 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -68,11 +68,8 @@ void xen_init_lock_cpu(int cpu) int irq; char *name; - if (!xen_pvspin) { - if (cpu == 0) - static_branch_disable(&virt_spin_lock_key); + if (!xen_pvspin) return; - } WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n", cpu, per_cpu(lock_kicker_irq, cpu)); @@ -124,6 +121,7 @@ void __init xen_init_spinlocks(void) if (!xen_pvspin) { printk(KERN_DEBUG "xen: PV spinlocks disabled\n"); + static_branch_disable(&virt_spin_lock_key); return; } printk(KERN_DEBUG "xen: PV spinlocks enabled\n"); -- 1.8.3.1