public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Richard Weinberger <richard@nod.at>, linux-kernel@vger.kernel.org
Cc: x86@kernel.org, rostedt@goodmis.org, jbaron@redhat.com,
	akpm@linux-foundation.org, vapier@gentoo.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [RFC] UML/x86_64 module loader
Date: Tue, 23 Aug 2011 13:22:18 +0930	[thread overview]
Message-ID: <878vqk4wel.fsf@rustcorp.com.au> (raw)
In-Reply-To: <4E52CC63.5070201@nod.at>

On Mon, 22 Aug 2011 23:38:43 +0200, Richard Weinberger <richard@nod.at> wrote:
> Hi!
> 
> UserModeLinux is using the arch specific module functions from 
> arch/x86/kernel/module.c.
> On i386 this works perfectly fine but on x86_64 it causes problems.
> 
> apply_relocate_add() assumes modules compiled with -mcmodel=kernel 
> because the kernel lives in the negative 2GiB of the address space.
> This assumption is not true for UML.
> On an UML instance with more than 512MiB of memory no modules can be 
> loaded because vmalloc() locates the module near the 2GiB limit and the
> ELF relocations causes an overflow. (Detected by "if ((s64)val != *(s32 
> *)loc)" in apply_relocate_add()).
> 
> Now I'm not sure how to fix this.
> Mostly because I'm not a module loader nor an ELF expert. 8-)

I think you need to write your own routines.  It shouldn't be that hard,
just keep implementing relocations until you're done :)

Cheers,
Rusty.

      reply	other threads:[~2011-08-23  3:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 21:38 [RFC] UML/x86_64 module loader Richard Weinberger
2011-08-23  3:52 ` Rusty Russell [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=878vqk4wel.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=rostedt@goodmis.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=vapier@gentoo.org \
    --cc=x86@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