From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM: mm: Could I change module space size or place modules in vmalloc area?
Date: Tue, 29 Apr 2014 12:19:46 +0100 [thread overview]
Message-ID: <20140429111946.GC26067@arm.com> (raw)
In-Reply-To: <535B1618.5030504@huawei.com>
On Sat, Apr 26, 2014 at 03:12:40AM +0100, Jianguo Wu wrote:
> On 2014/1/3 8:47, Russell King - ARM Linux wrote:
>
> > On Fri, Jan 03, 2014 at 09:39:31AM +0900, Gioh Kim wrote:
> >> Thank you for reply.
> >>
> >>> -----Original Message-----
> >>> From: Baruch Siach [mailto:baruch at tkos.co.il]
> >>> Sent: Thursday, January 02, 2014 7:14 PM
> >>> To: Gioh Kim
> >>> Cc: Russell King; linux-mm at kvack.org; linux-arm-kernel; HyoJun Im
> >>> Subject: Re: ARM: mm: Could I change module space size or place modules in
> >>> vmalloc area?
> >>>
> >>> Hi Gioh,
> >>>
> >>> On Thu, Jan 02, 2014 at 07:04:13PM +0900, Gioh Kim wrote:
> >>>> I run out of module space because I have several big driver modules.
> >>>> I know I can strip the modules to decrease size but I need debug info
> >>> now.
> >>>
> >>> Are you sure you need the debug info in kernel memory? I don't think the
> >>> kernel is actually able to parse DWARF. You can load stripped binaries
> >>> into the kernel, and still use the debug info with whatever tool you have.
> >>
> >> I agree you but driver developers of another team don't agree.
> >> I don't know why but they say they will strip drivers later :-(
> >> So I need to increase modules space size.
> >
> > ARM can only branch relatively within +/- 32MB. Hence, with a module
> > space of 16MB, modules can reach up to a maximum 16MB into the direct-
> > mapped kernel image. As module space increases in size, so that figure
> > decreases. So, if module space were to be 40MB, the maximum size of the
> > kernel binary would be 8MB.
> >
>
> Hi Russell ,Arnd or Will,
>
> I encountered the same situation in arm64, I loaded 80+ modules in arm64, and
> run out of module address space(64M). Why the module space is restricted to 64M,
> can it be expanded?
The module space is restricted to 64M on AArch64 because the range of the BL
instruction is += 128M. In order to call kernel functions, we need to ensure
that this range is large enough and therefore place the modules 64M below the
kernel text, allowing 64M for modules and 64M for the kernel text. We could
probably improve this a bit by assuming a maximum size for the kernel text.
If we want to remove the problem altogether, we'd need to hack the module
loader to insert trampolines (fiddly) or somehow persuade the tools to use
indirect branches (BLR) for all calls (inefficient).
Will
next prev parent reply other threads:[~2014-04-29 11:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 10:04 ARM: mm: Could I change module space size or place modules in vmalloc area? Gioh Kim
2014-01-02 10:13 ` Baruch Siach
2014-01-03 0:39 ` Gioh Kim
2014-01-03 0:47 ` Russell King - ARM Linux
2014-01-03 2:52 ` Gioh Kim
2014-04-26 2:12 ` Jianguo Wu
2014-04-29 11:19 ` Will Deacon [this message]
2014-04-29 11:35 ` Arnd Bergmann
2014-04-29 12:40 ` Will Deacon
2014-01-03 12:10 ` Arnd Bergmann
2014-01-03 12:22 ` Russell King - ARM Linux
2014-01-03 13:23 ` Arnd Bergmann
2014-03-12 6:38 ` Gioh Kim
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=20140429111946.GC26067@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 NNTP newsgroup(s).