* WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
@ 2024-08-21 23:24 kernel test robot
2024-08-22 8:23 ` WARNING: [xtensa] " Przemek Kitszel
0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2024-08-21 23:24 UTC (permalink / raw)
To: Pawel Chmielewski
Cc: oe-kbuild-all, linux-kernel, Jacob Keller, Przemek Kitszel,
Paul Greenwalt, Simon Horman
Hi Pawel,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b311c1b497e51a628aa89e7cb954481e5f9dced2
commit: 982b0192db455d288fc1deb06632f529c35daa15 ice: Refactor finding advertised link speed
date: 10 months ago
config: xtensa-randconfig-r123-20240821 (https://download.01.org/0day-ci/archive/20240822/202408220755.LlaA10C6-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 14.1.0
reproduce: (https://download.01.org/0day-ci/archive/20240822/202408220755.LlaA10C6-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408220755.LlaA10C6-lkp@intel.com/
All warnings (new ones prefixed by >>, old ones prefixed by <<):
WARNING: modpost: missing MODULE_DESCRIPTION() in vmlinux.o
WARNING: modpost: vmlinux: section mismatch in reference: put_page+0x78 (section: .text.unlikely) -> initcall_level_names (section: .init.data)
>> WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x30 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x4c (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x68 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x84 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xa0 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xbc (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xd8 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xf4 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) 2024-08-21 23:24 WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) kernel test robot @ 2024-08-22 8:23 ` Przemek Kitszel 2024-08-24 6:41 ` Max Filippov 0 siblings, 1 reply; 6+ messages in thread From: Przemek Kitszel @ 2024-08-22 8:23 UTC (permalink / raw) To: kernel test robot, oe-kbuild-all, Max Filippov Cc: linux-kernel, Pawel Chmielewski, Jacob Keller, Paul Greenwalt, Simon Horman, Tony Nguyen On 8/22/24 01:24, kernel test robot wrote: > Hi Pawel, > > FYI, the error/warning still remains. Apologies that we did not replied to the original report. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: b311c1b497e51a628aa89e7cb954481e5f9dced2 > commit: 982b0192db455d288fc1deb06632f529c35daa15 ice: Refactor finding advertised link speed > date: 10 months ago > config: xtensa-randconfig-r123-20240821 (https://download.01.org/0day-ci/archive/20240822/202408220755.LlaA10C6-lkp@intel.com/config) I wonder why there is 6.6 kernel used, perhaps not a big deal. > compiler: xtensa-linux-gcc (GCC) 14.1.0 > reproduce: (https://download.01.org/0day-ci/archive/20240822/202408220755.LlaA10C6-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202408220755.LlaA10C6-lkp@intel.com/ > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > WARNING: modpost: missing MODULE_DESCRIPTION() in vmlinux.o > WARNING: modpost: vmlinux: section mismatch in reference: put_page+0x78 (section: .text.unlikely) -> initcall_level_names (section: .init.data) >>> WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) I have spent just half of hour on that and I'm clueless. For reference, the driver code is: static const u32 arr_name[] __initconst = { SOME_CONST, }; and core kernel has: #define __initconst __section(.init.rodata) @Max Filippov, you have authored much of xtensa arch for kernel, especially XIP support, and touched .init.rodata back then; perhaps you have any idea what is going here? > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x30 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x4c (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x68 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x84 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xa0 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xbc (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xd8 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0xf4 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) 2024-08-22 8:23 ` WARNING: [xtensa] " Przemek Kitszel @ 2024-08-24 6:41 ` Max Filippov 2024-08-26 8:53 ` Przemek Kitszel 2024-12-04 23:05 ` Al Viro 0 siblings, 2 replies; 6+ messages in thread From: Max Filippov @ 2024-08-24 6:41 UTC (permalink / raw) To: Przemek Kitszel Cc: kernel test robot, oe-kbuild-all, linux-kernel, Pawel Chmielewski, Jacob Keller, Paul Greenwalt, Simon Horman, Tony Nguyen Hi Przemek, On Thu, Aug 22, 2024 at 1:23 AM Przemek Kitszel <przemyslaw.kitszel@intel.com> wrote: > > WARNING: modpost: missing MODULE_DESCRIPTION() in vmlinux.o > > WARNING: modpost: vmlinux: section mismatch in reference: put_page+0x78 (section: .text.unlikely) -> initcall_level_names (section: .init.data) > >>> WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) > > I have spent just half of hour on that and I'm clueless. > > For reference, the driver code is: > static const u32 arr_name[] __initconst = { > SOME_CONST, > }; > and core kernel has: > #define __initconst __section(.init.rodata) > > > @Max Filippov, you have authored much of xtensa arch for kernel, > especially XIP support, and touched .init.rodata back then; > perhaps you have any idea what is going here? I see the following: static struct ethtool_forced_speed_map ice_adv_lnk_speed_maps[] __ro_after_init = { ETHTOOL_FORCED_SPEED_MAP(ice_adv_lnk_speed, 100), that array goes into the .data, but ETHTOOL_FORCED_SPEED_MAP expands to the following: #define ETHTOOL_FORCED_SPEED_MAP(prefix, value) \ { \ .speed = SPEED_##value, \ .cap_arr = prefix##_##value, \ .arr_size = ARRAY_SIZE(prefix##_##value), \ } so the first entry of that array quoted above above gets the following initializer: .cap_arr = ice_adv_lnk_speed_100, and ice_adv_lnk_speed_100 is defined as static const u32 ice_adv_lnk_speed_100[] __initconst = { so this array goes into .init.rodata. That's a reference from .data to .init.rodata that upsets the modpost checker. I see that modpost incorrectly deduces where this link points (it's ice_adv_lnk_speed_*, not __setup_str_initcall_blacklist). I also see that this link is not used after the init phase, so it's harmless. -- Thanks. -- Max ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) 2024-08-24 6:41 ` Max Filippov @ 2024-08-26 8:53 ` Przemek Kitszel 2024-12-04 23:05 ` Al Viro 1 sibling, 0 replies; 6+ messages in thread From: Przemek Kitszel @ 2024-08-26 8:53 UTC (permalink / raw) To: Max Filippov Cc: kernel test robot, oe-kbuild-all, linux-kernel, Pawel Chmielewski, Jacob Keller, Paul Greenwalt, Simon Horman, Tony Nguyen On 8/24/24 08:41, Max Filippov wrote: > Hi Przemek, > > On Thu, Aug 22, 2024 at 1:23 AM Przemek Kitszel > <przemyslaw.kitszel@intel.com> wrote: >>> WARNING: modpost: missing MODULE_DESCRIPTION() in vmlinux.o >>> WARNING: modpost: vmlinux: section mismatch in reference: put_page+0x78 (section: .text.unlikely) -> initcall_level_names (section: .init.data) >>>>> WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) >> >> I have spent just half of hour on that and I'm clueless. >> >> For reference, the driver code is: >> static const u32 arr_name[] __initconst = { >> SOME_CONST, >> }; >> and core kernel has: >> #define __initconst __section(.init.rodata) >> >> >> @Max Filippov, you have authored much of xtensa arch for kernel, >> especially XIP support, and touched .init.rodata back then; >> perhaps you have any idea what is going here? > > I see the following: > > static struct ethtool_forced_speed_map ice_adv_lnk_speed_maps[] > __ro_after_init = { > ETHTOOL_FORCED_SPEED_MAP(ice_adv_lnk_speed, 100), > > that array goes into the .data, but ETHTOOL_FORCED_SPEED_MAP > expands to the following: > > #define ETHTOOL_FORCED_SPEED_MAP(prefix, value) \ > { \ > .speed = SPEED_##value, \ > .cap_arr = prefix##_##value, \ > .arr_size = ARRAY_SIZE(prefix##_##value), \ > } > > so the first entry of that array quoted above above gets the following > initializer: > > .cap_arr = ice_adv_lnk_speed_100, > > and ice_adv_lnk_speed_100 is defined as > > static const u32 ice_adv_lnk_speed_100[] __initconst = { > > so this array goes into .init.rodata. > That's a reference from .data to .init.rodata that upsets the modpost checker. > I see that modpost incorrectly deduces where this link points (it's > ice_adv_lnk_speed_*, not __setup_str_initcall_blacklist). > I also see that this link is not used after the init phase, so it's harmless. > Thank you very much for the analysis :) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) 2024-08-24 6:41 ` Max Filippov 2024-08-26 8:53 ` Przemek Kitszel @ 2024-12-04 23:05 ` Al Viro 2024-12-06 12:47 ` Max Filippov 1 sibling, 1 reply; 6+ messages in thread From: Al Viro @ 2024-12-04 23:05 UTC (permalink / raw) To: Max Filippov Cc: Przemek Kitszel, kernel test robot, oe-kbuild-all, linux-kernel, Pawel Chmielewski, Jacob Keller, Paul Greenwalt, Simon Horman, Tony Nguyen On Fri, Aug 23, 2024 at 11:41:17PM -0700, Max Filippov wrote: > static struct ethtool_forced_speed_map ice_adv_lnk_speed_maps[] > __ro_after_init = { > ETHTOOL_FORCED_SPEED_MAP(ice_adv_lnk_speed, 100), > > that array goes into the .data, ... due to #define __ro_after_init __read_mostly in your asm/cache.h, instead of the usual .data..ro_after_init, which would be enough for modpost to assume that driver knows what it's doing and won't access the dangling pointers to .init.rodata in there after the initmem had been freed. The same goes for qed and the same thing happens on openrisc, for exact same reason. While we are at it, that might as well had been #define __ro_after_init since __read_mostly is not defined on xtensa and default is empty. If you don't want that stuff to go into RODATA, why not simply define an empty RO_AFTER_INIT_DATA in your vmlinux.lds and put those sections explicitly there, along with the data ones, as e.g. s390 does? Or arch/arm/kernel/vmlinux-xip.lds.S, for that matter... ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) 2024-12-04 23:05 ` Al Viro @ 2024-12-06 12:47 ` Max Filippov 0 siblings, 0 replies; 6+ messages in thread From: Max Filippov @ 2024-12-06 12:47 UTC (permalink / raw) To: Al Viro Cc: Przemek Kitszel, kernel test robot, oe-kbuild-all, linux-kernel, Pawel Chmielewski, Jacob Keller, Paul Greenwalt, Simon Horman, Tony Nguyen On Wed, Dec 4, 2024 at 3:05 PM Al Viro <viro@zeniv.linux.org.uk> wrote: > > On Fri, Aug 23, 2024 at 11:41:17PM -0700, Max Filippov wrote: > > > static struct ethtool_forced_speed_map ice_adv_lnk_speed_maps[] > > __ro_after_init = { > > ETHTOOL_FORCED_SPEED_MAP(ice_adv_lnk_speed, 100), > > > > that array goes into the .data, > > ... due to > > #define __ro_after_init __read_mostly > > in your asm/cache.h, Oh, the trail leads back to me (: > instead of the usual .data..ro_after_init, > which would be enough for modpost to assume that driver knows > what it's doing and won't access the dangling pointers to > .init.rodata in there after the initmem had been freed. > > The same goes for qed and the same thing happens on openrisc, > for exact same reason. > > While we are at it, that might as well had been > #define __ro_after_init > since __read_mostly is not defined on xtensa and default is empty. > > If you don't want that stuff to go into RODATA, why not > simply define an empty RO_AFTER_INIT_DATA in your vmlinux.lds > and put those sections explicitly there, along with the data ones, > as e.g. s390 does? Or arch/arm/kernel/vmlinux-xip.lds.S, > for that matter... I'll do that, thanks for digging into it. -- Thanks. -- Max ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-06 12:47 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-08-21 23:24 WARNING: modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata) kernel test robot 2024-08-22 8:23 ` WARNING: [xtensa] " Przemek Kitszel 2024-08-24 6:41 ` Max Filippov 2024-08-26 8:53 ` Przemek Kitszel 2024-12-04 23:05 ` Al Viro 2024-12-06 12:47 ` Max Filippov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox