qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] Re: linux-user issues
Date: Sun, 14 Mar 2010 15:11:30 +0000	[thread overview]
Message-ID: <201003141511.31253.paul@codesourcery.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1003130504460.1405@linmac>

> On Sat, 13 Mar 2010, Paul Brook wrote:
> > > a) elfload.c:859
> > >
> > >    #define TARGET_ELF_PAGESTART(_v) ((_v) & ~(unsigned
> > >  long)(TARGET_ELF_EXEC_PAGESIZE-1))
> > >
> > >    This means that for 64bit guest on a 32bit host the _v's value is
> > >    silently reduced to 32bit, the cast should be abi_ulong.
> > >
> > > b) mmap.c:428
> > >
> > >    real_start = start & qemu_host_page_mask;
> > >
> > >    Same thing basically qemu_host_page_mask is unsigned long and so
> > >    the upper bits are sliently cleared. Again qemu_host_page_mask
> > >    should probably be abi_ulong.
> > >
> > > The above two make elf binary with one of the segments above 4G load
> > > and run on 32bit guest only to fail well into execution and without
> > > any indication that it shouldn't have been allowed to run in the first
> > > place.
> >
> > I'd be amazed if these are the only two issues, and expect 64-bit guests
> > on 32-bit hosts to be generally unsafe.
> 
> These are the two issues i've been bitten by while trying to solve
> x86_64's far jumps, if you are okay with code silently misbehaving
> fine by me.

I never said this was ok behavior. Only that you've probably only discovered 
the tip of the iceberg.

Paul

  reply	other threads:[~2010-03-14 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13  0:21 [Qemu-devel] linux-user issues malc
2010-03-13  0:45 ` [Qemu-devel] " Paul Brook
2010-03-13  2:06   ` malc
2010-03-14 15:11     ` Paul Brook [this message]
2010-03-14 15:36       ` malc
2010-03-14 23:37         ` malc

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=201003141511.31253.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=aurelien@aurel32.net \
    --cc=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.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).