From: Richard Henderson <rth@twiddle.net>
To: Mike McCormack <mj.mccormack@samsung.com>
Cc: riku.voipio@iki.fi, qemu-devel@nongnu.org,
Scratchbox-devel@lists.scratchbox.org
Subject: Re: [Qemu-devel] [PATCH/RFC] Port Wine preloader to QEMU
Date: Tue, 19 Apr 2011 08:33:18 -0700 [thread overview]
Message-ID: <4DADAB3E.3060502@twiddle.net> (raw)
In-Reply-To: <4DAD53B5.9040001@samsung.com>
On 04/19/2011 02:19 AM, Mike McCormack wrote:
> This is the only way I know to get qemu 0.14.0 to work reliably
> with Scratchbox 2 (libsb2.so)
>
> The problem stems from two things:
>
> * The shared object loader is permitted to load LD_PRELOAD objects
> below the QEMU load address (0x60000000), and does this with libsb2.so
>
> * QEMU's do_brk() (linux-user/syscall.c #738) uses MAP_FIXED, which
> means after allocating enough memory, libsb2.so is clobbered.
>
> I have tried:
>
> * using plain QEMU 0.14.0 - crashes build perl
>
> * QEMU 0.14.0, appending -R 512M to qemu's command line in
> scratchbox2/lua_scripts/argvenvp.lua, but
> still get crashes when building perl.
>
> * modifying do_brk to not use MAP_FIXED - causes an out of memory
> failure rather than a crash
Did you try --enable-user-pie? It may not really help, but I'm curious.
Honestly I'm not keen on this patch. This level of obfuscation on the
startup and memory map of the host binary is just a gross hack working
around the lack of proper page tables in user mode.
If you really really need to get this working with a 32-bit host binary
(rather than doing the sensible thing and using a 64-bit PIE binary),
then working to enable CONFIG_SOFTMMU in user mode instead would be the
most useful thing you could do. Indeed, this would fix a number of
problems we currently have emulating other guests that have a page size
different from the host.
r~
next prev parent reply other threads:[~2011-04-19 15:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 9:19 [Qemu-devel] [PATCH/RFC] Port Wine preloader to QEMU Mike McCormack
2011-04-19 15:33 ` Richard Henderson [this message]
2011-04-20 1:04 ` Mike McCormack
2011-04-19 15:48 ` Riku Voipio
2011-04-19 16:19 ` Peter Maydell
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=4DADAB3E.3060502@twiddle.net \
--to=rth@twiddle.net \
--cc=Scratchbox-devel@lists.scratchbox.org \
--cc=mj.mccormack@samsung.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).