Content-Type: multipart/mixed; boundary="===============5042634172851443505==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [RFC PATCH 09/12] module: Move kallsyms support into a separate file Date: Wed, 29 Dec 2021 08:30:23 +0800 Message-ID: <202112290801.rMohBXAo-lkp@intel.com> In-Reply-To: <20211228213041.1356334-10-atomlin@redhat.com> List-Id: --===============5042634172851443505== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Aaron, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on jeyu/modules-next] [also build test ERROR on v5.16-rc7 next-20211224] [cannot apply to linus/master] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Aaron-Tomlin/module-Move-a= ll-into-module/20211229-063051 base: https://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modu= les-next config: nds32-allnoconfig (https://download.01.org/0day-ci/archive/20211229= /202112290801.rMohBXAo-lkp(a)intel.com/config) compiler: nds32le-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/dca0a654ac33ddd67bc916d2b= 906e610d94d9dfc git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Aaron-Tomlin/module-Move-all-into-= module/20211229-063051 git checkout dca0a654ac33ddd67bc916d2b906e610d94d9dfc # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dnds32 SHELL=3D/bin/bash kernel/module/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): kernel/module/kallsyms.c: In function 'is_exported': >> kernel/module/kallsyms.c:35:54: error: invalid use of undefined type 'co= nst struct module' 35 | ks =3D lookup_exported_symbol(name, mod->syms, m= od->syms + mod->num_syms); | ^~ kernel/module/kallsyms.c:35:65: error: invalid use of undefined type 'co= nst struct module' 35 | ks =3D lookup_exported_symbol(name, mod->syms, m= od->syms + mod->num_syms); | = ^~ kernel/module/kallsyms.c:35:77: error: invalid use of undefined type 'co= nst struct module' 35 | ks =3D lookup_exported_symbol(name, mod->syms, m= od->syms + mod->num_syms); | = ^~ kernel/module/kallsyms.c: In function 'layout_symtab': >> kernel/module/kallsyms.c:123:51: error: invalid use of undefined type 's= truct module' 123 | symsect->sh_entsize =3D get_offset(mod, &mod->init_layou= t.size, symsect, | ^~ >> kernel/module/kallsyms.c:132:31: error: implicit declaration of function= 'is_livepatch_module' [-Werror=3Dimplicit-function-declaration] 132 | if (i =3D=3D 0 || is_livepatch_module(mod) || | ^~~~~~~~~~~~~~~~~~~ In file included from include/vdso/const.h:5, from include/linux/const.h:4, from include/linux/list.h:8, from include/linux/module.h:12, from kernel/module/kallsyms.c:8: kernel/module/kallsyms.c:141:34: error: invalid use of undefined type 's= truct module' 141 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~ include/uapi/linux/const.h:32:44: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:141:25: note: in expansion of macro 'ALIGN' 141 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~~~~ kernel/module/kallsyms.c:141:34: error: invalid use of undefined type 's= truct module' 141 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~ include/uapi/linux/const.h:32:50: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^~~~ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:141:25: note: in expansion of macro 'ALIGN' 141 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~~~~ kernel/module/kallsyms.c:141:34: error: invalid use of undefined type 's= truct module' 141 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~ include/uapi/linux/const.h:32:61: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^~~~ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:141:25: note: in expansion of macro 'ALIGN' 141 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~~~~ kernel/module/kallsyms.c:142:28: error: invalid use of undefined type 's= truct module' 142 | info->stroffs =3D mod->core_layout.size =3D info->symoff= s + ndst * sizeof(Elf_Sym); | ^~ kernel/module/kallsyms.c:143:12: error: invalid use of undefined type 's= truct module' 143 | mod->core_layout.size +=3D strtab_size; | ^~ kernel/module/kallsyms.c:144:34: error: invalid use of undefined type 's= truct module' 144 | info->core_typeoffs =3D mod->core_layout.size; | ^~ kernel/module/kallsyms.c:145:12: error: invalid use of undefined type 's= truct module' 145 | mod->core_layout.size +=3D ndst * sizeof(char); | ^~ kernel/module/kallsyms.c:146:12: error: invalid use of undefined type 's= truct module' 146 | mod->core_layout.size =3D debug_align(mod->core_layout.s= ize); | ^~ >> kernel/module/kallsyms.c:146:33: error: implicit declaration of function= 'debug_align' [-Werror=3Dimplicit-function-declaration] 146 | mod->core_layout.size =3D debug_align(mod->core_layout.s= ize); | ^~~~~~~~~~~ kernel/module/kallsyms.c:146:48: error: invalid use of undefined type 's= truct module' 146 | mod->core_layout.size =3D debug_align(mod->core_layout.s= ize); | ^~ kernel/module/kallsyms.c:150:51: error: invalid use of undefined type 's= truct module' 150 | strsect->sh_entsize =3D get_offset(mod, &mod->init_layou= t.size, strsect, | ^~ kernel/module/kallsyms.c:155:12: error: invalid use of undefined type 's= truct module' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~ In file included from include/vdso/const.h:5, from include/linux/const.h:4, from include/linux/list.h:8, from include/linux/module.h:12, from kernel/module/kallsyms.c:8: kernel/module/kallsyms.c:155:42: error: invalid use of undefined type 's= truct module' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~ include/uapi/linux/const.h:32:44: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:155:33: note: in expansion of macro 'ALIGN' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ kernel/module/kallsyms.c:155:42: error: invalid use of undefined type 's= truct module' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~ include/uapi/linux/const.h:32:50: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^~~~ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:155:33: note: in expansion of macro 'ALIGN' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ >> kernel/module/kallsyms.c:156:51: error: invalid application of '__aligno= f__' to incomplete type 'struct mod_kallsyms' 156 | __alignof__(struct mod_kal= lsyms)); | ^~~~~~ include/uapi/linux/const.h:32:50: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^~~~ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:155:33: note: in expansion of macro 'ALIGN' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ kernel/module/kallsyms.c:155:42: error: invalid use of undefined type 's= truct module' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~ include/uapi/linux/const.h:32:61: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^~~~ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:155:33: note: in expansion of macro 'ALIGN' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ >> kernel/module/kallsyms.c:156:51: error: invalid application of '__aligno= f__' to incomplete type 'struct mod_kallsyms' 156 | __alignof__(struct mod_kal= lsyms)); | ^~~~~~ include/uapi/linux/const.h:32:61: note: in definition of macro '__ALIGN_= KERNEL_MASK' 32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask= )) | ^~~~ include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL' 8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | ^~~~~~~~~~~~~~ kernel/module/kallsyms.c:155:33: note: in expansion of macro 'ALIGN' 155 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ kernel/module/kallsyms.c:157:42: error: invalid use of undefined type 's= truct module' 157 | info->mod_kallsyms_init_off =3D mod->init_layout.size; | ^~ kernel/module/kallsyms.c:158:12: error: invalid use of undefined type 's= truct module' 158 | mod->init_layout.size +=3D sizeof(struct mod_kallsyms); | ^~ >> kernel/module/kallsyms.c:158:41: error: invalid application of 'sizeof' = to incomplete type 'struct mod_kallsyms' 158 | mod->init_layout.size +=3D sizeof(struct mod_kallsyms); | ^~~~~~ kernel/module/kallsyms.c:159:34: error: invalid use of undefined type 's= truct module' 159 | info->init_typeoffs =3D mod->init_layout.size; | ^~ kernel/module/kallsyms.c:160:12: error: invalid use of undefined type 's= truct module' 160 | mod->init_layout.size +=3D nsrc * sizeof(char); | ^~ kernel/module/kallsyms.c:161:12: error: invalid use of undefined type 's= truct module' 161 | mod->init_layout.size =3D debug_align(mod->init_layout.s= ize); | ^~ kernel/module/kallsyms.c:161:48: error: invalid use of undefined type 's= truct module' 161 | mod->init_layout.size =3D debug_align(mod->init_layout.s= ize); | ^~ kernel/module/kallsyms.c: In function 'add_kallsyms': kernel/module/kallsyms.c:178:12: error: invalid use of undefined type 's= truct module' 178 | mod->kallsyms =3D mod->init_layout.base + info->mod_kall= syms_init_off; | ^~ kernel/module/kallsyms.c:178:28: error: invalid use of undefined type 's= truct module' 178 | mod->kallsyms =3D mod->init_layout.base + info->mod_kall= syms_init_off; | ^~ kernel/module/kallsyms.c:180:12: error: invalid use of undefined type 's= truct module' 180 | mod->kallsyms->symtab =3D (void *)symsec->sh_addr; | ^~ kernel/module/kallsyms.c:181:12: error: invalid use of undefined type 's= truct module' 181 | mod->kallsyms->num_symtab =3D symsec->sh_size / sizeof(E= lf_Sym); | ^~ kernel/module/kallsyms.c:183:12: error: invalid use of undefined type 's= truct module' 183 | mod->kallsyms->strtab =3D (void *)info->sechdrs[info->in= dex.str].sh_addr; | ^~ kernel/module/kallsyms.c:184:12: error: invalid use of undefined type 's= truct module' 184 | mod->kallsyms->typetab =3D mod->init_layout.base + info-= >init_typeoffs; | ^~ kernel/module/kallsyms.c:184:37: error: invalid use of undefined type 's= truct module' 184 | mod->kallsyms->typetab =3D mod->init_layout.base + info-= >init_typeoffs; | ^~ kernel/module/kallsyms.c:190:12: error: invalid use of undefined type 's= truct module' 190 | mod->core_kallsyms.symtab =3D dst =3D mod->core_layout.b= ase + info->symoffs; | ^~ kernel/module/kallsyms.c:190:46: error: invalid use of undefined type 's= truct module' 190 | mod->core_kallsyms.symtab =3D dst =3D mod->core_layout.b= ase + info->symoffs; | ^~ kernel/module/kallsyms.c:191:12: error: invalid use of undefined type 's= truct module' 191 | mod->core_kallsyms.strtab =3D s =3D mod->core_layout.bas= e + info->stroffs; | ^~ kernel/module/kallsyms.c:191:44: error: invalid use of undefined type 's= truct module' 191 | mod->core_kallsyms.strtab =3D s =3D mod->core_layout.bas= e + info->stroffs; | ^~ kernel/module/kallsyms.c:192:12: error: invalid use of undefined type 's= truct module' 192 | mod->core_kallsyms.typetab =3D mod->core_layout.base + i= nfo->core_typeoffs; | ^~ kernel/module/kallsyms.c:192:41: error: invalid use of undefined type 's= truct module' 192 | mod->core_kallsyms.typetab =3D mod->core_layout.base + i= nfo->core_typeoffs; | ^~ kernel/module/kallsyms.c:193:18: error: invalid use of undefined type 's= truct module' 193 | src =3D mod->kallsyms->symtab; | ^~ kernel/module/kallsyms.c:194:35: error: invalid use of undefined type 's= truct module' 194 | for (ndst =3D i =3D 0; i < mod->kallsyms->num_symtab; i+= +) { | ^~ kernel/module/kallsyms.c:195:20: error: invalid use of undefined type 's= truct module' 195 | mod->kallsyms->typetab[i] =3D elf_type(src + i, = info); | ^~ kernel/module/kallsyms.c:199:28: error: invalid use of undefined type 's= truct module' 199 | mod->core_kallsyms.typetab[ndst] =3D | ^~ kernel/module/kallsyms.c:200:32: error: invalid use of undefined type 's= truct module' 200 | mod->kallsyms->typetab[i]; | ^~ kernel/module/kallsyms.c:202:54: error: invalid use of undefined type 's= truct module' 202 | dst[ndst++].st_name =3D s - mod->core_ka= llsyms.strtab; | ^~ kernel/module/kallsyms.c:203:45: error: invalid use of undefined type 's= truct module' 203 | s +=3D strlcpy(s, &mod->kallsyms->strtab= [src[i].st_name], | ^~ kernel/module/kallsyms.c:207:12: error: invalid use of undefined type 's= truct module' 207 | mod->core_kallsyms.num_symtab =3D ndst; | ^~ kernel/module/kallsyms.c: At top level: >> kernel/module/kallsyms.c:243:48: warning: 'struct mod_kallsyms' declared= inside parameter list will not be visible outside of this definition or de= claration 243 | static const char *kallsyms_symbol_name(struct mod_kallsyms *kal= lsyms, unsigned int symnum) | ^~~~~~~~~~~~ kernel/module/kallsyms.c: In function 'kallsyms_symbol_name': >> kernel/module/kallsyms.c:245:24: error: invalid use of undefined type 's= truct mod_kallsyms' 245 | return kallsyms->strtab + kallsyms->symtab[symnum].st_na= me; | ^~ kernel/module/kallsyms.c:245:43: error: invalid use of undefined type 's= truct mod_kallsyms' 245 | return kallsyms->strtab + kallsyms->symtab[symnum].st_na= me; | ^~ >> kernel/module/kallsyms.c:243:85: warning: parameter 'symnum' set but not= used [-Wunused-but-set-parameter] 243 | static const char *kallsyms_symbol_name(struct mod_kallsyms *kal= lsyms, unsigned int symnum) | = ~~~~~~~~~~~~~^~~~~~ In file included from include/linux/rbtree.h:22, from include/linux/mm_types.h:10, from include/linux/buildid.h:5, from include/linux/module.h:14, from kernel/module/kallsyms.c:8: kernel/module/kallsyms.c: In function 'find_kallsyms_symbol': kernel/module/kallsyms.c:259:66: error: invalid use of undefined type 's= truct module' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/rcupdate.h:389:17: note: in definition of macro '__rcu_der= eference_check' 389 | typeof(*p) *________p1 =3D (typeof(*p) *__force)READ_ONC= E(p); \ | ^ include/linux/rcupdate.h:612:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 612 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:41: note: in expansion of macro 'rcu_derefe= rence_sched' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:66: error: invalid use of undefined type 's= truct module' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/rcupdate.h:389:43: note: in definition of macro '__rcu_der= eference_check' 389 | typeof(*p) *________p1 =3D (typeof(*p) *__force)READ_ONC= E(p); \ | ^ include/linux/rcupdate.h:612:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 612 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:41: note: in expansion of macro 'rcu_derefe= rence_sched' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ In file included from : kernel/module/kallsyms.c:259:66: error: invalid use of undefined type 's= truct module' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/compiler_types.h:308:23: note: in definition of macro '__c= ompiletime_assert' 308 | if (!(condition)) = \ | ^~~~~~~~~ include/linux/compiler_types.h:328:9: note: in expansion of macro '_comp= iletime_assert' 328 | _compiletime_assert(condition, msg, __compiletime_assert= _, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compilet= ime_assert' 36 | compiletime_assert(__native_word(t) || sizeof(t) =3D=3D = sizeof(long long), \ | ^~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__nativ= e_word' 36 | compiletime_assert(__native_word(t) || sizeof(t) =3D=3D = sizeof(long long), \ | ^~~~~~~~~~~~~ include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compilet= ime_assert_rwonce_type' 49 | compiletime_assert_rwonce_type(x); = \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/rcupdate.h:389:55: note: in expansion of macro 'READ_ONCE' 389 | typeof(*p) *________p1 =3D (typeof(*p) *__force)READ_ONC= E(p); \ | ^~~~~~~~~ include/linux/rcupdate.h:558:9: note: in expansion of macro '__rcu_deref= erence_check' 558 | __rcu_dereference_check((p), (c) || rcu_read_lock_sched_= held(), \ | ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/rcupdate.h:612:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 612 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:41: note: in expansion of macro 'rcu_derefe= rence_sched' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:66: error: invalid use of undefined type 's= truct module' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/compiler_types.h:308:23: note: in definition of macro '__c= ompiletime_assert' 308 | if (!(condition)) = \ | ^~~~~~~~~ include/linux/compiler_types.h:328:9: note: in expansion of macro '_comp= iletime_assert' 328 | _compiletime_assert(condition, msg, __compiletime_assert= _, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compilet= ime_assert' 36 | compiletime_assert(__native_word(t) || sizeof(t) =3D=3D = sizeof(long long), \ | ^~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__nativ= e_word' 36 | compiletime_assert(__native_word(t) || sizeof(t) =3D=3D = sizeof(long long), \ | ^~~~~~~~~~~~~ include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compilet= ime_assert_rwonce_type' 49 | compiletime_assert_rwonce_type(x); = \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/rcupdate.h:389:55: note: in expansion of macro 'READ_ONCE' 389 | typeof(*p) *________p1 =3D (typeof(*p) *__force)READ_ONC= E(p); \ | ^~~~~~~~~ include/linux/rcupdate.h:558:9: note: in expansion of macro '__rcu_deref= erence_check' 558 | __rcu_dereference_check((p), (c) || rcu_read_lock_sched_= held(), \ | ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/rcupdate.h:612:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 612 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:41: note: in expansion of macro 'rcu_derefe= rence_sched' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:259:66: error: invalid use of undefined type 's= truct module' 259 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/compiler_types.h:308:23: note: in definition of macro '__c= ompiletime_assert' 308 | if (!(condition)) = \ | ^~~~~~~~~ include/linux/compiler_types.h:328:9: note: in expansion of macro '_comp= iletime_assert' .. vim +35 kernel/module/kallsyms.c 27 = 28 static int is_exported(const char *name, unsigned long value, 29 const struct module *mod) 30 { 31 const struct kernel_symbol *ks; 32 if (!mod) 33 ks =3D lookup_exported_symbol(name, __start___ksymtab, __stop___ks= ymtab); 34 else > 35 ks =3D lookup_exported_symbol(name, mod->syms, mod->syms + mod->nu= m_syms); 36 = 37 return ks !=3D NULL && kernel_symbol_value(ks) =3D=3D value; 38 } 39 = 40 /* As per nm */ 41 static char elf_type(const Elf_Sym *sym, const struct load_info *inf= o) 42 { 43 const Elf_Shdr *sechdrs =3D info->sechdrs; 44 = 45 if (ELF_ST_BIND(sym->st_info) =3D=3D STB_WEAK) { 46 if (ELF_ST_TYPE(sym->st_info) =3D=3D STT_OBJECT) 47 return 'v'; 48 else 49 return 'w'; 50 } 51 if (sym->st_shndx =3D=3D SHN_UNDEF) 52 return 'U'; 53 if (sym->st_shndx =3D=3D SHN_ABS || sym->st_shndx =3D=3D info->inde= x.pcpu) 54 return 'a'; 55 if (sym->st_shndx >=3D SHN_LORESERVE) 56 return '?'; 57 if (sechdrs[sym->st_shndx].sh_flags & SHF_EXECINSTR) 58 return 't'; 59 if (sechdrs[sym->st_shndx].sh_flags & SHF_ALLOC 60 && sechdrs[sym->st_shndx].sh_type !=3D SHT_NOBITS) { 61 if (!(sechdrs[sym->st_shndx].sh_flags & SHF_WRITE)) 62 return 'r'; 63 else if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) 64 return 'g'; 65 else 66 return 'd'; 67 } 68 if (sechdrs[sym->st_shndx].sh_type =3D=3D SHT_NOBITS) { 69 if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) 70 return 's'; 71 else 72 return 'b'; 73 } 74 if (strstarts(info->secstrings + sechdrs[sym->st_shndx].sh_name, 75 ".debug")) { 76 return 'n'; 77 } 78 return '?'; 79 } 80 = 81 static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechd= rs, 82 unsigned int shnum, unsigned int pcpundx) 83 { 84 const Elf_Shdr *sec; 85 = 86 if (src->st_shndx =3D=3D SHN_UNDEF 87 || src->st_shndx >=3D shnum 88 || !src->st_name) 89 return false; 90 = 91 #ifdef CONFIG_KALLSYMS_ALL 92 if (src->st_shndx =3D=3D pcpundx) 93 return true; 94 #endif 95 = 96 sec =3D sechdrs + src->st_shndx; 97 if (!(sec->sh_flags & SHF_ALLOC) 98 #ifndef CONFIG_KALLSYMS_ALL 99 || !(sec->sh_flags & SHF_EXECINSTR) 100 #endif 101 || (sec->sh_entsize & INIT_OFFSET_MASK)) 102 return false; 103 = 104 return true; 105 } 106 = 107 /* 108 * We only allocate and copy the strings needed by the parts of symt= ab 109 * we keep. This is simple, but has the effect of making multiple 110 * copies of duplicates. We could be more sophisticated, see 111 * linux-kernel thread starting with 112 * <73defb5e4bca04a6431392cc341112b1@localhost>. 113 */ 114 void layout_symtab(struct module *mod, struct load_info *info) 115 { 116 Elf_Shdr *symsect =3D info->sechdrs + info->index.sym; 117 Elf_Shdr *strsect =3D info->sechdrs + info->index.str; 118 const Elf_Sym *src; 119 unsigned int i, nsrc, ndst, strtab_size =3D 0; 120 = 121 /* Put symbol section at end of init part of module. */ 122 symsect->sh_flags |=3D SHF_ALLOC; > 123 symsect->sh_entsize =3D get_offset(mod, &mod->init_layout.size, sym= sect, 124 info->index.sym) | INIT_OFFSET_MASK; 125 pr_debug("\t%s\n", info->secstrings + symsect->sh_name); 126 = 127 src =3D (void *)info->hdr + symsect->sh_offset; 128 nsrc =3D symsect->sh_size / sizeof(*src); 129 = 130 /* Compute total space required for the core symbols' strtab. */ 131 for (ndst =3D i =3D 0; i < nsrc; i++) { > 132 if (i =3D=3D 0 || is_livepatch_module(mod) || 133 is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum, 134 info->index.pcpu)) { 135 strtab_size +=3D strlen(&info->strtab[src[i].st_name])+1; 136 ndst++; 137 } 138 } 139 = 140 /* Append room for core symbols at end of core part. */ 141 info->symoffs =3D ALIGN(mod->core_layout.size, symsect->sh_addralig= n ?: 1); 142 info->stroffs =3D mod->core_layout.size =3D info->symoffs + ndst * = sizeof(Elf_Sym); 143 mod->core_layout.size +=3D strtab_size; 144 info->core_typeoffs =3D mod->core_layout.size; 145 mod->core_layout.size +=3D ndst * sizeof(char); > 146 mod->core_layout.size =3D debug_align(mod->core_layout.size); 147 = 148 /* Put string table section at end of init part of module. */ 149 strsect->sh_flags |=3D SHF_ALLOC; 150 strsect->sh_entsize =3D get_offset(mod, &mod->init_layout.size, str= sect, 151 info->index.str) | INIT_OFFSET_MASK; 152 pr_debug("\t%s\n", info->secstrings + strsect->sh_name); 153 = 154 /* We'll tack temporary mod_kallsyms on the end. */ 155 mod->init_layout.size =3D ALIGN(mod->init_layout.size, > 156 __alignof__(struct mod_kallsyms)); 157 info->mod_kallsyms_init_off =3D mod->init_layout.size; > 158 mod->init_layout.size +=3D sizeof(struct mod_kallsyms); 159 info->init_typeoffs =3D mod->init_layout.size; 160 mod->init_layout.size +=3D nsrc * sizeof(char); 161 mod->init_layout.size =3D debug_align(mod->init_layout.size); 162 } 163 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============5042634172851443505==--