public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: kernel test robot <lkp@intel.com>,
	<oe-kbuild-all@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	"Paul Greenwalt" <paul.greenwalt@intel.com>,
	Simon Horman <horms@kernel.org>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>
Subject: Re: WARNING: [xtensa] modpost: vmlinux: section mismatch in reference: ice_adv_lnk_speed_maps+0x14 (section: .data) -> __setup_str_initcall_blacklist (section: .init.rodata)
Date: Mon, 26 Aug 2024 10:53:23 +0200	[thread overview]
Message-ID: <1ea4522b-6e7a-4a34-be88-cb70055e959c@intel.com> (raw)
In-Reply-To: <CAMo8BfJOPNaHb0f3Rf2GyhApCDg5bFfCGETWU9-LBJWiJpLeFw@mail.gmail.com>

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 :)

  reply	other threads:[~2024-08-26  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-12-04 23:05     ` Al Viro
2024-12-06 12:47       ` Max Filippov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ea4522b-6e7a-4a34-be88-cb70055e959c@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paul.greenwalt@intel.com \
    --cc=pawel.chmielewski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox