From nobody Thu May 16 20:33:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561719161; cv=none; d=zoho.com; s=zohoarc; b=Gs110RTWgiIDeGYpQrdpnuBeIkLvReYCtPcliH2NYZeEgzKcsH3wWD9Ht0u219Sn4T2PLjQsmAdLKrtlKE8pYZgvQNMKUp/2k2wYFT3HnEtH1ljLo81uZxeXgJfv44CYYPofoD0dKaokNTUK6Fdf5zeVKVJ4Z2b4hxVk0t5AO/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561719161; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1iYbn12R7Hc9L0peRGX4Dr9q65RD9qSQ7nXWhKDdjOo=; b=YDsj3VeMVayATeM96pz1Q7ZmXJ870rKkZz8MrMhrnbpWKK0+7cK5x8d15N+/7Il3wdEATkWIuh1Aiba+HWNru9xfT0xUNYfSSezVRTZ1ymHt8iDlK3sZARJET3FxJmrlWf2c+0XgrNSY/o2fvlETK3VATqzKARXd2/CE6TnK2Fc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561719161218862.2383553737742; Fri, 28 Jun 2019 03:52:41 -0700 (PDT) Received: from localhost ([::1]:58798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoUY-0006FJ-QT for importer@patchew.org; Fri, 28 Jun 2019 06:52:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33632) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoMG-0006wk-M1 for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgoME-0000HD-MZ for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:56 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:46549 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgoME-0000GJ-Bm for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:54 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 4ABBF1A2453; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 297851A2015; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Fri, 28 Jun 2019 12:43:34 +0200 Message-Id: <1561718618-20218-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v16 1/5] linux-user: Add support for translation of statx() syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Rikalo Implement support for translation of system call statx(). The implementation is based on "best effort" approach: if host is capable of executing statx(), host statx() is used. If not, the implementation includes invoking a more mature system call fstatat() on the host side to achieve as close as possible functionality. Support for statx() in kernel and glibc was, however, introduced at different points of time (the difference is more than a year): - kernel: Linux 4.11 (30 April 2017) - glibc: glibc 2.28 (1 Aug 2018) In this patch, the availability of statx() support is established via __NR_statx (if it is defined, statx() is considered available). This coincedes with statx() introduction in kernel. However, the structure statx definition may not be available in any header for hosts with glibc older than 2.28 (and it is, by design, to be defined in one of glibc headers), even though the full statx() functionality may be supported in kernel. Hence, a structure "target_statx" is defined in this patch, to remove that dependency on glibc headers, and to use statx() functionality as soon as the host kernel is capable of supporting it. Such statx structure definition is used for both target and host structures statx (of course, this doesn't mean the endian arrangement is the same on target and host - the endian conversion is done in all necessary cases). Signed-off-by: Aleksandar Rikalo Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 115 ++++++++++++++++++++++++++++++++++++++++++= +++- linux-user/syscall_defs.h | 37 +++++++++++++++ 2 files changed, 151 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b187c12..eeca802 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -237,6 +237,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type= 4 arg4,type5 arg5, \ #define __NR_sys_inotify_init __NR_inotify_init #define __NR_sys_inotify_add_watch __NR_inotify_add_watch #define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch +#define __NR_sys_statx __NR_statx =20 #if defined(__alpha__) || defined(__x86_64__) || defined(__s390x__) #define __NR__llseek __NR_lseek @@ -315,6 +316,14 @@ _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, ty= pe, unsigned long, idx1, unsigned long, idx2) #endif =20 +/* + * It is assumed that struct statx is architecture independent. + */ +#if defined(TARGET_NR_statx) && defined(__NR_statx) +_syscall5(int, sys_statx, int, dirfd, const char *, pathname, int, flags, + unsigned int, mask, struct target_statx *, statxbuf) +#endif + static bitmask_transtbl fcntl_flags_tbl[] =3D { { TARGET_O_ACCMODE, TARGET_O_WRONLY, O_ACCMODE, O_WRONLY, }, { TARGET_O_ACCMODE, TARGET_O_RDWR, O_ACCMODE, O_RDWR, }, @@ -6467,6 +6476,48 @@ static inline abi_long host_to_target_stat64(void *c= pu_env, } #endif =20 +#if defined(TARGET_NR_statx) && defined(__NR_statx) +static inline abi_long host_to_target_statx(struct target_statx *host_stx, + abi_ulong target_addr) +{ + struct target_statx *target_stx; + + if (!lock_user_struct(VERIFY_WRITE, target_stx, target_addr, 0)) { + return -TARGET_EFAULT; + } + memset(target_stx, 0, sizeof(*target_stx)); + + __put_user(host_stx->stx_mask, &target_stx->stx_mask); + __put_user(host_stx->stx_blksize, &target_stx->stx_blksize); + __put_user(host_stx->stx_attributes, &target_stx->stx_attributes); + __put_user(host_stx->stx_nlink, &target_stx->stx_nlink); + __put_user(host_stx->stx_uid, &target_stx->stx_uid); + __put_user(host_stx->stx_gid, &target_stx->stx_gid); + __put_user(host_stx->stx_mode, &target_stx->stx_mode); + __put_user(host_stx->stx_ino, &target_stx->stx_ino); + __put_user(host_stx->stx_size, &target_stx->stx_size); + __put_user(host_stx->stx_blocks, &target_stx->stx_blocks); + __put_user(host_stx->stx_attributes_mask, &target_stx->stx_attributes_= mask); + __put_user(host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec); + __put_user(host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec= ); + __put_user(host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec); + __put_user(host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec= ); + __put_user(host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec); + __put_user(host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec= ); + __put_user(host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec); + __put_user(host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec= ); + __put_user(host_stx->stx_rdev_major, &target_stx->stx_rdev_major); + __put_user(host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor); + __put_user(host_stx->stx_dev_major, &target_stx->stx_dev_major); + __put_user(host_stx->stx_dev_minor, &target_stx->stx_dev_minor); + + unlock_user_struct(target_stx, target_addr, 1); + + return 0; +} +#endif + + /* ??? Using host futex calls even when target atomic operations are not really atomic probably breaks things. However implementing futexes locally would make futexes shared between multiple processes @@ -7045,7 +7096,8 @@ static abi_long do_syscall1(void *cpu_env, int num, a= bi_long arg1, abi_long ret; #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) \ || defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64) \ - || defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64) + || defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64) \ + || defined(TARGET_NR_statx) struct stat st; #endif #if defined(TARGET_NR_statfs) || defined(TARGET_NR_statfs64) \ @@ -10123,6 +10175,67 @@ static abi_long do_syscall1(void *cpu_env, int num= , abi_long arg1, ret =3D host_to_target_stat64(cpu_env, arg3, &st); return ret; #endif +#if defined(TARGET_NR_statx) + case TARGET_NR_statx: + { + struct target_statx *target_stx; + int dirfd =3D arg1; + int flags =3D arg3; + + p =3D lock_user_string(arg2); + if (p =3D=3D NULL) { + return -TARGET_EFAULT; + } +#if defined(__NR_statx) + { + /* + * It is assumed that struct statx is architecture indepen= dent. + */ + struct target_statx host_stx; + int mask =3D arg4; + + ret =3D get_errno(sys_statx(dirfd, p, flags, mask, &host_s= tx)); + if (!is_error(ret)) { + if (host_to_target_statx(&host_stx, arg5) !=3D 0) { + unlock_user(p, arg2, 0); + return -TARGET_EFAULT; + } + } + + if (ret !=3D -TARGET_ENOSYS) { + unlock_user(p, arg2, 0); + return ret; + } + } +#endif + ret =3D get_errno(fstatat(dirfd, path(p), &st, flags)); + unlock_user(p, arg2, 0); + + if (!is_error(ret)) { + if (!lock_user_struct(VERIFY_WRITE, target_stx, arg5, 0)) { + return -TARGET_EFAULT; + } + memset(target_stx, 0, sizeof(*target_stx)); + __put_user(major(st.st_dev), &target_stx->stx_dev_major); + __put_user(minor(st.st_dev), &target_stx->stx_dev_minor); + __put_user(st.st_ino, &target_stx->stx_ino); + __put_user(st.st_mode, &target_stx->stx_mode); + __put_user(st.st_uid, &target_stx->stx_uid); + __put_user(st.st_gid, &target_stx->stx_gid); + __put_user(st.st_nlink, &target_stx->stx_nlink); + __put_user(major(st.st_rdev), &target_stx->stx_rdev_major); + __put_user(minor(st.st_rdev), &target_stx->stx_rdev_minor); + __put_user(st.st_size, &target_stx->stx_size); + __put_user(st.st_blksize, &target_stx->stx_blksize); + __put_user(st.st_blocks, &target_stx->stx_blocks); + __put_user(st.st_atime, &target_stx->stx_atime.tv_sec); + __put_user(st.st_mtime, &target_stx->stx_mtime.tv_sec); + __put_user(st.st_ctime, &target_stx->stx_ctime.tv_sec); + unlock_user_struct(target_stx, arg5, 1); + } + } + return ret; +#endif #ifdef TARGET_NR_lchown case TARGET_NR_lchown: if (!(p =3D lock_user_string(arg1))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 7f141f6..170c4dd 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2536,4 +2536,41 @@ struct target_user_cap_data { /* Return size of the log buffer */ #define TARGET_SYSLOG_ACTION_SIZE_BUFFER 10 =20 +struct target_statx_timestamp { + int64_t tv_sec; + uint32_t tv_nsec; + int32_t __reserved; +}; + +struct target_statx { + /* 0x00 */ + uint32_t stx_mask; /* What results were written [uncond] */ + uint32_t stx_blksize; /* Preferred general I/O size [uncond] */ + uint64_t stx_attributes; /* Flags conveying information about the file = */ + /* 0x10 */ + uint32_t stx_nlink; /* Number of hard links */ + uint32_t stx_uid; /* User ID of owner */ + uint32_t stx_gid; /* Group ID of owner */ + uint16_t stx_mode; /* File mode */ + uint16_t __spare0[1]; + /* 0x20 */ + uint64_t stx_ino; /* Inode number */ + uint64_t stx_size; /* File size */ + uint64_t stx_blocks; /* Number of 512-byte blocks allocated */ + uint64_t stx_attributes_mask; /* Mask to show what is supported */ + /* 0x40 */ + struct target_statx_timestamp stx_atime; /* Last access time */ + struct target_statx_timestamp stx_btime; /* File creation time */ + struct target_statx_timestamp stx_ctime; /* Last attribute change tim= e */ + struct target_statx_timestamp stx_mtime; /* Last data modification ti= me */ + /* 0x80 */ + uint32_t stx_rdev_major; /* Device ID of special file [if bdev/cdev] = */ + uint32_t stx_rdev_minor; + uint32_t stx_dev_major; /* ID of device containing file [uncond] */ + uint32_t stx_dev_minor; + /* 0x90 */ + uint64_t __spare2[14]; /* Spare space for future expansion */ + /* 0x100 */ +}; + #endif --=20 2.7.4 From nobody Thu May 16 20:33:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561719334; cv=none; d=zoho.com; s=zohoarc; b=TGYlUqU475M/vqBbVy29SRlytApGtBPr2vhDFWRgu5BZZFzMxE3IylqSKljlXXIvUWi1MroMHZviMMhfVAyxYB0h5PPY6XC6d/0joy9BnfOybY1WQMgaySjb1QQVub4x/fT5ZdBBB49OzrFes9mxqcR+m0UHrKRhgK4aHYjl9gc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561719334; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=o42vo9NVGHMDKxkT2P5363QTMTtrgq9gaVIU6aW58gA=; b=FBZMvtAmB6+xGyEW2FIsWJ4ekP4M9HS4BNtL5qoi1DvfYWwk+PLHMtiMo3YCPdciCifUNebtxXyk2DVt5+E+YSbdClfN3TzV+WDsXmWOiu02JRNdV9hqA1vO0f7ioNg/KciqTHq7v0QGUvkiEeDtH1NTgNhyMJnqfQqSpC+BZrc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156171933461180.07909828714867; Fri, 28 Jun 2019 03:55:34 -0700 (PDT) Received: from localhost ([::1]:58816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoXU-000855-RZ for importer@patchew.org; Fri, 28 Jun 2019 06:55:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33620) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoMG-0006v5-24 for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgoME-0000HQ-Qy for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:55 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:46562 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgoME-0000GO-FZ for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:54 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 5806B1A244F; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 365FA1A2447; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Fri, 28 Jun 2019 12:43:35 +0200 Message-Id: <1561718618-20218-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v16 2/5] linux-user: Add support for strace for statx() syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amarkovic@wavecomp.com, Jim Wilson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jim Wilson All of the flags need to be conditional as old systems don't have statx support. Otherwise it works the same as other stat family syscalls. This requires the pending patch to add statx support. Tested on Ubuntu 16.04 (no host statx) and Ubuntu 19.04 (with host statx) using a riscv32-linux toolchain. Signed-off-by: Jim Wilson Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/strace.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ linux-user/strace.list | 3 ++ 2 files changed, 89 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c index 6f72a74..c80e93b 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -976,6 +976,76 @@ UNUSED static struct flags msg_flags[] =3D { FLAG_END, }; =20 +UNUSED static struct flags statx_flags[] =3D { +#ifdef AT_EMPTY_PATH + FLAG_GENERIC(AT_EMPTY_PATH), +#endif +#ifdef AT_NO_AUTOMOUNT + FLAG_GENERIC(AT_NO_AUTOMOUNT), +#endif +#ifdef AT_SYMLINK_NOFOLLOW + FLAG_GENERIC(AT_SYMLINK_NOFOLLOW), +#endif +#ifdef AT_STATX_SYNC_AS_STAT + FLAG_GENERIC(AT_STATX_SYNC_AS_STAT), +#endif +#ifdef AT_STATX_FORCE_SYNC + FLAG_GENERIC(AT_STATX_FORCE_SYNC), +#endif +#ifdef AT_STATX_DONT_SYNC + FLAG_GENERIC(AT_STATX_DONT_SYNC), +#endif + FLAG_END, +}; + +UNUSED static struct flags statx_mask[] =3D { +/* This must come first, because it includes everything. */ +#ifdef STATX_ALL + FLAG_GENERIC(STATX_ALL), +#endif +/* This must come second; it includes everything except STATX_BTIME. */ +#ifdef STATX_BASIC_STATS + FLAG_GENERIC(STATX_BASIC_STATS), +#endif +#ifdef STATX_TYPE + FLAG_GENERIC(STATX_TYPE), +#endif +#ifdef STATX_MODE + FLAG_GENERIC(STATX_MODE), +#endif +#ifdef STATX_NLINK + FLAG_GENERIC(STATX_NLINK), +#endif +#ifdef STATX_UID + FLAG_GENERIC(STATX_UID), +#endif +#ifdef STATX_GID + FLAG_GENERIC(STATX_GID), +#endif +#ifdef STATX_ATIME + FLAG_GENERIC(STATX_ATIME), +#endif +#ifdef STATX_MTIME + FLAG_GENERIC(STATX_MTIME), +#endif +#ifdef STATX_CTIME + FLAG_GENERIC(STATX_CTIME), +#endif +#ifdef STATX_INO + FLAG_GENERIC(STATX_INO), +#endif +#ifdef STATX_SIZE + FLAG_GENERIC(STATX_SIZE), +#endif +#ifdef STATX_BLOCKS + FLAG_GENERIC(STATX_BLOCKS), +#endif +#ifdef STATX_BTIME + FLAG_GENERIC(STATX_BTIME), +#endif + FLAG_END, +}; + /* * print_xxx utility functions. These are used to print syscall * parameters in certain format. All of these have parameter @@ -2611,6 +2681,22 @@ print_tgkill(const struct syscallname *name, } #endif =20 +#ifdef TARGET_NR_statx +static void +print_statx(const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + print_syscall_prologue(name); + print_at_dirfd(arg0, 0); + print_string(arg1, 0); + print_flags(statx_flags, arg2, 0); + print_flags(statx_mask, arg3, 0); + print_pointer(arg4, 1); + print_syscall_epilogue(name); +} +#endif + /* * An array of all of the syscalls we know about */ diff --git a/linux-user/strace.list b/linux-user/strace.list index db21ce4..63a9466 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1650,3 +1650,6 @@ #ifdef TARGET_NR_atomic_barrier { TARGET_NR_atomic_barrier, "atomic_barrier", NULL, NULL, NULL }, #endif +#ifdef TARGET_NR_statx +{ TARGET_NR_statx, "statx", NULL, print_statx, NULL }, +#endif --=20 2.7.4 From nobody Thu May 16 20:33:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561719224; cv=none; d=zoho.com; s=zohoarc; b=Zw3BYv394or4nGKT2EUAaoUjv9PQIerVoIvstdOaB7Ke0V1OxAo315PfYatmyeQDj987hyJy9iEgUL3InRECij3DGuYtP703H+pXMYjT29+C0BZHOBGhDVFRPyeAhXPWbU61iPIzpVIm1ejvqT/CBoJIQ+P68Pc8wr4BUpzhgog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561719224; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=p/nW+8tR0fQU5GbqlMaVa7aAL98h+oPKFM9RKxuuZ/w=; b=DYF59uMeal5imLkyabUK45rOcuqwXjgwGRSE6E/x4t3QLRIWcnu1qv+dh7OCoVfCHOB7bnVuhVok6Bv7YgAOGAs1NuyVtelW3MAZNZeQf/amXLEY4r0v+YTGNjGr+itl6Sfs+UjL8pS6oDhhzk03gyXHq/AoOTlIUAfZGpEoZzg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561719224656874.1202478445608; Fri, 28 Jun 2019 03:53:44 -0700 (PDT) Received: from localhost ([::1]:58800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoVZ-0006sZ-Uz for importer@patchew.org; Fri, 28 Jun 2019 06:53:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33616) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoMF-0006uc-V3 for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgoME-0000HW-Sb for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:55 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:46584 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgoME-0000GY-MR for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:54 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 641281A245A; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 4281D1A2449; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Fri, 28 Jun 2019 12:43:36 +0200 Message-Id: <1561718618-20218-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v16 3/5] linux-user: Fix target_flock structure for MIPS O64 ABI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Among MIPS ABIs, only MIPS O32 and N32 have special (different than other architectures) definition of structure flock in kernel. Bring target_flock definition in QEMU for MIPS O64 ABI to the correct state, which is currently different than the most common definition, and it should actually be the same. Reported-by: Dragan Mladjenovic Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/generic/fcntl.h | 2 +- linux-user/mips/target_fcntl.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h index a775a49..1b48dde 100644 --- a/linux-user/generic/fcntl.h +++ b/linux-user/generic/fcntl.h @@ -129,7 +129,7 @@ struct target_flock { short l_whence; abi_long l_start; abi_long l_len; -#if defined(TARGET_MIPS) +#if defined(TARGET_MIPS) && (TARGET_ABI_BITS =3D=3D 32) abi_long l_sysid; #endif int l_pid; diff --git a/linux-user/mips/target_fcntl.h b/linux-user/mips/target_fcntl.h index 000527c..795bba7 100644 --- a/linux-user/mips/target_fcntl.h +++ b/linux-user/mips/target_fcntl.h @@ -27,7 +27,11 @@ #define TARGET_F_SETOWN 24 /* for sockets. */ #define TARGET_F_GETOWN 23 /* for sockets. */ =20 +#if (TARGET_ABI_BITS =3D=3D 32) #define TARGET_ARCH_FLOCK_PAD abi_long pad[4]; +#else +#define TARGET_ARCH_FLOCK_PAD +#endif #define TARGET_ARCH_FLOCK64_PAD =20 #define TARGET_F_GETLK64 33 /* using 'struct flock64' */ --=20 2.7.4 From nobody Thu May 16 20:33:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561719445; cv=none; d=zoho.com; s=zohoarc; b=YTy5YYYF8GrYCCToH5fE69o9TEOh4W9AOfduXCfQ+jFP+89DfM7s0G696B5PTVtyWh5Yl/vuFXPInF4Jg4pgFR+o0BFUAIJC+NPELv0HmH5y5wOJ+fwlZw+MHhYWaDlmnfj2Tw2e3sXj3NksShssxvtEdV2JDn4lRf1W7vyRQE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561719445; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=hfsBD7HjfvUwimfamvGBsgIrlOIT8AUJiKEj3zKHy2o=; b=XO4K/V93FjZsPi423h4D8n2//ctlRoWv5wpG+I+crwW2gi3GPz2Z9TGk5ajJYDBRAdImmDR4VY+PvDh+y6JcEadT9BrVUoPSIAmylokDUgysHlT9HKqunhTW23QF+w/Jo11f+fiRtZgjoAOZ/NVi3sFUFqQd53O3sP2gx2HAV2I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561719445025629.8149422888408; Fri, 28 Jun 2019 03:57:25 -0700 (PDT) Received: from localhost ([::1]:58822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoZC-0001mk-6J for importer@patchew.org; Fri, 28 Jun 2019 06:57:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33626) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoMG-0006w0-BI for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgoME-0000Hc-VY for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:56 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:46580 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgoME-0000GW-Lm for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:54 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 6E68F1A2447; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 4B1291A2456; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Fri, 28 Jun 2019 12:43:37 +0200 Message-Id: <1561718618-20218-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v16 4/5] linux-user: Introduce TARGET_HAVE_ARCH_STRUCT_FLOCK X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Bring target_flock definitions to be more in sync with the way flock is defined in kernel. Basically, the rules from the kernel are: 1. Majority of architectures have a common flock definition. 2. Architectures with 32-bit MIPS ABIs have a sligtly different flock definition; those architectures are the only arcitectures that have HAVE_ARCH_STRUCT_FLOCK defined, and that preprocessor constant is used in the common header as a flag for including or not including common flock definition. 3. Sparc architectures also have a sligtly different flock definition, but the difference is only the padding at the end of the structure. The presence of that padding is determined by preprocessor constants __ARCH_FLOCK6_PAD and __ARCH_FLOCK64_PAD. QEMU linux-user already implements rules 1. and 3. in a very similar way as they are implemented in kernel. However, rule 2. is implemented in a dissimilar way (for example, the constant TARGET_HAVE_ARCH_STRUCT_FLOCK is missing), and this patch brings QEMU implementation much closer to the kernel implementation. TARGET_HAVE_ARCH_STRUCT_FLOCK64 constant is also introduced to mimic HAVE_ARCH_STRUCT_FLOCK64 from kernel, but it is not defined anywhere, however, this is the case with HAVE_ARCH_STRUCT_FLOCK64 in kernel as well. Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/generic/fcntl.h | 8 +++++--- linux-user/mips/target_fcntl.h | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h index 1b48dde..9f727d4 100644 --- a/linux-user/generic/fcntl.h +++ b/linux-user/generic/fcntl.h @@ -120,6 +120,7 @@ struct target_f_owner_ex { #define TARGET_F_SHLCK 8 #endif =20 +#ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK #ifndef TARGET_ARCH_FLOCK_PAD #define TARGET_ARCH_FLOCK_PAD #endif @@ -129,13 +130,12 @@ struct target_flock { short l_whence; abi_long l_start; abi_long l_len; -#if defined(TARGET_MIPS) && (TARGET_ABI_BITS =3D=3D 32) - abi_long l_sysid; -#endif int l_pid; TARGET_ARCH_FLOCK_PAD }; +#endif =20 +#ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK64 #ifndef TARGET_ARCH_FLOCK64_PAD #define TARGET_ARCH_FLOCK64_PAD #endif @@ -149,3 +149,5 @@ struct target_flock64 { TARGET_ARCH_FLOCK64_PAD }; #endif + +#endif diff --git a/linux-user/mips/target_fcntl.h b/linux-user/mips/target_fcntl.h index 795bba7..6fc7b8a 100644 --- a/linux-user/mips/target_fcntl.h +++ b/linux-user/mips/target_fcntl.h @@ -28,11 +28,20 @@ #define TARGET_F_GETOWN 23 /* for sockets. */ =20 #if (TARGET_ABI_BITS =3D=3D 32) -#define TARGET_ARCH_FLOCK_PAD abi_long pad[4]; -#else -#define TARGET_ARCH_FLOCK_PAD + +struct target_flock { + short l_type; + short l_whence; + abi_long l_start; + abi_long l_len; + abi_long l_sysid; + int l_pid; + abi_long pad[4]; +}; + +#define TARGET_HAVE_ARCH_STRUCT_FLOCK + #endif -#define TARGET_ARCH_FLOCK64_PAD =20 #define TARGET_F_GETLK64 33 /* using 'struct flock64' */ #define TARGET_F_SETLK64 34 --=20 2.7.4 From nobody Thu May 16 20:33:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561718769; cv=none; d=zoho.com; s=zohoarc; b=mXgWbvsrslSl2oa2a5gWL5lAygdi8UNsWW7cRX37RW9t7BrlYz8Uo1t8w7YcurAeJw0PSG2UjEdsobTcmrzvUdzJ2X05r98sKcaGiRIXwcSa65lReUjpxQQfoSzPj2qLRYJbXqlJyrRITHkhKy10iM89NvFZUgqxnz8qIoGJCsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561718769; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=AKY2QouieN7eJC7pnE+rd4UO4DIxoD1pYnI9hOJ3Hu0=; b=A2LblWYur/L5WMwDE3VfDTSUj1Fbg8955BgLTtQI1bviuwKep6/eUZukzfSQq7cLaGRYLTD1BCkwKMuBHX033plOQHvg/Bnpc0fKC31oUAM0z2NVxFXuRxf0py6OyPFCzGmiFF3AdPjEJmmtpGoPltNMR+7/+whzTs8qcFVijeE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561718768645500.27937290129523; Fri, 28 Jun 2019 03:46:08 -0700 (PDT) Received: from localhost ([::1]:58702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoON-0000ea-R4 for importer@patchew.org; Fri, 28 Jun 2019 06:46:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33646) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgoMH-0006yB-BV for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgoMG-0000IV-4g for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:57 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:46657 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgoMF-0000H5-Tt for qemu-devel@nongnu.org; Fri, 28 Jun 2019 06:43:56 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 765461A2449; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 545C91A2015; Fri, 28 Jun 2019 12:43:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Fri, 28 Jun 2019 12:43:38 +0200 Message-Id: <1561718618-20218-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561718618-20218-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v16 5/5] linux-user: Handle EXCP_FPE properly for MIPS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Handle EXCP_FPE properly for MIPS in cpu loop. Note that a vast majority of FP instructions are not affected by the absence of the code in this patch, as they use alternative code paths for handling floating point exceptions (see, for example, invocations of update_fcr31()) - they rely on softfloat library for keeping track on exceptions that needs to be raised. However, there are few MIPS FP instructions (an example is CTC1) that use function do_raise_exception() directly, and they need the case that is added in this patch to propagate the FPE exception as designed. The code is based on kernel's function force_fcr31_sig() in arch/mips/kernel.traps.c. Reported-by: Yunqiang Su Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/mips/cpu_loop.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 43ba267..0ba894f 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -540,6 +540,23 @@ done_syscall: info.si_code =3D TARGET_ILL_ILLOPC; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; + case EXCP_FPE: + info.si_signo =3D TARGET_SIGFPE; + info.si_errno =3D 0; + info.si_code =3D TARGET_FPE_FLTUNK; + if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_INVALID) { + info.si_code =3D TARGET_FPE_FLTINV; + } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_DIV0) { + info.si_code =3D TARGET_FPE_FLTDIV; + } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_OVERFLOW) { + info.si_code =3D TARGET_FPE_FLTOVF; + } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_UNDERFLOW)= { + info.si_code =3D TARGET_FPE_FLTUND; + } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_INEXACT) { + info.si_code =3D TARGET_FPE_FLTRES; + } + queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + break; /* The code below was inspired by the MIPS Linux kernel trap * handling code in arch/mips/kernel/traps.c. */ --=20 2.7.4