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

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-)

Is there an easy way to adjust the current x86_64 module loader to deal 
with UML "positive" relocations?

Thanks,
//richard

P.s: Just removing the overflow-check does not fix the problem. ;-)

             reply	other threads:[~2011-08-22 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 21:38 Richard Weinberger [this message]
2011-08-23  3:52 ` [RFC] UML/x86_64 module loader 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=4E52CC63.5070201@nod.at \
    --to=richard@nod.at \
    --cc=akpm@linux-foundation.org \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --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