Linux-Modules Archive mirror
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: linux-modules@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Jessica Yu <jeyu@kernel.org>,
	james.morse@arm.com, Adam Johnston <adam.johnston@arm.com>
Subject: [PATCH 0/3] ARM/arm64: Fix loading of modules with an exit section
Date: Tue,  1 Aug 2023 14:54:06 +0000	[thread overview]
Message-ID: <20230801145409.8935-1-james.morse@arm.com> (raw)

Adam reports that Yocto can't load modules on arm64. This turns out to be due
to the arch code disagreeing with the core code when it comes to the layout
of the modules exit text, resulting in a shortage of PLTs and a bunch of
warnings.

arm and arm64 are unusual here as they are counting the PLTs based on the
section name. This series exposes the helper that core code uses to decide
the layout.

I've been unable to reproduce the behaviour on 32bit - but it looks like
its possible to reach the BUG_ON() in get_module_plt(). To test this, disable
CONFIG_MODULE_UNLOAD, and try to load modules with relocations in their exit
text.

This series is based on v6.5-rc4, and can be retrieved from:
https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git arm64/modules/exit_sections/v1

Thanks,

James Morse (3):
  module: Expose module_init_layout_section()
  arm64: module: Use module_init_layout_section() to spot init sections
  ARM: module: Use module_init_layout_section() to spot init sections

 arch/arm/kernel/module-plts.c   | 2 +-
 arch/arm64/kernel/module-plts.c | 2 +-
 include/linux/moduleloader.h    | 5 +++++
 kernel/module/main.c            | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

-- 
2.39.2


             reply	other threads:[~2023-08-01 14:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 14:54 James Morse [this message]
2023-08-01 14:54 ` [PATCH 1/3] module: Expose module_init_layout_section() James Morse
2023-08-01 14:54 ` [PATCH 2/3] arm64: module: Use module_init_layout_section() to spot init sections James Morse
2023-08-02 17:00   ` Catalin Marinas
2023-08-01 14:54 ` [PATCH 3/3] ARM: " James Morse
2023-08-01 17:14 ` [PATCH 0/3] ARM/arm64: Fix loading of modules with an exit section Luis Chamberlain
2023-08-02 16:28   ` James Morse
2023-08-03 10:20     ` Russell King (Oracle)
2023-08-03 20:43       ` Luis Chamberlain

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=20230801145409.8935-1-james.morse@arm.com \
    --to=james.morse@arm.com \
    --cc=adam.johnston@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=jeyu@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mcgrof@kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=will@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).