[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 19/22] linux-user: Fix fadvise64() syscall support
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL v2 19/22] linux-user: Fix fadvise64() syscall support for Mips32 |
Date: |
Tue, 18 Oct 2016 16:21:47 +0300 |
From: Aleksandar Markovic <address@hidden>
By looking at the file arch/mips/kernel/scall32-o32.S in Linux
kernel, it can be deduced that, for Mips32 platform, syscall
corresponding to number _NR_fadvise64 as defined in kernel file
arch/mips/include/uapi/asm/unistd.h translates to kernel function
sys_fadvise64_64, and that argument layout for this system call is
as follows:
0 32 0 32
+----------------+----------------+
(arg1) | fd | __pad | (arg2)
+----------------+----------------+
(arg3) | buffer | (arg4)
+----------------+----------------+
(arg5) | len | (arg6)
+----------------+----------------+
(arg7) | advise | not used | (arg8)
+----------------+----------------+
The same argument layout can be deduced from glibc code, and
relevant commit messages in linux kernel and glibc.
The fix is to change TARGET_NR_fadvise64 to TARGET_NR_fadvise64_64
in Mips32 syscall numbers table. Array mips_syscall_args[] in
linux-user/main.c also already have "fadvise64_64" (and not
"fadvise64") in corresponding place for the syscall number in
question, so no change for linux-user/main.c.
This patch also fixes the failure LTP test posix_fadvise03, if
executed on Qemu-emulated Mips32 platform (user mode).
Signed-off-by: Aleksandar Rikalo <address@hidden>
Signed-off-by: Miroslav Tisma <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/mips/syscall_nr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/mips/syscall_nr.h b/linux-user/mips/syscall_nr.h
index 6819f86..ced3280 100644
--- a/linux-user/mips/syscall_nr.h
+++ b/linux-user/mips/syscall_nr.h
@@ -256,7 +256,7 @@
#define TARGET_NR_remap_file_pages (TARGET_NR_Linux + 251)
#define TARGET_NR_set_tid_address (TARGET_NR_Linux + 252)
#define TARGET_NR_restart_syscall (TARGET_NR_Linux + 253)
-#define TARGET_NR_fadvise64 (TARGET_NR_Linux + 254)
+#define TARGET_NR_fadvise64_64 (TARGET_NR_Linux + 254)
#define TARGET_NR_statfs64 (TARGET_NR_Linux + 255)
#define TARGET_NR_fstatfs64 (TARGET_NR_Linux + 256)
#define TARGET_NR_timer_create (TARGET_NR_Linux + 257)
--
2.1.4
- [Qemu-devel] [PULL v2 05/22] linux-user: Fix socketcall() syscall support, (continued)
- [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, 2016/10/18
- [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 <=
- [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
- [Qemu-devel] [PULL v2 22/22] linux-user: disable unicore32 linux-user build, riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 20/22] linux-user: added support for preadv() system call., riku . voipio, 2016/10/18
- [Qemu-devel] [PULL v2 21/22] linux-user: added support for pwritev() system call., riku . voipio, 2016/10/18
- Re: [Qemu-devel] [PULL v2 00/22] linux-user changes, Peter Maydell, 2016/10/18