qemu-e2k/linux-user
Kirill A. Shutemov fe3b415231 linux-user: Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets
qemu's page table can be incomple if /proc/self/maps is unavailable or
host allocating a memory with mmap(), so we can't use it to find free
memory area.

New version mmap_find_vma() uses mmap() without MAP_FIXED to find free
memory.

Tested-by: Martin Mohring <martin.mohring@opensuse.org> :

quite some time ago this patch had been sent by Kirill to the QEMU ml.
At that time, the patch was rejected. Now we found out why the current
user mode memory allocator sometimes fails:

- Kernel Bug  linux/fs/proc/task_mmu.c (fixed after 2.6.27)
http://bugzilla.kernel.org/attachment.cgi?id=17219
- use of proc file system to find memory mappings => bad idea

So I please apply the attached patch from Kirill to qemu to fix this
longstanding bug, because it causes all older linux distros (using
kernel 2.6.26 or older) to fail the QEMU memory allocator in user mode.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:35 +03:00
..
alpha
arm rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN 2009-07-27 14:09:21 -05:00
cris
i386
m68k
microblaze
mips
mips64
mipsn32
ppc Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00
sh4
sparc
sparc64
x86_64
elfload32.c
elfload.c Fix symfind. 2009-08-10 13:05:25 -05:00
errno_defs.h
flat.h
flatload.c Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00
ioctls.h
linux_loop.h
linuxload.c More NULL pointer fixes 2009-08-01 10:13:20 +00:00
m68k-sim.c Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00
main.c Replace local ADDRX/PADDRX macros with TARGET_FMT_lx/plx 2009-08-16 11:13:18 +00:00
mmap.c linux-user: Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets 2009-08-25 17:15:35 +03:00
qemu-types.h
qemu.h user: compile path.c only once 2009-08-15 07:51:59 +00:00
signal.c m68k, linux-user: add setup_rt_frame 2009-08-25 17:15:34 +03:00
socket.h
strace.c
strace.list
syscall_defs.h linux-user: fcntl fixes for LTP 2009-08-25 17:15:34 +03:00
syscall_types.h
syscall.c linux-user: zero fstat buffer to initialize nsec fields 2009-08-25 17:15:35 +03:00
uaccess.c
vm86.c Update to a hopefully more future proof FSF address 2009-07-16 20:47:01 +00:00