linux-user/mmap.c: Use end instead of real_end in target_mmap
authorChen Gang <chengang@emindsoft.com.cn>
Thu, 24 Dec 2015 01:07:33 +0000 (09:07 +0800)
committerRiku Voipio <riku.voipio@linaro.org>
Mon, 11 Jan 2016 13:01:47 +0000 (15:01 +0200)
The fragment must effectively be mapped only to "end" not to "real_end"
(which is a host page aligned address, and thus this is not a fragment).
It is consistent with what it is done in the case of one single page.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/mmap.c

index c6c478e552da8a38bfb3313cb2e6350d519b9156..445e8c6785037bf5db4fab5a2c778539ff75672c 100644 (file)
@@ -538,7 +538,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
         /* handle the end of the mapping */
         if (end < real_end) {
             ret = mmap_frag(real_end - qemu_host_page_size,
-                            real_end - qemu_host_page_size, real_end,
+                            real_end - qemu_host_page_size, end,
                             prot, flags, fd,
                             offset + real_end - qemu_host_page_size - start);
             if (ret == -1)