[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] linux-user mremap()
From: |
Kirill A. Shutemov |
Subject: |
Re: [Qemu-devel] linux-user mremap() |
Date: |
Sat, 27 Sep 2008 08:17:29 +0300 |
User-agent: |
Mutt/1.5.18 (2008-05-29) |
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/
signature.asc
Description: Digital signature