qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vince Weaver <vince@csl.cornell.edu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] linux-user mremap()
Date: Fri, 26 Sep 2008 14:24:43 -0400 (EDT)	[thread overview]
Message-ID: <20080926142222.U24737@stanley.csl.cornell.edu> (raw)


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




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 {

             reply	other threads:[~2008-09-26 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 18:24 Vince Weaver [this message]
2008-09-27  5:17 ` [Qemu-devel] linux-user mremap() Kirill A. Shutemov
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=20080926142222.U24737@stanley.csl.cornell.edu \
    --to=vince@csl.cornell.edu \
    --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).