Re: [PATCH v2 bpf-next 03/14] bpf: pass a pointer to a cgroup storage using pcpu variable

From: kbuild test robot
Date: Fri Jul 06 2018 - 05:26:12 EST


Hi Roman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url: https://github.com/0day-ci/linux/commits/Roman-Gushchin/bpf-cgroup-local-storage/20180706-055938
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: um-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=um

All error/warnings (new ones prefixed by >>):

In file included from include/linux/bpf-cgroup.h:6:0,
from kernel/bpf/local_storage.c:2:
>> include/linux/percpu-defs.h:49:34: error: 'PER_CPU_BASE_SECTION' undeclared here (not in a function); did you mean 'PER_CPU_FIRST_SECTION'?
__percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \
^
>> include/linux/percpu-defs.h:87:9: note: in expansion of macro '__PCPU_ATTRS'
extern __PCPU_ATTRS(sec) __typeof__(type) name
^~~~~~~~~~~~
include/linux/percpu-defs.h:113:2: note: in expansion of macro 'DECLARE_PER_CPU_SECTION'
DECLARE_PER_CPU_SECTION(type, name, "")
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bpf-cgroup.h:24:1: note: in expansion of macro 'DECLARE_PER_CPU'
DECLARE_PER_CPU(void*, bpf_cgroup_storage);
^~~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:113:38: error: expected ')' before string constant
DECLARE_PER_CPU_SECTION(type, name, "")
^
include/linux/percpu-defs.h:49:55: note: in definition of macro '__PCPU_ATTRS'
__percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \
^~~
include/linux/percpu-defs.h:113:2: note: in expansion of macro 'DECLARE_PER_CPU_SECTION'
DECLARE_PER_CPU_SECTION(type, name, "")
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bpf-cgroup.h:24:1: note: in expansion of macro 'DECLARE_PER_CPU'
DECLARE_PER_CPU(void*, bpf_cgroup_storage);
^~~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:49:59: error: expected identifier or '(' before ')' token
__percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \
^
>> include/linux/percpu-defs.h:87:9: note: in expansion of macro '__PCPU_ATTRS'
extern __PCPU_ATTRS(sec) __typeof__(type) name
^~~~~~~~~~~~
include/linux/percpu-defs.h:113:2: note: in expansion of macro 'DECLARE_PER_CPU_SECTION'
DECLARE_PER_CPU_SECTION(type, name, "")
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bpf-cgroup.h:24:1: note: in expansion of macro 'DECLARE_PER_CPU'
DECLARE_PER_CPU(void*, bpf_cgroup_storage);
^~~~~~~~~~~~~~~
include/linux/bpf-cgroup.h: In function 'bpf_cgroup_storage_set':
include/linux/bpf-cgroup.h:110:17: error: 'bpf_cgroup_storage' undeclared (first use in this function)
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^
include/linux/percpu-defs.h:221:47: note: in definition of macro '__verify_pcpu_ptr'
const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
^~~
include/linux/percpu-defs.h:510:34: note: in expansion of macro '__pcpu_size_call'
#define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val)
^~~~~~~~~~~~~~~~
include/linux/bpf-cgroup.h:110:2: note: in expansion of macro 'this_cpu_write'
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^~~~~~~~~~~~~~
include/linux/bpf-cgroup.h:110:17: note: each undeclared identifier is reported only once for each function it appears in
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^
include/linux/percpu-defs.h:221:47: note: in definition of macro '__verify_pcpu_ptr'
const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
^~~
include/linux/percpu-defs.h:510:34: note: in expansion of macro '__pcpu_size_call'
#define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val)
^~~~~~~~~~~~~~~~
include/linux/bpf-cgroup.h:110:2: note: in expansion of macro 'this_cpu_write'
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:510:51: error: implicit declaration of function 'this_cpu_write_1'; did you mean 'this_cpu_write'? [-Werror=implicit-function-declaration]
#define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val)
^
include/linux/percpu-defs.h:379:11: note: in definition of macro '__pcpu_size_call'
case 1: stem##1(variable, __VA_ARGS__);break; \
^~~~
include/linux/bpf-cgroup.h:110:2: note: in expansion of macro 'this_cpu_write'
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:510:51: error: implicit declaration of function 'this_cpu_write_2'; did you mean 'this_cpu_write'? [-Werror=implicit-function-declaration]
#define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val)
^
include/linux/percpu-defs.h:380:11: note: in definition of macro '__pcpu_size_call'
case 2: stem##2(variable, __VA_ARGS__);break; \
^~~~
include/linux/bpf-cgroup.h:110:2: note: in expansion of macro 'this_cpu_write'
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:510:51: error: implicit declaration of function 'this_cpu_write_4'; did you mean 'this_cpu_write'? [-Werror=implicit-function-declaration]
#define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val)
^
include/linux/percpu-defs.h:381:11: note: in definition of macro '__pcpu_size_call'
case 4: stem##4(variable, __VA_ARGS__);break; \
^~~~
include/linux/bpf-cgroup.h:110:2: note: in expansion of macro 'this_cpu_write'
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^~~~~~~~~~~~~~
>> include/linux/percpu-defs.h:510:51: error: implicit declaration of function 'this_cpu_write_8'; did you mean 'this_cpu_write'? [-Werror=implicit-function-declaration]
#define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val)
^
include/linux/percpu-defs.h:382:11: note: in definition of macro '__pcpu_size_call'
case 8: stem##8(variable, __VA_ARGS__);break; \
^~~~
include/linux/bpf-cgroup.h:110:2: note: in expansion of macro 'this_cpu_write'
this_cpu_write(bpf_cgroup_storage, &buf->data[0]);
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +49 include/linux/percpu-defs.h

62fde54123 Tejun Heo 2014-06-17 37
5028eaa97d David Howells 2009-04-21 38 /*
5028eaa97d David Howells 2009-04-21 39 * Base implementations of per-CPU variable declarations and definitions, where
5028eaa97d David Howells 2009-04-21 40 * the section in which the variable is to be placed is provided by the
7c756e6e19 Tejun Heo 2009-06-24 41 * 'sec' argument. This may be used to affect the parameters governing the
5028eaa97d David Howells 2009-04-21 42 * variable's storage.
5028eaa97d David Howells 2009-04-21 43 *
5028eaa97d David Howells 2009-04-21 44 * NOTE! The sections for the DECLARE and for the DEFINE must match, lest
5028eaa97d David Howells 2009-04-21 45 * linkage errors occur due the compiler generating the wrong code to access
5028eaa97d David Howells 2009-04-21 46 * that section.
5028eaa97d David Howells 2009-04-21 47 */
7c756e6e19 Tejun Heo 2009-06-24 48 #define __PCPU_ATTRS(sec) \
e0fdb0e050 Rusty Russell 2009-10-29 @49 __percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \
7c756e6e19 Tejun Heo 2009-06-24 50 PER_CPU_ATTRIBUTES
7c756e6e19 Tejun Heo 2009-06-24 51
7c756e6e19 Tejun Heo 2009-06-24 52 #define __PCPU_DUMMY_ATTRS \
7c756e6e19 Tejun Heo 2009-06-24 53 __attribute__((section(".discard"), unused))
7c756e6e19 Tejun Heo 2009-06-24 54
7c756e6e19 Tejun Heo 2009-06-24 55 /*
7c756e6e19 Tejun Heo 2009-06-24 56 * s390 and alpha modules require percpu variables to be defined as
7c756e6e19 Tejun Heo 2009-06-24 57 * weak to force the compiler to generate GOT based external
7c756e6e19 Tejun Heo 2009-06-24 58 * references for them. This is necessary because percpu sections
7c756e6e19 Tejun Heo 2009-06-24 59 * will be located outside of the usually addressable area.
7c756e6e19 Tejun Heo 2009-06-24 60 *
7c756e6e19 Tejun Heo 2009-06-24 61 * This definition puts the following two extra restrictions when
7c756e6e19 Tejun Heo 2009-06-24 62 * defining percpu variables.
7c756e6e19 Tejun Heo 2009-06-24 63 *
7c756e6e19 Tejun Heo 2009-06-24 64 * 1. The symbol must be globally unique, even the static ones.
7c756e6e19 Tejun Heo 2009-06-24 65 * 2. Static percpu variables cannot be defined inside a function.
7c756e6e19 Tejun Heo 2009-06-24 66 *
7c756e6e19 Tejun Heo 2009-06-24 67 * Archs which need weak percpu definitions should define
7c756e6e19 Tejun Heo 2009-06-24 68 * ARCH_NEEDS_WEAK_PER_CPU in asm/percpu.h when necessary.
7c756e6e19 Tejun Heo 2009-06-24 69 *
7c756e6e19 Tejun Heo 2009-06-24 70 * To ensure that the generic code observes the above two
7c756e6e19 Tejun Heo 2009-06-24 71 * restrictions, if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is set weak
7c756e6e19 Tejun Heo 2009-06-24 72 * definition is used for all cases.
7c756e6e19 Tejun Heo 2009-06-24 73 */
7c756e6e19 Tejun Heo 2009-06-24 74 #if defined(ARCH_NEEDS_WEAK_PER_CPU) || defined(CONFIG_DEBUG_FORCE_WEAK_PER_CPU)
7c756e6e19 Tejun Heo 2009-06-24 75 /*
7c756e6e19 Tejun Heo 2009-06-24 76 * __pcpu_scope_* dummy variable is used to enforce scope. It
7c756e6e19 Tejun Heo 2009-06-24 77 * receives the static modifier when it's used in front of
7c756e6e19 Tejun Heo 2009-06-24 78 * DEFINE_PER_CPU() and will trigger build failure if
7c756e6e19 Tejun Heo 2009-06-24 79 * DECLARE_PER_CPU() is used for the same variable.
7c756e6e19 Tejun Heo 2009-06-24 80 *
7c756e6e19 Tejun Heo 2009-06-24 81 * __pcpu_unique_* dummy variable is used to enforce symbol uniqueness
7c756e6e19 Tejun Heo 2009-06-24 82 * such that hidden weak symbol collision, which will cause unrelated
7c756e6e19 Tejun Heo 2009-06-24 83 * variables to share the same address, can be detected during build.
7c756e6e19 Tejun Heo 2009-06-24 84 */
7c756e6e19 Tejun Heo 2009-06-24 85 #define DECLARE_PER_CPU_SECTION(type, name, sec) \
7c756e6e19 Tejun Heo 2009-06-24 86 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
dd17c8f729 Rusty Russell 2009-10-29 @87 extern __PCPU_ATTRS(sec) __typeof__(type) name
7c756e6e19 Tejun Heo 2009-06-24 88
7c756e6e19 Tejun Heo 2009-06-24 89 #define DEFINE_PER_CPU_SECTION(type, name, sec) \
7c756e6e19 Tejun Heo 2009-06-24 90 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
0f5e4816db Tejun Heo 2009-10-29 91 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
7c756e6e19 Tejun Heo 2009-06-24 92 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
b1a0fbfdde Tejun Heo 2013-12-04 93 extern __PCPU_ATTRS(sec) __typeof__(type) name; \
c43768cbb7 Tejun Heo 2009-07-04 94 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
dd17c8f729 Rusty Russell 2009-10-29 95 __typeof__(type) name
7c756e6e19 Tejun Heo 2009-06-24 96 #else
7c756e6e19 Tejun Heo 2009-06-24 97 /*
7c756e6e19 Tejun Heo 2009-06-24 98 * Normal declaration and definition macros.
7c756e6e19 Tejun Heo 2009-06-24 99 */
7c756e6e19 Tejun Heo 2009-06-24 100 #define DECLARE_PER_CPU_SECTION(type, name, sec) \
dd17c8f729 Rusty Russell 2009-10-29 101 extern __PCPU_ATTRS(sec) __typeof__(type) name
7c756e6e19 Tejun Heo 2009-06-24 102
7c756e6e19 Tejun Heo 2009-06-24 103 #define DEFINE_PER_CPU_SECTION(type, name, sec) \
c43768cbb7 Tejun Heo 2009-07-04 104 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \
dd17c8f729 Rusty Russell 2009-10-29 105 __typeof__(type) name
7c756e6e19 Tejun Heo 2009-06-24 106 #endif
5028eaa97d David Howells 2009-04-21 107
5028eaa97d David Howells 2009-04-21 108 /*
5028eaa97d David Howells 2009-04-21 109 * Variant on the per-CPU variable declaration/definition theme used for
5028eaa97d David Howells 2009-04-21 110 * ordinary per-CPU variables.
5028eaa97d David Howells 2009-04-21 111 */
5028eaa97d David Howells 2009-04-21 112 #define DECLARE_PER_CPU(type, name) \
5028eaa97d David Howells 2009-04-21 @113 DECLARE_PER_CPU_SECTION(type, name, "")
5028eaa97d David Howells 2009-04-21 114
5028eaa97d David Howells 2009-04-21 115 #define DEFINE_PER_CPU(type, name) \
5028eaa97d David Howells 2009-04-21 116 DEFINE_PER_CPU_SECTION(type, name, "")
5028eaa97d David Howells 2009-04-21 117
5028eaa97d David Howells 2009-04-21 118 /*
5028eaa97d David Howells 2009-04-21 119 * Declaration/definition used for per-CPU variables that must come first in
5028eaa97d David Howells 2009-04-21 120 * the set of variables.
5028eaa97d David Howells 2009-04-21 121 */
5028eaa97d David Howells 2009-04-21 122 #define DECLARE_PER_CPU_FIRST(type, name) \
5028eaa97d David Howells 2009-04-21 123 DECLARE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION)
5028eaa97d David Howells 2009-04-21 124
5028eaa97d David Howells 2009-04-21 125 #define DEFINE_PER_CPU_FIRST(type, name) \
5028eaa97d David Howells 2009-04-21 126 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION)
5028eaa97d David Howells 2009-04-21 127
5028eaa97d David Howells 2009-04-21 128 /*
5028eaa97d David Howells 2009-04-21 129 * Declaration/definition used for per-CPU variables that must be cacheline
5028eaa97d David Howells 2009-04-21 130 * aligned under SMP conditions so that, whilst a particular instance of the
5028eaa97d David Howells 2009-04-21 131 * data corresponds to a particular CPU, inefficiencies due to direct access by
5028eaa97d David Howells 2009-04-21 132 * other CPUs are reduced by preventing the data from unnecessarily spanning
5028eaa97d David Howells 2009-04-21 133 * cachelines.
5028eaa97d David Howells 2009-04-21 134 *
5028eaa97d David Howells 2009-04-21 135 * An example of this would be statistical data, where each CPU's set of data
5028eaa97d David Howells 2009-04-21 136 * is updated by that CPU alone, but the data from across all CPUs is collated
5028eaa97d David Howells 2009-04-21 137 * by a CPU processing a read from a proc file.
5028eaa97d David Howells 2009-04-21 138 */
5028eaa97d David Howells 2009-04-21 139 #define DECLARE_PER_CPU_SHARED_ALIGNED(type, name) \
5028eaa97d David Howells 2009-04-21 140 DECLARE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
5028eaa97d David Howells 2009-04-21 141 ____cacheline_aligned_in_smp
5028eaa97d David Howells 2009-04-21 142
5028eaa97d David Howells 2009-04-21 143 #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
5028eaa97d David Howells 2009-04-21 144 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
5028eaa97d David Howells 2009-04-21 145 ____cacheline_aligned_in_smp
5028eaa97d David Howells 2009-04-21 146
53f824520b Jeremy Fitzhardinge 2009-09-03 147 #define DECLARE_PER_CPU_ALIGNED(type, name) \
53f824520b Jeremy Fitzhardinge 2009-09-03 148 DECLARE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \
53f824520b Jeremy Fitzhardinge 2009-09-03 149 ____cacheline_aligned
53f824520b Jeremy Fitzhardinge 2009-09-03 150
53f824520b Jeremy Fitzhardinge 2009-09-03 151 #define DEFINE_PER_CPU_ALIGNED(type, name) \
53f824520b Jeremy Fitzhardinge 2009-09-03 152 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \
53f824520b Jeremy Fitzhardinge 2009-09-03 153 ____cacheline_aligned
53f824520b Jeremy Fitzhardinge 2009-09-03 154
5028eaa97d David Howells 2009-04-21 155 /*
5028eaa97d David Howells 2009-04-21 156 * Declaration/definition used for per-CPU variables that must be page aligned.
5028eaa97d David Howells 2009-04-21 157 */
5028eaa97d David Howells 2009-04-21 158 #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \
3d9a854c2d Denys Vlasenko 2010-02-20 159 DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \
3e352aa8ee Tejun Heo 2009-08-03 160 __aligned(PAGE_SIZE)
5028eaa97d David Howells 2009-04-21 161
5028eaa97d David Howells 2009-04-21 162 #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
3d9a854c2d Denys Vlasenko 2010-02-20 163 DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \
3e352aa8ee Tejun Heo 2009-08-03 164 __aligned(PAGE_SIZE)
5028eaa97d David Howells 2009-04-21 165
5028eaa97d David Howells 2009-04-21 166 /*
c957ef2c59 Shaohua Li 2010-10-20 167 * Declaration/definition used for per-CPU variables that must be read mostly.
c957ef2c59 Shaohua Li 2010-10-20 168 */
c957ef2c59 Shaohua Li 2010-10-20 169 #define DECLARE_PER_CPU_READ_MOSTLY(type, name) \
330d282216 Zhengyu He 2014-07-01 170 DECLARE_PER_CPU_SECTION(type, name, "..read_mostly")
c957ef2c59 Shaohua Li 2010-10-20 171
c957ef2c59 Shaohua Li 2010-10-20 172 #define DEFINE_PER_CPU_READ_MOSTLY(type, name) \
330d282216 Zhengyu He 2014-07-01 173 DEFINE_PER_CPU_SECTION(type, name, "..read_mostly")
c957ef2c59 Shaohua Li 2010-10-20 174
c957ef2c59 Shaohua Li 2010-10-20 175 /*
ac26963a11 Brijesh Singh 2017-10-20 176 * Declaration/definition used for per-CPU variables that should be accessed
ac26963a11 Brijesh Singh 2017-10-20 177 * as decrypted when memory encryption is enabled in the guest.
ac26963a11 Brijesh Singh 2017-10-20 178 */
ac26963a11 Brijesh Singh 2017-10-20 179 #if defined(CONFIG_VIRTUALIZATION) && defined(CONFIG_AMD_MEM_ENCRYPT)
ac26963a11 Brijesh Singh 2017-10-20 180
ac26963a11 Brijesh Singh 2017-10-20 181 #define DECLARE_PER_CPU_DECRYPTED(type, name) \
ac26963a11 Brijesh Singh 2017-10-20 182 DECLARE_PER_CPU_SECTION(type, name, "..decrypted")
ac26963a11 Brijesh Singh 2017-10-20 183
ac26963a11 Brijesh Singh 2017-10-20 184 #define DEFINE_PER_CPU_DECRYPTED(type, name) \
ac26963a11 Brijesh Singh 2017-10-20 185 DEFINE_PER_CPU_SECTION(type, name, "..decrypted")
ac26963a11 Brijesh Singh 2017-10-20 186 #else
ac26963a11 Brijesh Singh 2017-10-20 187 #define DEFINE_PER_CPU_DECRYPTED(type, name) DEFINE_PER_CPU(type, name)
ac26963a11 Brijesh Singh 2017-10-20 188 #endif
ac26963a11 Brijesh Singh 2017-10-20 189
ac26963a11 Brijesh Singh 2017-10-20 190 /*
545695fb41 Tejun Heo 2009-10-29 191 * Intermodule exports for per-CPU variables. sparse forgets about
545695fb41 Tejun Heo 2009-10-29 192 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to
545695fb41 Tejun Heo 2009-10-29 193 * noop if __CHECKER__.
5028eaa97d David Howells 2009-04-21 194 */
545695fb41 Tejun Heo 2009-10-29 195 #ifndef __CHECKER__
dd17c8f729 Rusty Russell 2009-10-29 196 #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var)
dd17c8f729 Rusty Russell 2009-10-29 197 #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var)
545695fb41 Tejun Heo 2009-10-29 198 #else
545695fb41 Tejun Heo 2009-10-29 199 #define EXPORT_PER_CPU_SYMBOL(var)
545695fb41 Tejun Heo 2009-10-29 200 #define EXPORT_PER_CPU_SYMBOL_GPL(var)
545695fb41 Tejun Heo 2009-10-29 201 #endif
5028eaa97d David Howells 2009-04-21 202
62fde54123 Tejun Heo 2014-06-17 203 /*
62fde54123 Tejun Heo 2014-06-17 204 * Accessors and operations.
62fde54123 Tejun Heo 2014-06-17 205 */
62fde54123 Tejun Heo 2014-06-17 206 #ifndef __ASSEMBLY__
62fde54123 Tejun Heo 2014-06-17 207
9c28278a24 Tejun Heo 2014-06-17 208 /*
6fbc07bbe2 Tejun Heo 2014-06-17 209 * __verify_pcpu_ptr() verifies @ptr is a percpu pointer without evaluating
6fbc07bbe2 Tejun Heo 2014-06-17 210 * @ptr and is invoked once before a percpu area is accessed by all
6fbc07bbe2 Tejun Heo 2014-06-17 211 * accessors and operations. This is performed in the generic part of
6fbc07bbe2 Tejun Heo 2014-06-17 212 * percpu and arch overrides don't need to worry about it; however, if an
6fbc07bbe2 Tejun Heo 2014-06-17 213 * arch wants to implement an arch-specific percpu accessor or operation,
6fbc07bbe2 Tejun Heo 2014-06-17 214 * it may use __verify_pcpu_ptr() to verify the parameters.
9c28278a24 Tejun Heo 2014-06-17 215 *
9c28278a24 Tejun Heo 2014-06-17 216 * + 0 is required in order to convert the pointer type from a
9c28278a24 Tejun Heo 2014-06-17 217 * potential array type to a pointer to a single item of the array.
9c28278a24 Tejun Heo 2014-06-17 218 */
eba117889a Tejun Heo 2014-06-17 219 #define __verify_pcpu_ptr(ptr) \
eba117889a Tejun Heo 2014-06-17 220 do { \
9c28278a24 Tejun Heo 2014-06-17 @221 const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
9c28278a24 Tejun Heo 2014-06-17 222 (void)__vpp_verify; \
9c28278a24 Tejun Heo 2014-06-17 223 } while (0)
9c28278a24 Tejun Heo 2014-06-17 224

:::::: The code at line 49 was first introduced by commit
:::::: e0fdb0e050eae331046385643618f12452aa7e73 percpu: add __percpu for sparse.

:::::: TO: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
:::::: CC: Tejun Heo <tj@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip