public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rob Herring (Arm)" <robh@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] modpost: check section mismatch in reference to .dtb.init.rodata
Date: Wed, 11 Sep 2024 12:32:35 -0500	[thread overview]
Message-ID: <172607595481.1006814.4998124247259811209.robh@kernel.org> (raw)
In-Reply-To: <20240910094459.352572-1-masahiroy@kernel.org>


On Tue, 10 Sep 2024 18:44:52 +0900, Masahiro Yamada wrote:
> Built-in DTB files are discarded because KERNEL_DTB() is a part of
> INIT_DATA, as defined in include/asm-generic/vmlinux.lds.h.
> 
> Currently, modpost warns about mismatched section references to init
> data only when the destination section is prefixed with ".init.".
> However, ".dtb.init.rodata" is also discarded.
> 
> This commit has revealed some missing annotations.
> 
> overlays[] references builtin DTBs, which become dangling pointers
> after early boot.
> 
> testdrv_probe() is not an __init function, yet it holds a reference to
> overlays[]. The assumption is that this function is executed only at
> the boot time even though it remains in memory. I annotated it as __ref
> because otherwise I do not know how to suppress the modpost warning.
> 
> I marked the dtb_start as __initdata in the Xtensa boot code, although
> modpost does not warn about it because __dtb_start is not yet defined
> at the time of modpost.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
> Changes in v2:
>   - New patch
> 
>  arch/xtensa/kernel/setup.c | 2 +-
>  drivers/of/unittest.c      | 5 +++--
>  scripts/mod/modpost.c      | 2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)
> 

Acked-by: Rob Herring (Arm) <robh@kernel.org>


      parent reply	other threads:[~2024-09-11 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  9:44 [PATCH v2 1/3] modpost: check section mismatch in reference to .dtb.init.rodata Masahiro Yamada
2024-09-10  9:44 ` [PATCH v2 2/3] kbuild: move non-boot builtin DTBs to .init.rodata section Masahiro Yamada
2024-09-10  9:44 ` [PATCH v2 3/3] kbuild: add generic support for built-in boot DTBs Masahiro Yamada
2024-09-11 17:32 ` Rob Herring (Arm) [this message]

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=172607595481.1006814.4998124247259811209.robh@kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=robh+dt@kernel.org \
    /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