linux-user: Fix mmap_find_vma returning invalid addresses.
commit14f24e1465edc44b9b4d89fbbea66e06088154e1
authorRichard Henderson <rth@twiddle.net>
Wed, 10 Mar 2010 23:39:07 +0000 (10 15:39 -0800)
committerPaul Brook <paul@codesourcery.com>
Fri, 12 Mar 2010 16:29:18 +0000 (12 16:29 +0000)
treea4d7af58d82337b45a4566a5c3f7d3d15b18a584
parent7bc7b099dfa38a856b1bc892c0f9f3d6fe28e170
linux-user: Fix mmap_find_vma returning invalid addresses.

Don't return addresses that aren't properly aligned for the guest,
e.g. when the guest has a larger page size than the host.  Don't
return addresses that are outside the virtual address space for the
target, by paying proper attention to the h2g/g2h macros.

At the same time, place the default mapping base for 64-bit guests
(on 64-bit hosts) outside the low 4G.  Consistently interpret
mmap_next_start in the guest address space.

Signed-off-by: Richard Henderson <rth@twiddle.net>
linux-user/main.c
linux-user/mmap.c
linux-user/qemu.h