From: Russell King <rmk@arm.linux.org.uk>
To: Linux Kernel List <linux-kernel@vger.kernel.org>,
Rusty Russell <rusty@rustcorp.com.au>
Subject: ARM kernel module loader.
Date: Tue, 19 Nov 2002 20:31:29 +0000 [thread overview]
Message-ID: <20021119203128.E5535@flint.arm.linux.org.uk> (raw)
Ok, here's the problem I'm currently facing.
KAO's insmod used to do various fixups (trampolines of 8 bytes in length)
before inserting modules into the kernel on ARM to make sure the PC24
branch relocations were able to reach the kernel binary image in memory.
PC24 relocations have a maximum range of +/- 32MB, and the kernel may be
(on current architectures) up to 256MB to 512MB away.
With Rusty's in-kernel module linker, there's a catch-22 situation here.
The module linker has callouts to architecture code to ask for the size
of various sections before allocating an area.
This is perfect in this situation, since all you need to do is calculate
how many trampolines you'd need to reach the main kernel binary, and add
that onto the core module size.
However, to know how many trampolines you'd need, you need to scan the
relocations and symbols, counting the number of symbols that need
trampolines. The problem here is that we haven't read any of the module
into kernel space, so this information isn't available.
What is available though is the total number of relocations in the file,
which could be massively larger than the number of trampolines required.
(For the time being, ARM has the code implemented that performs the
basic linking, but obviously without the trampolines. Since this
effectively means modules will never work, I've also made module_alloc
always return NULL to force failure until we have a solution.)
Comments? Ideas? Solutions that don't require:
- rewriting the core module loading code
- introducing a vrealloc() function
- wasting lots of memory on trampoline entries that won't be used
Ideally, I'd like to be able to allocate a trampoline table for one
module and re-use trampoline entries for many modules to minimise the
cache impacts.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next reply other threads:[~2002-11-19 20:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-19 20:31 Russell King [this message]
2002-11-19 22:56 ` ARM kernel module loader Paul Mackerras
2002-11-20 7:38 ` Rusty Russell
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=20021119203128.E5535@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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