From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7774087930218739529==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [RFC PATCH v3 09/13] module: Move kallsyms support into a separate file Date: Sat, 29 Jan 2022 06:56:47 +0800 Message-ID: <202201290605.RGByo8yC-lkp@intel.com> In-Reply-To: <20220128203934.600247-10-atomlin@redhat.com> List-Id: --===============7774087930218739529== 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 a97ac8cb24a3c3ad74794adb83717ef1605d1b47] url: https://github.com/0day-ci/linux/commits/Aaron-Tomlin/module-core-c= ode-clean-up/20220129-044218 base: a97ac8cb24a3c3ad74794adb83717ef1605d1b47 config: nds32-allnoconfig (https://download.01.org/0day-ci/archive/20220129= /202201290605.RGByo8yC-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/fd6ae2d3fa439baa614e32c58= b4c2f0dd0faa186 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Aaron-Tomlin/module-core-code-clea= n-up/20220129-044218 git checkout fd6ae2d3fa439baa614e32c58b4c2f0dd0faa186 # 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:31:54: error: invalid use of undefined type 'co= nst struct module' 31 | ks =3D lookup_exported_symbol(name, mod->syms, m= od->syms + mod->num_syms); | ^~ kernel/module/kallsyms.c:31:65: error: invalid use of undefined type 'co= nst struct module' 31 | ks =3D lookup_exported_symbol(name, mod->syms, m= od->syms + mod->num_syms); | = ^~ kernel/module/kallsyms.c:31:77: error: invalid use of undefined type 'co= nst struct module' 31 | 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:119:51: error: invalid use of undefined type 's= truct module' 119 | symsect->sh_entsize =3D get_offset(mod, &mod->init_layou= t.size, symsect, | ^~ >> kernel/module/kallsyms.c:128:31: error: implicit declaration of function= 'is_livepatch_module' [-Werror=3Dimplicit-function-declaration] 128 | 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:9, from include/linux/module.h:12, from kernel/module/kallsyms.c:8: kernel/module/kallsyms.c:137:34: error: invalid use of undefined type 's= truct module' 137 | 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:137:25: note: in expansion of macro 'ALIGN' 137 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~~~~ kernel/module/kallsyms.c:137:34: error: invalid use of undefined type 's= truct module' 137 | 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:137:25: note: in expansion of macro 'ALIGN' 137 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~~~~ kernel/module/kallsyms.c:137:34: error: invalid use of undefined type 's= truct module' 137 | 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:137:25: note: in expansion of macro 'ALIGN' 137 | info->symoffs =3D ALIGN(mod->core_layout.size, symsect->= sh_addralign ?: 1); | ^~~~~ kernel/module/kallsyms.c:138:28: error: invalid use of undefined type 's= truct module' 138 | info->stroffs =3D mod->core_layout.size =3D info->symoff= s + ndst * sizeof(Elf_Sym); | ^~ kernel/module/kallsyms.c:139:12: error: invalid use of undefined type 's= truct module' 139 | mod->core_layout.size +=3D strtab_size; | ^~ kernel/module/kallsyms.c:140:34: error: invalid use of undefined type 's= truct module' 140 | info->core_typeoffs =3D mod->core_layout.size; | ^~ kernel/module/kallsyms.c:141:12: error: invalid use of undefined type 's= truct module' 141 | mod->core_layout.size +=3D ndst * sizeof(char); | ^~ kernel/module/kallsyms.c:142:12: error: invalid use of undefined type 's= truct module' 142 | mod->core_layout.size =3D debug_align(mod->core_layout.s= ize); | ^~ >> kernel/module/kallsyms.c:142:33: error: implicit declaration of function= 'debug_align' [-Werror=3Dimplicit-function-declaration] 142 | mod->core_layout.size =3D debug_align(mod->core_layout.s= ize); | ^~~~~~~~~~~ kernel/module/kallsyms.c:142:48: error: invalid use of undefined type 's= truct module' 142 | mod->core_layout.size =3D debug_align(mod->core_layout.s= ize); | ^~ kernel/module/kallsyms.c:146:51: error: invalid use of undefined type 's= truct module' 146 | strsect->sh_entsize =3D get_offset(mod, &mod->init_layou= t.size, strsect, | ^~ kernel/module/kallsyms.c:151:12: error: invalid use of undefined type 's= truct module' 151 | 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:9, from include/linux/module.h:12, from kernel/module/kallsyms.c:8: kernel/module/kallsyms.c:151:42: error: invalid use of undefined type 's= truct module' 151 | 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:151:33: note: in expansion of macro 'ALIGN' 151 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ kernel/module/kallsyms.c:151:42: error: invalid use of undefined type 's= truct module' 151 | 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:151:33: note: in expansion of macro 'ALIGN' 151 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ >> kernel/module/kallsyms.c:152:51: error: invalid application of '__aligno= f__' to incomplete type 'struct mod_kallsyms' 152 | __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:151:33: note: in expansion of macro 'ALIGN' 151 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ kernel/module/kallsyms.c:151:42: error: invalid use of undefined type 's= truct module' 151 | 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:151:33: note: in expansion of macro 'ALIGN' 151 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ >> kernel/module/kallsyms.c:152:51: error: invalid application of '__aligno= f__' to incomplete type 'struct mod_kallsyms' 152 | __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:151:33: note: in expansion of macro 'ALIGN' 151 | mod->init_layout.size =3D ALIGN(mod->init_layout.size, | ^~~~~ kernel/module/kallsyms.c:153:42: error: invalid use of undefined type 's= truct module' 153 | info->mod_kallsyms_init_off =3D mod->init_layout.size; | ^~ kernel/module/kallsyms.c:154:12: error: invalid use of undefined type 's= truct module' 154 | mod->init_layout.size +=3D sizeof(struct mod_kallsyms); | ^~ >> kernel/module/kallsyms.c:154:41: error: invalid application of 'sizeof' = to incomplete type 'struct mod_kallsyms' 154 | mod->init_layout.size +=3D sizeof(struct mod_kallsyms); | ^~~~~~ kernel/module/kallsyms.c:155:34: error: invalid use of undefined type 's= truct module' 155 | info->init_typeoffs =3D mod->init_layout.size; | ^~ kernel/module/kallsyms.c:156:12: error: invalid use of undefined type 's= truct module' 156 | mod->init_layout.size +=3D nsrc * sizeof(char); | ^~ kernel/module/kallsyms.c:157:12: error: invalid use of undefined type 's= truct module' 157 | mod->init_layout.size =3D debug_align(mod->init_layout.s= ize); | ^~ kernel/module/kallsyms.c:157:48: error: invalid use of undefined type 's= truct module' 157 | mod->init_layout.size =3D debug_align(mod->init_layout.s= ize); | ^~ kernel/module/kallsyms.c: In function 'add_kallsyms': kernel/module/kallsyms.c:174:12: error: invalid use of undefined type 's= truct module' 174 | mod->kallsyms =3D mod->init_layout.base + info->mod_kall= syms_init_off; | ^~ kernel/module/kallsyms.c:174:28: error: invalid use of undefined type 's= truct module' 174 | mod->kallsyms =3D mod->init_layout.base + info->mod_kall= syms_init_off; | ^~ kernel/module/kallsyms.c:176:12: error: invalid use of undefined type 's= truct module' 176 | mod->kallsyms->symtab =3D (void *)symsec->sh_addr; | ^~ kernel/module/kallsyms.c:177:12: error: invalid use of undefined type 's= truct module' 177 | mod->kallsyms->num_symtab =3D symsec->sh_size / sizeof(E= lf_Sym); | ^~ kernel/module/kallsyms.c:179:12: error: invalid use of undefined type 's= truct module' 179 | mod->kallsyms->strtab =3D (void *)info->sechdrs[info->in= dex.str].sh_addr; | ^~ kernel/module/kallsyms.c:180:12: error: invalid use of undefined type 's= truct module' 180 | mod->kallsyms->typetab =3D mod->init_layout.base + info-= >init_typeoffs; | ^~ kernel/module/kallsyms.c:180:37: error: invalid use of undefined type 's= truct module' 180 | mod->kallsyms->typetab =3D mod->init_layout.base + info-= >init_typeoffs; | ^~ kernel/module/kallsyms.c:186:12: error: invalid use of undefined type 's= truct module' 186 | mod->core_kallsyms.symtab =3D dst =3D mod->core_layout.b= ase + info->symoffs; | ^~ kernel/module/kallsyms.c:186:46: error: invalid use of undefined type 's= truct module' 186 | mod->core_kallsyms.symtab =3D dst =3D mod->core_layout.b= ase + info->symoffs; | ^~ kernel/module/kallsyms.c:187:12: error: invalid use of undefined type 's= truct module' 187 | mod->core_kallsyms.strtab =3D s =3D mod->core_layout.bas= e + info->stroffs; | ^~ kernel/module/kallsyms.c:187:44: error: invalid use of undefined type 's= truct module' 187 | mod->core_kallsyms.strtab =3D s =3D mod->core_layout.bas= e + info->stroffs; | ^~ kernel/module/kallsyms.c:188:12: error: invalid use of undefined type 's= truct module' 188 | mod->core_kallsyms.typetab =3D mod->core_layout.base + i= nfo->core_typeoffs; | ^~ kernel/module/kallsyms.c:188:41: error: invalid use of undefined type 's= truct module' 188 | mod->core_kallsyms.typetab =3D mod->core_layout.base + i= nfo->core_typeoffs; | ^~ kernel/module/kallsyms.c:189:18: error: invalid use of undefined type 's= truct module' 189 | src =3D mod->kallsyms->symtab; | ^~ kernel/module/kallsyms.c:190:35: error: invalid use of undefined type 's= truct module' 190 | for (ndst =3D i =3D 0; i < mod->kallsyms->num_symtab; i+= +) { | ^~ kernel/module/kallsyms.c:191:20: error: invalid use of undefined type 's= truct module' 191 | mod->kallsyms->typetab[i] =3D elf_type(src + i, = info); | ^~ kernel/module/kallsyms.c:195:28: error: invalid use of undefined type 's= truct module' 195 | mod->core_kallsyms.typetab[ndst] =3D | ^~ kernel/module/kallsyms.c:196:32: error: invalid use of undefined type 's= truct module' 196 | mod->kallsyms->typetab[i]; | ^~ kernel/module/kallsyms.c:198:54: error: invalid use of undefined type 's= truct module' 198 | dst[ndst++].st_name =3D s - mod->core_ka= llsyms.strtab; | ^~ kernel/module/kallsyms.c:199:45: error: invalid use of undefined type 's= truct module' 199 | s +=3D strscpy(s, &mod->kallsyms->strtab= [src[i].st_name], | ^~ kernel/module/kallsyms.c:203:12: error: invalid use of undefined type 's= truct module' 203 | mod->core_kallsyms.num_symtab =3D ndst; | ^~ kernel/module/kallsyms.c: At top level: >> kernel/module/kallsyms.c:239:48: warning: 'struct mod_kallsyms' declared= inside parameter list will not be visible outside of this definition or de= claration 239 | 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:241:24: error: invalid use of undefined type 's= truct mod_kallsyms' 241 | return kallsyms->strtab + kallsyms->symtab[symnum].st_na= me; | ^~ kernel/module/kallsyms.c:241:43: error: invalid use of undefined type 's= truct mod_kallsyms' 241 | return kallsyms->strtab + kallsyms->symtab[symnum].st_na= me; | ^~ >> kernel/module/kallsyms.c:239:85: warning: parameter 'symnum' set but not= used [-Wunused-but-set-parameter] 239 | static const char *kallsyms_symbol_name(struct mod_kallsyms *kal= lsyms, unsigned int symnum) | = ~~~~~~~~~~~~~^~~~~~ In file included from include/linux/rbtree.h:24, 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:255:66: error: invalid use of undefined type 's= truct module' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/rcupdate.h:391:17: note: in definition of macro '__rcu_der= eference_check' 391 | typeof(*p) *local =3D (typeof(*p) *__force)READ_ONCE(p);= \ | ^ include/linux/rcupdate.h:619:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 619 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:41: note: in expansion of macro 'rcu_derefe= rence_sched' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:66: error: invalid use of undefined type 's= truct module' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/rcupdate.h:391:38: note: in definition of macro '__rcu_der= eference_check' 391 | typeof(*p) *local =3D (typeof(*p) *__force)READ_ONCE(p);= \ | ^ include/linux/rcupdate.h:619:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 619 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:41: note: in expansion of macro 'rcu_derefe= rence_sched' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ In file included from : kernel/module/kallsyms.c:255:66: error: invalid use of undefined type 's= truct module' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/compiler_types.h:326:23: note: in definition of macro '__c= ompiletime_assert' 326 | if (!(condition)) = \ | ^~~~~~~~~ include/linux/compiler_types.h:346:9: note: in expansion of macro '_comp= iletime_assert' 346 | _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:391:50: note: in expansion of macro 'READ_ONCE' 391 | typeof(*p) *local =3D (typeof(*p) *__force)READ_ONCE(p);= \ | ^~~~~~~~~ include/linux/rcupdate.h:563:9: note: in expansion of macro '__rcu_deref= erence_check' 563 | __rcu_dereference_check((p), __UNIQUE_ID(rcu), \ | ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/rcupdate.h:619:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 619 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:41: note: in expansion of macro 'rcu_derefe= rence_sched' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:66: error: invalid use of undefined type 's= truct module' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/compiler_types.h:326:23: note: in definition of macro '__c= ompiletime_assert' 326 | if (!(condition)) = \ | ^~~~~~~~~ include/linux/compiler_types.h:346:9: note: in expansion of macro '_comp= iletime_assert' 346 | _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:391:50: note: in expansion of macro 'READ_ONCE' 391 | typeof(*p) *local =3D (typeof(*p) *__force)READ_ONCE(p);= \ | ^~~~~~~~~ include/linux/rcupdate.h:563:9: note: in expansion of macro '__rcu_deref= erence_check' 563 | __rcu_dereference_check((p), __UNIQUE_ID(rcu), \ | ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/rcupdate.h:619:34: note: in expansion of macro 'rcu_derefe= rence_sched_check' 619 | #define rcu_dereference_sched(p) rcu_dereference_sched_check(p, = 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:41: note: in expansion of macro 'rcu_derefe= rence_sched' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | ^~~~~~~~~~~~~~~~~~~~~ kernel/module/kallsyms.c:255:66: error: invalid use of undefined type 's= truct module' 255 | struct mod_kallsyms *kallsyms =3D rcu_dereference_sched(= mod->kallsyms); | = ^~ include/linux/compiler_types.h:326:23: note: in definition of macro '__c= ompiletime_assert' 326 | if (!(condition)) = \ | ^~~~~~~~~ include/linux/compiler_types.h:346:9: note: in expansion of macro '_comp= iletime_assert' .. vim +31 kernel/module/kallsyms.c 22 = 23 static int is_exported(const char *name, unsigned long value, 24 const struct module *mod) 25 { 26 const struct kernel_symbol *ks; 27 = 28 if (!mod) 29 ks =3D lookup_exported_symbol(name, __start___ksymtab, __stop___ks= ymtab); 30 else > 31 ks =3D lookup_exported_symbol(name, mod->syms, mod->syms + mod->nu= m_syms); 32 = 33 return ks !=3D NULL && kernel_symbol_value(ks) =3D=3D value; 34 } 35 = 36 /* As per nm */ 37 static char elf_type(const Elf_Sym *sym, const struct load_info *inf= o) 38 { 39 const Elf_Shdr *sechdrs =3D info->sechdrs; 40 = 41 if (ELF_ST_BIND(sym->st_info) =3D=3D STB_WEAK) { 42 if (ELF_ST_TYPE(sym->st_info) =3D=3D STT_OBJECT) 43 return 'v'; 44 else 45 return 'w'; 46 } 47 if (sym->st_shndx =3D=3D SHN_UNDEF) 48 return 'U'; 49 if (sym->st_shndx =3D=3D SHN_ABS || sym->st_shndx =3D=3D info->inde= x.pcpu) 50 return 'a'; 51 if (sym->st_shndx >=3D SHN_LORESERVE) 52 return '?'; 53 if (sechdrs[sym->st_shndx].sh_flags & SHF_EXECINSTR) 54 return 't'; 55 if (sechdrs[sym->st_shndx].sh_flags & SHF_ALLOC 56 && sechdrs[sym->st_shndx].sh_type !=3D SHT_NOBITS) { 57 if (!(sechdrs[sym->st_shndx].sh_flags & SHF_WRITE)) 58 return 'r'; 59 else if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) 60 return 'g'; 61 else 62 return 'd'; 63 } 64 if (sechdrs[sym->st_shndx].sh_type =3D=3D SHT_NOBITS) { 65 if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) 66 return 's'; 67 else 68 return 'b'; 69 } 70 if (strstarts(info->secstrings + sechdrs[sym->st_shndx].sh_name, 71 ".debug")) { 72 return 'n'; 73 } 74 return '?'; 75 } 76 = 77 static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechd= rs, 78 unsigned int shnum, unsigned int pcpundx) 79 { 80 const Elf_Shdr *sec; 81 = 82 if (src->st_shndx =3D=3D SHN_UNDEF 83 || src->st_shndx >=3D shnum 84 || !src->st_name) 85 return false; 86 = 87 #ifdef CONFIG_KALLSYMS_ALL 88 if (src->st_shndx =3D=3D pcpundx) 89 return true; 90 #endif 91 = 92 sec =3D sechdrs + src->st_shndx; 93 if (!(sec->sh_flags & SHF_ALLOC) 94 #ifndef CONFIG_KALLSYMS_ALL 95 || !(sec->sh_flags & SHF_EXECINSTR) 96 #endif 97 || (sec->sh_entsize & INIT_OFFSET_MASK)) 98 return false; 99 = 100 return true; 101 } 102 = 103 /* 104 * We only allocate and copy the strings needed by the parts of symt= ab 105 * we keep. This is simple, but has the effect of making multiple 106 * copies of duplicates. We could be more sophisticated, see 107 * linux-kernel thread starting with 108 * <73defb5e4bca04a6431392cc341112b1@localhost>. 109 */ 110 void layout_symtab(struct module *mod, struct load_info *info) 111 { 112 Elf_Shdr *symsect =3D info->sechdrs + info->index.sym; 113 Elf_Shdr *strsect =3D info->sechdrs + info->index.str; 114 const Elf_Sym *src; 115 unsigned int i, nsrc, ndst, strtab_size =3D 0; 116 = 117 /* Put symbol section at end of init part of module. */ 118 symsect->sh_flags |=3D SHF_ALLOC; > 119 symsect->sh_entsize =3D get_offset(mod, &mod->init_layout.size, sym= sect, 120 info->index.sym) | INIT_OFFSET_MASK; 121 pr_debug("\t%s\n", info->secstrings + symsect->sh_name); 122 = 123 src =3D (void *)info->hdr + symsect->sh_offset; 124 nsrc =3D symsect->sh_size / sizeof(*src); 125 = 126 /* Compute total space required for the core symbols' strtab. */ 127 for (ndst =3D i =3D 0; i < nsrc; i++) { > 128 if (i =3D=3D 0 || is_livepatch_module(mod) || 129 is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum, 130 info->index.pcpu)) { 131 strtab_size +=3D strlen(&info->strtab[src[i].st_name])+1; 132 ndst++; 133 } 134 } 135 = 136 /* Append room for core symbols at end of core part. */ 137 info->symoffs =3D ALIGN(mod->core_layout.size, symsect->sh_addralig= n ?: 1); 138 info->stroffs =3D mod->core_layout.size =3D info->symoffs + ndst * = sizeof(Elf_Sym); 139 mod->core_layout.size +=3D strtab_size; 140 info->core_typeoffs =3D mod->core_layout.size; 141 mod->core_layout.size +=3D ndst * sizeof(char); > 142 mod->core_layout.size =3D debug_align(mod->core_layout.size); 143 = 144 /* Put string table section at end of init part of module. */ 145 strsect->sh_flags |=3D SHF_ALLOC; 146 strsect->sh_entsize =3D get_offset(mod, &mod->init_layout.size, str= sect, 147 info->index.str) | INIT_OFFSET_MASK; 148 pr_debug("\t%s\n", info->secstrings + strsect->sh_name); 149 = 150 /* We'll tack temporary mod_kallsyms on the end. */ 151 mod->init_layout.size =3D ALIGN(mod->init_layout.size, > 152 __alignof__(struct mod_kallsyms)); 153 info->mod_kallsyms_init_off =3D mod->init_layout.size; > 154 mod->init_layout.size +=3D sizeof(struct mod_kallsyms); 155 info->init_typeoffs =3D mod->init_layout.size; 156 mod->init_layout.size +=3D nsrc * sizeof(char); 157 mod->init_layout.size =3D debug_align(mod->init_layout.size); 158 } 159 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============7774087930218739529==--