From patchwork Thu Jan 12 20:27:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 9514141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39AB0601E5 for ; Thu, 12 Jan 2017 20:30:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E230286D5 for ; Thu, 12 Jan 2017 20:30:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 200F6286FF; Thu, 12 Jan 2017 20:30:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E7C5286D5 for ; Thu, 12 Jan 2017 20:30:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRlyo-0007Jf-FG; Thu, 12 Jan 2017 20:28:14 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRlyn-0007JZ-0F for xen-devel@lists.xenproject.org; Thu, 12 Jan 2017 20:28:13 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id A8/B1-20518-BD6E7785; Thu, 12 Jan 2017 20:28:11 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRWlGSWpSXmKPExsVysWW7jO7tZ+U RBj2XuC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ow5R6+yFKyQqOh6cpepgbFLtIuRi0NIYDeT xOl7LYwQzkFGiXmX7rN1MXJysAmoSfy51ckKkhARmMko8XbPFxYQh1ngAYvEn0u9TCBVwgL+E vM7FgB1cHCwCKhKfNmvABLmFXCUWPm8E2yQhIC2RMOsyWC9EgJ9jBLLH7UxT2DkWsDIsIpRoz i1qCy1SNfQWC+pKDM9oyQ3MTNH19DAWC83tbg4MT01JzGpWC85P3cTI9CbDECwg3Hbds9DjJI cTEqivDJbyiOE+JLyUyozEosz4otKc1KLDzHKcHAoSfC2PQXKCRalpqdWpGXmAMMKJi3BwaMk wlsJkuYtLkjMLc5Mh0idYlSUEud1AkkIgCQySvPg2mChfIlRVkqYlxHoECGegtSi3MwSVPlXj OIcjErCvFtBpvBk5pXATX8FtJgJaPFFG7DFJYkIKakGxppXDYmaRu++hsZ5LvyQ01xmfND3hu T71lNvk2bfkVa9P7P09PPKNRvnpMVdfLtb7k7vrdpt8x+Jc9Ww5WftLAt9JuTwLeyd75uZ3/N KT0WGtuypuKPhVMEowf28rfefU+PDtz5rwxzZi3Nj3lYuXmRTbrNpFc/BrI1zxe+3/5n2f1Xr vIv/TiqxFGckGmoxFxUnAgAUrwatYAIAAA== X-Env-Sender: longman@redhat.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1484252889!79673322!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42323 invoked from network); 12 Jan 2017 20:28:10 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-13.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Jan 2017 20:28:10 -0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A29C6DD95; Thu, 12 Jan 2017 20:28:08 +0000 (UTC) Received: from llong.com (dhcp-17-128.bos.redhat.com [10.18.17.128]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0CKS5Va015895; Thu, 12 Jan 2017 15:28:06 -0500 From: Waiman Long To: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" Date: Thu, 12 Jan 2017 15:27:58 -0500 Message-Id: <1484252878-1962-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 12 Jan 2017 20:28:10 +0000 (UTC) Cc: linux-arch@vger.kernel.org, Juergen Gross , Jeremy Fitzhardinge , Rusty Russell , kvm@vger.kernel.org, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Chris Wright , Waiman Long , Paolo Bonzini , xen-devel@lists.xenproject.org, Alok Kataria , Boris Ostrovsky Subject: [Xen-devel] [PATCH v2] x86, locking/spinlocks: Remove paravirt_ticketlocks_enabled X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is a follow-up of commit cfd8983f03c7b2 ("x86, locking/spinlocks: Remove ticket (spin)lock implementation"). The static_key structure paravirt_ticketlocks_enabled is now removed as it is no longer used. As a result, the init functions kvm_spinlock_init_jump() and xen_init_spinlocks_jump() are also removed. A simple build and boot test was done to verify it. Signed-off-by: Waiman Long Reviewed-by: Boris Ostrovsky --- v1->v2: - Remove init functions kvm_spinlock_init_jump() and xen_init_spinlocks_jump(). arch/x86/include/asm/spinlock.h | 3 --- arch/x86/kernel/kvm.c | 14 -------------- arch/x86/kernel/paravirt-spinlocks.c | 3 --- arch/x86/xen/spinlock.c | 19 ------------------- 4 files changed, 39 deletions(-) diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 921bea7..6d39190 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -23,9 +23,6 @@ /* How long a lock should spin before we consider blocking */ #define SPIN_THRESHOLD (1 << 15) -extern struct static_key paravirt_ticketlocks_enabled; -static __always_inline bool static_key_false(struct static_key *key); - #include /* diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 36bc664..099fcba 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -620,18 +620,4 @@ void __init kvm_spinlock_init(void) } } -static __init int kvm_spinlock_init_jump(void) -{ - if (!kvm_para_available()) - return 0; - if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) - return 0; - - static_key_slow_inc(¶virt_ticketlocks_enabled); - printk(KERN_INFO "KVM setup paravirtual spinlock\n"); - - return 0; -} -early_initcall(kvm_spinlock_init_jump); - #endif /* CONFIG_PARAVIRT_SPINLOCKS */ diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c index 6d4bf81..6259327 100644 --- a/arch/x86/kernel/paravirt-spinlocks.c +++ b/arch/x86/kernel/paravirt-spinlocks.c @@ -42,6 +42,3 @@ struct pv_lock_ops pv_lock_ops = { #endif /* SMP */ }; EXPORT_SYMBOL(pv_lock_ops); - -struct static_key paravirt_ticketlocks_enabled = STATIC_KEY_INIT_FALSE; -EXPORT_SYMBOL(paravirt_ticketlocks_enabled); diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index e8a9ea7..25a7c43 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -141,25 +141,6 @@ void __init xen_init_spinlocks(void) pv_lock_ops.vcpu_is_preempted = PV_CALLEE_SAVE(xen_vcpu_stolen); } -/* - * While the jump_label init code needs to happend _after_ the jump labels are - * enabled and before SMP is started. Hence we use pre-SMP initcall level - * init. We cannot do it in xen_init_spinlocks as that is done before - * jump labels are activated. - */ -static __init int xen_init_spinlocks_jump(void) -{ - if (!xen_pvspin) - return 0; - - if (!xen_domain()) - return 0; - - static_key_slow_inc(¶virt_ticketlocks_enabled); - return 0; -} -early_initcall(xen_init_spinlocks_jump); - static __init int xen_parse_nopvspin(char *arg) { xen_pvspin = false;