]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
drop __get_cpu_var() and __get_cpu_ptr()
authorJan Beulich <jbeulich@suse.com>
Tue, 25 Jun 2019 15:34:53 +0000 (17:34 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 25 Jun 2019 15:34:53 +0000 (17:34 +0200)
this_cpu{,_ptr}() are shorter, and have previously been marked as
preferred in Xen anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/rcupdate.c
xen/include/asm-arm/percpu.h
xen/include/asm-x86/percpu.h
xen/include/xen/percpu.h
xen/xsm/flask/avc.c

index 3517790913976c857dbcb2146d1b2d96f41634af..a56103c6f799f61219073d7aca69b8e9ba59e548 100644 (file)
@@ -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(struct rcu_ctrlblk *rcp,
 
 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)
index 6263e772512947067fbcd717ecd0d279811c7eab..9584b830d4ebcb7aec3e40d25c24065be7c8c624 100644 (file)
@@ -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
index 51562b97a45a992e93da1e39cfc7afa369b69db1..ff34dc78970abed169e472c50430fd81271da8a4 100644 (file)
@@ -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)  \
index c89686399a0d13a64e209260328a47dbf358a588..aeec5c19d66d5d9cbeffcb86b7b7b382c67f149e 100644 (file)
 #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. */
index 640c708659b00888c863bf54b17d7fa162926d8c..87ea38b7a0d02c6ce6ae3d9d61c442e3fb22fabd 100644 (file)
@@ -57,9 +57,9 @@ const struct selinux_class_perm selinux_class_perm = {
 #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)