From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brWYS-0008Vp-MD for qemu-devel@nongnu.org; Tue, 04 Oct 2016 16:43:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brWYR-0001ad-Jc for qemu-devel@nongnu.org; Tue, 04 Oct 2016 16:43:12 -0400 Received: from mail-vk0-x230.google.com ([2607:f8b0:400c:c05::230]:33492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brWYR-0001aV-6b for qemu-devel@nongnu.org; Tue, 04 Oct 2016 16:43:11 -0400 Received: by mail-vk0-x230.google.com with SMTP id z126so202769502vkd.0 for ; Tue, 04 Oct 2016 13:43:11 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20161004180516.65847-5-aleksandar.markovic@rt-rk.com> References: <20161004180516.65847-1-aleksandar.markovic@rt-rk.com> <20161004180516.65847-5-aleksandar.markovic@rt-rk.com> From: Peter Maydell Date: Tue, 4 Oct 2016 13:42:50 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 4/4] linux-user: Fix fadvise64() syscall support for Mips32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandar Markovic Cc: QEMU Developers , Riku Voipio , Laurent Vivier , Aurelien Jarno , Yongbok Kim , Leon Alrae , Petar Jovanovic , Miodrag Dinic , aleksandar.rikalo@imgtec.com, Aleksandar Markovic On 4 October 2016 at 11:05, Aleksandar Markovic wrote: > From: Aleksandar Markovic > > By looking at the file arch/mips/kernel/sys.S in Linux kernel, There doesn't appear to be a file by that name: http://lxr.free-electrons.com/source/arch/mips/kernel/ > it can be deduced that, for Mips32 platform, syscall > corresponding to number _NR_fadvise64 translates to kernel > function sys_fadvise64_64, and that argument layout is as > follows: > 0 32 0 32 > +----------------+----------------+ > (arg1) | fd | __pad | (arg2) > +----------------+----------------+ > (arg3) | buffer | (arg4) > +----------------+----------------+ > (arg5) | len | (arg6) > +----------------+----------------+ > (arg7) | advise | not used | (arg8) > +----------------+----------------+ > > This can be deduced from glibc code as well, and relevant commits > in linux kernel and glibc. > > Mips32 uniqness is that it does not define _NR_fadvise64_64, > however its fadvise64 implemantation is identical to > fadvise64_64 impleanentation on most other platforms. > > This patch also fixes the failure LTP test posix_fadvise03, if > executed on Qemu-emulated Mips32 platform (user mode). We could alternatively fix this by having #define TARGET_NR_fadvise64_64 (TARGET_NR_Linux + 254) in linux-user/mips/syscall_nr.h rather than #define TARGET_NR_fadvise64 (TARGET_NR_Linux + 254) right? thanks -- PMM