[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 12/22] linux-user: use libc wrapper instead of dir
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL v2 12/22] linux-user: use libc wrapper instead of direct mremap syscall |
Date: |
Tue, 18 Oct 2016 16:21:40 +0300 |
From: Felix Janda <address@hidden>
This commit essentially reverts commit
3af72a4d98dca033492102603734cbc63cd2694a, which has replaced
five-argument calls to mremap() by direct mremap syscalls for
compatibility with glibc older than version 2.4.
The direct syscall was buggy for 64bit targets on 32bit hosts
because of the default integer type promotions. Since glibc-2.4
is now a decade old, we can remove this workaround.
Signed-off-by: Felix Janda <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/mmap.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index c4371d9..ffd099d 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -17,8 +17,6 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
-#include <linux/mman.h>
-#include <linux/unistd.h>
#include "qemu.h"
#include "qemu-common.h"
@@ -681,10 +679,8 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong
old_size,
mmap_lock();
if (flags & MREMAP_FIXED) {
- host_addr = (void *) syscall(__NR_mremap, g2h(old_addr),
- old_size, new_size,
- flags,
- g2h(new_addr));
+ host_addr = mremap(g2h(old_addr), old_size, new_size,
+ flags, g2h(new_addr));
if (reserved_va && host_addr != MAP_FAILED) {
/* If new and old addresses overlap then the above mremap will
@@ -700,10 +696,8 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong
old_size,
errno = ENOMEM;
host_addr = MAP_FAILED;
} else {
- host_addr = (void *) syscall(__NR_mremap, g2h(old_addr),
- old_size, new_size,
- flags | MREMAP_FIXED,
- g2h(mmap_start));
+ host_addr = mremap(g2h(old_addr), old_size, new_size,
+ flags | MREMAP_FIXED, g2h(mmap_start));
if (reserved_va) {
mmap_reserve(old_addr, old_size);
}
--
2.1.4
- [Qemu-devel] [PULL v2 00/22] linux-user changes, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 03/22] linux-user: Fix mq_open() syscall support, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 04/22] linux-user: Fix msgrcv() and msgsnd() syscalls support, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 02/22] linux-user: Add support for ustat() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 01/22] linux-user: Add support for adjtimex() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 07/22] linux-user: Remove a duplicate item from strace.list, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 05/22] linux-user: Fix socketcall() syscall support, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 11/22] linux-user: Don't use alloca() for epoll_wait's epoll event array, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 08/22] linux-user: sparc64: Use correct target SHMLBA in shmat(), riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 12/22] linux-user: use libc wrapper instead of direct mremap syscall,
riku . voipio <=
- [Qemu-devel] [PULL v2 13/22] linux-user: Fix definition of target_sigevent for 32-bit guests, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 09/22] linux-user: add kcmp() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 16/22] linux-user: Update mips_syscall_args[] array in main.c, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 06/22] linux-user: Fix syslog() syscall support, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 10/22] linux-user: add RTA_PRIORITY in netlink, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 14/22] linux-user: Add support for clock_adjtime() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 19/22] linux-user: Fix fadvise64() syscall support for Mips32, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 15/22] linux-user: Add support for syncfs() syscall, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 17/22] linux-user: Update ioctls definitions for Mips32, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 18/22] linux-user: Redirect termbits.h for Mips64 to termbits.h for Mips32, riku . voipio, 2016/10/18