From patchwork Fri Jun 14 15:38:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10995861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6A2A76 for ; Fri, 14 Jun 2019 15:40:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6E2227CEA for ; Fri, 14 Jun 2019 15:40:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB5D727F89; Fri, 14 Jun 2019 15:40:24 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55DF827CEA for ; Fri, 14 Jun 2019 15:40:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hboI9-0006kp-6X; Fri, 14 Jun 2019 15:39:01 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hboI7-0006ke-HY for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 15:38:59 +0000 X-Inumbo-ID: 865f6484-8eba-11e9-8980-bc764e045a96 Received: from prv1-mh.provo.novell.com (unknown [137.65.248.33]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 865f6484-8eba-11e9-8980-bc764e045a96; Fri, 14 Jun 2019 15:38:58 +0000 (UTC) Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Fri, 14 Jun 2019 09:38:57 -0600 Message-Id: <5D03BF8E020000780023861C@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.1 Date: Fri, 14 Jun 2019 09:38:54 -0600 From: "Jan Beulich" To: "xen-devel" References: <5D03BE5102000078002385FE@prv1-mh.provo.novell.com> In-Reply-To: <5D03BE5102000078002385FE@prv1-mh.provo.novell.com> Mime-Version: 1.0 Content-Disposition: inline Subject: [Xen-devel] [PATCH 4/4] drop __get_cpu_var() and __get_cpu_ptr() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Daniel de Graaf , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP this_cpu{,_ptr}() are shorter, and have previously been marked as preferred in Xen anyway. Signed-off-by: Jan Beulich Acked-by: Julien Grall Acked-by: Daniel De Graaf Reviewed-by: Andrew Cooper --- a/xen/common/rcupdate.c +++ b/xen/common/rcupdate.c @@ -225,7 +225,7 @@ void call_rcu(struct rcu_head *head, head->func = func; head->next = NULL; local_irq_save(flags); - rdp = &__get_cpu_var(rcu_data); + rdp = &this_cpu(rcu_data); *rdp->nxttail = head; rdp->nxttail = &head->next; if (unlikely(++rdp->qlen > qhimark)) { @@ -409,7 +409,7 @@ static void __rcu_process_callbacks(stru static void rcu_process_callbacks(void) { - __rcu_process_callbacks(&rcu_ctrlblk, &__get_cpu_var(rcu_data)); + __rcu_process_callbacks(&rcu_ctrlblk, &this_cpu(rcu_data)); } static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp) --- a/xen/include/asm-arm/percpu.h +++ b/xen/include/asm-arm/percpu.h @@ -17,12 +17,12 @@ void percpu_init_areas(void); #define per_cpu(var, cpu) \ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -#define __get_cpu_var(var) \ +#define this_cpu(var) \ (*RELOC_HIDE(&per_cpu__##var, READ_SYSREG(TPIDR_EL2))) #define per_cpu_ptr(var, cpu) \ (*RELOC_HIDE(var, __per_cpu_offset[cpu])) -#define __get_cpu_ptr(var) \ +#define this_cpu_ptr(var) \ (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2))) #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name --- a/xen/include/asm-x86/percpu.h +++ b/xen/include/asm-x86/percpu.h @@ -15,12 +15,12 @@ void percpu_init_areas(void); /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) \ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -#define __get_cpu_var(var) \ +#define this_cpu(var) \ (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset)) #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name -#define __get_cpu_ptr(var) \ +#define this_cpu_ptr(var) \ (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset)) #define per_cpu_ptr(var, cpu) \ --- a/xen/include/xen/percpu.h +++ b/xen/include/xen/percpu.h @@ -13,11 +13,6 @@ #define DEFINE_PER_CPU_READ_MOSTLY(type, name) \ __DEFINE_PER_CPU(type, _##name, .read_mostly) -/* Preferred on Xen. Also see arch-defined per_cpu(). */ -#define this_cpu(var) __get_cpu_var(var) - -#define this_cpu_ptr(ptr) __get_cpu_ptr(ptr) - #define get_per_cpu_var(var) (per_cpu__##var) /* Linux compatibility. */ --- a/xen/xsm/flask/avc.c +++ b/xen/xsm/flask/avc.c @@ -57,9 +57,9 @@ const struct selinux_class_perm selinux_ #define AVC_CACHE_RECLAIM 16 #ifdef CONFIG_XSM_FLASK_AVC_STATS -#define avc_cache_stats_incr(field) \ -do { \ - __get_cpu_var(avc_cache_stats).field++; \ +#define avc_cache_stats_incr(field) \ +do { \ + this_cpu(avc_cache_stats).field++; \ } while (0) #else #define avc_cache_stats_incr(field) do {} while (0)