qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] linux-user mremap()
Date: Sat, 27 Sep 2008 08:17:29 +0300	[thread overview]
Message-ID: <20080927051727.GA31531@localhost.localdomain> (raw)
In-Reply-To: <20080926142222.U24737@stanley.csl.cornell.edu>

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

On Fri, Sep 26, 2008 at 02:24:43PM -0400, Vince Weaver wrote:
> 
> Until the linux-user mremap() problem is fixed (the one where a 64-bit 
> value can be returned even on a 32-bit target), might it make sense to 
> apply a patch like this?
> 
> This will at least let users know what the problem is, instead of just 
> segfaulting.
> 
> Vince

If host is x86_64, use MAP_32BIT.

> 
> 
> 
> 
> Index: mmap.c
> ===================================================================
> --- mmap.c	(revision 5321)
> +++ mmap.c	(working copy)
> @@ -538,6 +538,13 @@
>       mmap_lock();
>       /* XXX: use 5 args syscall */
>       host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
> +#if TARGET_ABI_BITS == 32
> +    if (host_addr > 0xffffffff) {
> +       printf("ERROR!  mremap() returned 64-bit value on 32-bit target!\n\n");
> +       exit(-1); 
> +    }
> +#endif 
> +
>       if (host_addr == -1) {
>           new_addr = -1;
>       } else {
> 
> 

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-09-27  5:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 18:24 [Qemu-devel] linux-user mremap() Vince Weaver
2008-09-27  5:17 ` Kirill A. Shutemov [this message]
2008-09-27 17:01   ` Vince Weaver

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=20080927051727.GA31531@localhost.localdomain \
    --to=kirill@shutemov.name \
    --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).