Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1809719ybd; Thu, 27 Jun 2019 01:54:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx00tr2sIByPnVEWaHribAwE6sTE3ANZJNc9J3erqPli3yB1skD543wWSRlkOPVrj/NqzYe X-Received: by 2002:a17:902:a03:: with SMTP id 3mr3292458plo.302.1561625692421; Thu, 27 Jun 2019 01:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561625692; cv=none; d=google.com; s=arc-20160816; b=B6ng52vfZQOH65MLWCMc/r3PekSA5TiiH2Blq1qM5VxgWUSme49e3lRAYYyr+Am+lV QLrNQKnHSh1suE0t+x+++gNniONoCbm24kCQD/2DpKaQ4WYZZ9ON4i6P2e4fss+4Pkgx GSNOJfD/Dbq9v935TPuEWgGDXO2PKZKSvdkf7ufJJGtk7t0degINV3UUSVIM3Si2EBkx GQLWW7fH9LvpLgjbNT/0JNXM1TzaG85XTpq7CLi+T1GVty2jZJdLg0jnyorzTCZEhi6v ve4MwY+w/1RPP3kWutCr+m4Mq7g8Q64FYhsFrJ14/0NdhMx7E4NB3SzWeGCZ+OjYCZ0u yt0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=EMb96t5WuJs0JYsPKdZC7E6ogPsiS0s7Bn+LAKFUFOo=; b=e+Y4YbBdTUVV1z5iCXgsIONKCJX3IrBoqxpRlwKu2k0xscpzVDYQvxhigT0T1YPdBD tlXhlF77/WjMA1k7B0zBo6oj9qLezRRiKrbDSfttdYjARUQeLUMkeJozUlgCCk+yAA5N Zg2gvin3P1aEiL+15bbnql4gnESYoqUWhVDvCR4jzrdl0sswwByK/u2zl1SzcdrXBfhS UGXlLs153cjNWoIDW73WRzDUNi1xLctp1H9ai5Z0+U2TUaOIWjxmaStlziqH1A3rHpr5 yGxOS+HkWnwwEVx8k9eDxEFFN6bCAD1a9eN5JFuGuHK4kCXve1L9L+5qwfqiaFbpo48e q1Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=FF2L+m+K; 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 h17si1602108pgi.547.2019.06.27.01.54.36; Thu, 27 Jun 2019 01:54:52 -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=FF2L+m+K; 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 S1726464AbfF0IyR (ORCPT + 99 others); Thu, 27 Jun 2019 04:54:17 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47820 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfF0IyR (ORCPT ); Thu, 27 Jun 2019 04:54:17 -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 x5R8mfOr141100; Thu, 27 Jun 2019 08:53:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=EMb96t5WuJs0JYsPKdZC7E6ogPsiS0s7Bn+LAKFUFOo=; b=FF2L+m+K5Ji4zVUmZuucZdiFQjUT6fMfY6bp7vknOnFl3V02rY9Iw1eZUPyG24ChVcqg GVxKmMGRgK2PIrSqWN7ZyeAgcVstGJ2OyuqaVx4BasSnCY5lu2s0f8Tqzkd6Y7u3Vv1l NTlzbmMGsU+oIajtmLhiEOKTB/g1jN3J4fK5+OclENtgu4FtZ2DXR4qNE7VZwxT6EBpc 7wsQGX9SjLV5iu6E70cmcUpieTSljOGGx6sXtc79MBvBttjUWPJsRDWQXzzAtW/CYhym Cxw6FX0AxcAbYiXAkWoFg+5IkfYFADJU4SFSQd2aZdYPnkM6UQe4Lo5ysunMJXhFidLw Fg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2t9cyqpy43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 08:53:35 +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 x5R8rZFD153645; Thu, 27 Jun 2019 08:53:35 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2t9acd4nam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 08:53:34 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5R8rTNX003709; Thu, 27 Jun 2019 08:53:29 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 27 Jun 2019 01:53:28 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: Zhenzhong Duan , Waiman Long , "Peter Zijlstra (Intel)" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Dou Liyang Subject: [PATCH RESEND] Revert "x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized" Date: Wed, 26 Jun 2019 16:57:09 +0800 Message-Id: <1561539429-29436-1-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9300 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-1906270105 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9300 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-1906270104 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