From patchwork Mon May 14 18:19:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8C122KPz9s1B for ; Tue, 15 May 2018 04:20:45 +1000 (AEST) Received: from localhost ([::1]:47587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII5S-0005FP-Po for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:20:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII4Z-0005E2-Ic for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4V-0005Dn-Vq for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:47 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:33977) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4V-0005BW-Lu for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:43 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MT2f3-1esgb20RWv-00RpJO; Mon, 14 May 2018 20:19:33 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:22 +0200 Message-Id: <20180514181928.18034-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> X-Provags-ID: V03:K1:k2Tyb9SCH826tg7mLgytSm5w0fcDE9nU676MfkX3kYaw5vG+guF z5eMOhfLoCKuOOK7q6gkEwLfOtOqHdsgsOXgysBFaSuuB3Qr4ySRHy/CvT9IxzxioVnGp6E ojl2J31XYwefCRuoEH94FLXYb/2gmqIQF5HL8epaMfPiiPKyarWAuyIX2mQVMqdSR+NEO9+ ouvQvjfq2GuCwVyZYRMMg== X-UI-Out-Filterresults: notjunk:1; V01:K0:f81vzzUzHmA=:4gG256XQyFOGIkxv9TxXJV 8IeqcNcetUvQNApMcgg6pE1uqKhGup1hRGVi5NPuUjQHzJ0QeGSI8tubBLmClApw0Ra1KuDVH 1BzaMMJa1RkuCPZeqTKCFq/LDpyHisrG/Yj0lqGb9ca5tSjtzbsU3RwFE9meeS/jm/e3VwR6N hjZcFDU/1k6dvjYUg+YApI2H1AKT5iWdJSYYq4CpamPGbXyMQyk8NUJfKlxBYgarprsAF/H9B 4c0Y24PfRrvQ1v/X/A4JZ6aRMe94X+d2tgCFb0iH4FNMW7wtn6NjcevV57j6JXw7RVXudlVa9 5bjERGLETBCiNtiwJ+PaehUKkTbcqi+0YGMr0bdp97AHGY+uoDOq4wIFkkNebTpC+S0VpKL3o W21yquw2RGqPBSPgcllSU5X18KDL3Y5b+6Uw4ZubIdgB8NcAJN6rR7KK4+3REG4xGP/UKEJPW hVnMdw+VfumpfaKef8T5P93JZg5GtY7BOFt8GOhsvPKLtAKJlS++Q2WqYQFZWxoPNbv93pO6O Sj183vjyIDw9igKQcvFcmxuU63dVKOSoIiKeOKf1J5svCmZwuo38ck1UzpnHA9LLz6tez4yMp 3I34YNAstNhZT4Krv9y5SzWr1vP7VwKvcWwjKaOo9Q3NDrASrPuCLEimriRbB8Ja5pEVtpVkE EI9QyLPf9OAHkMFE/qnCVTNFDVb8QKd4jvcdt5LorP4K/GVjc4oC8Sm1c2P+q/7waEvI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PULL 1/7] linux-user: define correct fcntl() values for sparc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov Message-Id: <20180509231123.20864-2-laurent@vivier.eu> --- linux-user/syscall_defs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 361bb83a29..ec3f561685 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2441,6 +2441,15 @@ struct target_statfs64 { #define TARGET_F_SETLKW 7 #define TARGET_F_GETOWN 11 /* for sockets. */ #define TARGET_F_SETOWN 12 /* for sockets. */ +#elif defined(TARGET_SPARC) +#define TARGET_F_RDLCK 1 +#define TARGET_F_WRLCK 2 +#define TARGET_F_UNLCK 3 +#define TARGET_F_GETOWN 5 /* for sockets. */ +#define TARGET_F_SETOWN 6 /* for sockets. */ +#define TARGET_F_GETLK 7 +#define TARGET_F_SETLK 8 +#define TARGET_F_SETLKW 9 #else #define TARGET_F_GETLK 5 #define TARGET_F_SETLK 6 From patchwork Mon May 14 18:19:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8JJ3vV1z9s1B for ; Tue, 15 May 2018 04:25:20 +1000 (AEST) Received: from localhost ([::1]:47612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII9t-0000kB-FB for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:25:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII51-0005at-6W for qemu-devel@nongnu.org; Mon, 14 May 2018 14:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4x-0005i8-8m for qemu-devel@nongnu.org; Mon, 14 May 2018 14:20:15 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:34785) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4w-0005h1-UZ for qemu-devel@nongnu.org; Mon, 14 May 2018 14:20:11 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LhYH7-1eVUuK2Epl-00mv0E; Mon, 14 May 2018 20:19:33 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:23 +0200 Message-Id: <20180514181928.18034-3-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> X-Provags-ID: V03:K1:hhYi/Vusdti2Lpq9H7+UHtsH1W3jplLGEcrIEB8DjpEQGckPCnJ 1IJ2D6ihtMYx9CHG2Gxw63n4qVaS5PdlKyqw7UcNhiwy7I5bTrgQgQFDVttFMS4FUFx/sf0 A8PslEN638MRU86QiDPY9X85+jbAGsY8saKvRe3BswEv4cQETlgvFBSiLH2QIxlaaQl04v4 A6IX2nhDKTU9nVN7jvbrw== X-UI-Out-Filterresults: notjunk:1; V01:K0:yr0n+gEyOG4=:bckHsnwNrsbFdSc1bkOhLF IRdo9jCoQOmmnSUi+aH9DCoCJCkCZBg5oHM7DjoQX2SDghaw1tORK84vG0S1iV0yooB2liOI3 mPbxbnr+jDXaqUxzrKM/19EphCfuOu+xvmSuF3MTsKI1W0vyV0hGmNpcDLc7/5Xxp5Q8bb4f6 8bTavjDubDQNz26hLRVlVe77Tir3WvOfKQzjrBaNjsHy65gtaf4pf35JMFoFwdXILt1usB+oQ s6DT+lkXzp9ZRUIgQXz0U9jl+GYFlOvAbipIybc0VsTa/ieS6HhxmoWI1N5gpB08EpdZlHIv+ IQZho3NQj4cgWmtbnGHxWtmVMMnW0tGKTTJdAo2oKE1ifKKuOvh1uooOPTKFy0X0GrSDs56XD Bv305YTDhaneMAIfIK3mNtbBby4DVAYDufuuTEWZjx2oDhxzisiHHfZfCZCyXK0oNh5UsioJM jMNDxpGlEZpocxzFMvDxDcNJcAd1sOBOKQTlBSDH95JZrh6/7tfvNze6Ccf3EdInkrj9IuwRf 2XBBJ6mrULRhm+EkfbtkpIT8HB3O0KsUoAchBjIa0uSw0LYSvTN+2hQckruu2A4lqAC3L/yZE xb4xaJiTbMptwJ98AxEbK9MGfHYNmnW3dbZCnd5ej/TLY95DpHWUoncpxFxUPOGm+v4kmflvE INkPP1uTG8s5ZSuVsn1mv0jrWLkjR8S2Tg8nejUqfVz12UAKWZiauWvX0lS2A5ScU7cY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 2/7] linux-user: fix flock/flock64 padding X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" include/uapi/asm-generic/fcntl.h insert a padding macro at the end of the structures flock and flock64. This macro is defined to "short __unused;" on sparc, and "long pad[4]" on mips. Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov Message-Id: <20180509231123.20864-3-laurent@vivier.eu> --- linux-user/syscall_defs.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index ec3f561685..e4cd87cc00 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2643,6 +2643,17 @@ struct target_statfs64 { #define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC) #endif +#if defined(TARGET_SPARC) +#define TARGET_ARCH_FLOCK_PAD abi_short __unused; +#define TARGET_ARCH_FLOCK64_PAD abi_short __unused; +#elif defined(TARGET_MIPS) +#define TARGET_ARCH_FLOCK_PAD abi_long pad[4]; +#define TARGET_ARCH_FLOCK64_PAD +#else +#define TARGET_ARCH_FLOCK_PAD +#define TARGET_ARCH_FLOCK64_PAD +#endif + struct target_flock { short l_type; short l_whence; @@ -2652,9 +2663,7 @@ struct target_flock { abi_long l_sysid; #endif int l_pid; -#if defined(TARGET_MIPS) - abi_long pad[4]; -#endif + TARGET_ARCH_FLOCK_PAD }; struct target_flock64 { @@ -2663,6 +2672,7 @@ struct target_flock64 { abi_llong l_start; abi_llong l_len; abi_int l_pid; + TARGET_ARCH_FLOCK64_PAD }; struct target_f_owner_ex { From patchwork Mon May 14 18:19:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8Fq5FP0z9s1w for ; Tue, 15 May 2018 04:23:10 +1000 (AEST) Received: from localhost ([::1]:47603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII7n-0007LN-FN for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:23:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII4Z-0005E1-Ib for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4V-0005DM-Jj for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:47 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:60545) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4V-0005AZ-AB for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:43 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Lt8sp-1eGbUc42GZ-012p1U; Mon, 14 May 2018 20:19:34 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:24 +0200 Message-Id: <20180514181928.18034-4-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> X-Provags-ID: V03:K1:xP4McR9VhS1TozrF6BSpws2yjm8n+jSqiAkQ4BmS4bQKmyHl7rL a2W+C5HabKUMAforiMGyYgwqPPkZRn5fBiZNrUfxSF5txl4jAqhCggA9ARCX3uNsWaxWcnG wbyn8Y9fss1ZafCiSiYQsb7DD9H7AKJNVT1JIi3LQOqvLNfdKVgWpvBQ81iHJH0VaLHu/T0 XaBz/HiQaGtI4mWKymGlw== X-UI-Out-Filterresults: notjunk:1; V01:K0:SRs0GXBfNos=:5/tzkkLLUWptPW0negVBeb 24rimXqEuVSlFxlUV/3PHCPTBgiDqS18RaKcVXqh/51AjE1SO4bZX5oJO0ejk1eOQJq/JIAvu Aotf4EjVAfomB7Ou2XEYJ3h+Phv3NCtN21InFeoI2cqQeB7lpOeT2ylAM9mhz7XgfaM59phgX xeXDJmbl60M0qzVwwBirBLo1oYiiubUEnmKXEVH32wqrQSOeYONK85D/ioeIQmZgdIiJwKxzZ deIyxY+aaS9nEfW5gGheG4Ba2oDOwlVoqpcQd8cbNGUI7RGD0ff11XLT2LhyQshaXAKqvuVZU 1+SNqrl8Rm11sn0lMSPD8Viaec/1gL5iyERppAn7dhAJF1cAHmEVn5Y/hnADYjkzoID6FHZ+k LROcnXcS6L6Fy/JKVQ+wyWOfGclH8ylF1BlISqXLl39mbP7v8hjaKs2MPnhOoUwOG0SQC3caI tGh92xF7LNrYVeykkT7b/2k1hitBtau3s+CtbMzC+EfGv7w2I0iMI2EOp2Bjbk2s2kIN7NCC/ vVnmYLbtb9PRQk2URRMG13QxM6RRXe9Pfu35XrAYb59v/ggz++tm+u2NjuK4UXQpsDawUptq+ bZiUpMUc+8ZmObNJ1Zn6FNaA4AjMwh8UvB0G8JEx5P/8oFA+dWo95JF84CsAzaviogh4XRzo4 /Vr12I8igITqo8Fi5ZDZuIMX6AQ+a7N0NHZkvqs0KWUCCFm+rqbX6/sPjLFggWSIP8Ig= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PULL 3/7] linux-user: update sparc/syscall_nr.h to linux header 4.16 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" And kill sys_aplib, add sys_sync_file_range: on sparc, since linux 2.6.17, aplib syscall has been replaced by sync_file_range syscall. (289eee6fa78e ["SPARC]: Wire up sys_sync_file_range() into syscall tables.") The syscall has been removed in linux v2.5.71 (6196166fad "[SPARC64]: Kill sys_aplib.") Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov Message-Id: <20180509231123.20864-4-laurent@vivier.eu> --- linux-user/sparc/syscall_nr.h | 32 +++++++++++++++++++++++++++++++- linux-user/sparc64/syscall_nr.h | 20 ++++++++++++-------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/linux-user/sparc/syscall_nr.h b/linux-user/sparc/syscall_nr.h index e713c9d5f4..2d77e19bec 100644 --- a/linux-user/sparc/syscall_nr.h +++ b/linux-user/sparc/syscall_nr.h @@ -22,6 +22,7 @@ #define TARGET_NR_capset 22 /* Linux Specific */ #define TARGET_NR_setuid 23 /* Implemented via setreuid in SunOS */ #define TARGET_NR_getuid 24 /* Common */ +#define TARGET_NR_vmsplice 25 #define TARGET_NR_ptrace 26 /* Common */ #define TARGET_NR_alarm 27 /* Implemented via setitimer in SunOS */ #define TARGET_NR_sigaltstack 28 /* Common */ @@ -135,6 +136,7 @@ #define TARGET_NR_rmdir 137 /* Common */ #define TARGET_NR_utimes 138 /* SunOS Specific */ #define TARGET_NR_stat64 139 /* Linux sparc32 Specific */ +#define TARGET_NR_sendfile64 140 #define TARGET_NR_getpeername 141 /* Common */ #define TARGET_NR_futex 142 /* gethostid under SunOS */ #define TARGET_NR_gettid 143 /* ENOSYS under SunOS */ @@ -145,29 +147,51 @@ #define TARGET_NR_pciconfig_read 148 /* ENOSYS under SunOS */ #define TARGET_NR_pciconfig_write 149 /* ENOSYS under SunOS */ #define TARGET_NR_getsockname 150 /* Common */ +#define TARGET_NR_inotify_init 151 +#define TARGET_NR_inotify_add_watch 152 #define TARGET_NR_poll 153 /* Common */ #define TARGET_NR_getdents64 154 /* Linux specific */ #define TARGET_NR_fcntl64 155 /* Linux sparc32 Specific */ +#define TARGET_NR_inotify_rm_watch 156 #define TARGET_NR_statfs 157 /* Common */ #define TARGET_NR_fstatfs 158 /* Common */ #define TARGET_NR_umount 159 /* Common */ +#define TARGET_NR_sched_set_affinity 160 +#define TARGET_NR_sched_get_affinity 161 #define TARGET_NR_getdomainname 162 /* SunOS Specific */ #define TARGET_NR_setdomainname 163 /* Common */ #define TARGET_NR_quotactl 165 /* Common */ #define TARGET_NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ #define TARGET_NR_mount 167 /* Common */ #define TARGET_NR_ustat 168 /* Common */ +#define TARGET_NR_setxattr 169 +#define TARGET_NR_lsetxattr 170 +#define TARGET_NR_fsetxattr 171 +#define TARGET_NR_getxattr 172 +#define TARGET_NR_lgetxattr 173 #define TARGET_NR_getdents 174 /* Common */ #define TARGET_NR_setsid 175 /* Common */ #define TARGET_NR_fchdir 176 /* Common */ +#define TARGET_NR_fgetxattr 177 +#define TARGET_NR_listxattr 178 +#define TARGET_NR_llistxattr 179 +#define TARGET_NR_flistxattr 180 +#define TARGET_NR_removexattr 181 +#define TARGET_NR_lremovexattr 182 #define TARGET_NR_sigpending 183 /* Common */ #define TARGET_NR_query_module 184 /* Linux Specific */ #define TARGET_NR_setpgid 185 /* Common */ +#define TARGET_NR_fremovexattr 186 #define TARGET_NR_tkill 187 /* SunOS: fpathconf */ #define TARGET_NR_exit_group 188 /* Linux specific, sysconf undef SunOS */ #define TARGET_NR_uname 189 /* Linux Specific */ #define TARGET_NR_init_module 190 /* Linux Specific */ #define TARGET_NR_personality 191 /* Linux Specific */ +#define TARGET_NR_remap_file_pages 192 +#define TARGET_NR_epoll_create 193 +#define TARGET_NR_epoll_ctl 194 +#define TARGET_NR_epoll_wait 195 +#define TARGET_NR_ioprio_set 196 #define TARGET_NR_getppid 197 /* Linux Specific */ #define TARGET_NR_sigaction 198 /* Linux Specific */ #define TARGET_NR_sgetmask 199 /* Linux Specific */ @@ -189,6 +213,7 @@ #define TARGET_NR_ipc 215 /* Linux Specific */ #define TARGET_NR_sigreturn 216 /* Linux Specific */ #define TARGET_NR_clone 217 /* Linux Specific */ +#define TARGET_NR_ioprio_get 218 #define TARGET_NR_adjtimex 219 /* Linux Specific */ #define TARGET_NR_sigprocmask 220 /* Linux Specific */ #define TARGET_NR_create_module 221 /* Linux Specific */ @@ -202,6 +227,7 @@ #define TARGET_NR_setfsgid 229 /* Linux Specific */ #define TARGET_NR__newselect 230 /* Linux Specific */ #define TARGET_NR_time 231 /* Linux Specific */ +#define TARGET_NR_splice 232 #define TARGET_NR_stime 233 /* Linux Specific */ #define TARGET_NR_statfs64 234 /* Linux Specific */ #define TARGET_NR_fstatfs64 235 /* Linux Specific */ @@ -224,7 +250,7 @@ #define TARGET_NR_getsid 252 #define TARGET_NR_fdatasync 253 #define TARGET_NR_nfsservctl 254 -#define TARGET_NR_aplib 255 +#define TARGET_NR_sync_file_range 255 #define TARGET_NR_clock_settime 256 #define TARGET_NR_clock_gettime 257 #define TARGET_NR_clock_getres 258 @@ -326,3 +352,7 @@ #define TARGET_NR_listen 354 #define TARGET_NR_setsockopt 355 #define TARGET_NR_mlock2 356 +#define TARGET_NR_copy_file_range 357 +#define TARGET_NR_preadv2 358 +#define TARGET_NR_pwritev2 359 +#define TARGET_NR_statx 360 diff --git a/linux-user/sparc64/syscall_nr.h b/linux-user/sparc64/syscall_nr.h index 2b49ead267..9391645598 100644 --- a/linux-user/sparc64/syscall_nr.h +++ b/linux-user/sparc64/syscall_nr.h @@ -23,7 +23,7 @@ #define TARGET_NR_capset 22 /* Linux Specific */ #define TARGET_NR_setuid 23 /* Implemented via setreuid in SunOS */ #define TARGET_NR_getuid 24 /* Common */ -/* #define TARGET_NR_time alias 25 ENOSYS under SunOS */ +#define TARGET_NR_vmsplice 25 #define TARGET_NR_ptrace 26 /* Common */ #define TARGET_NR_alarm 27 /* Implemented via setitimer in SunOS */ #define TARGET_NR_sigaltstack 28 /* Common */ @@ -149,8 +149,8 @@ #define TARGET_NR_pciconfig_read 148 /* ENOSYS under SunOS */ #define TARGET_NR_pciconfig_write 149 /* ENOSYS under SunOS */ #define TARGET_NR_getsockname 150 /* Common */ -/* #define TARGET_NR_getmsg 151 SunOS Specific */ -/* #define TARGET_NR_putmsg 152 SunOS Specific */ +#define TARGET_NR_inotify_init 151 +#define TARGET_NR_inotify_add_watch 152 #define TARGET_NR_poll 153 /* Common */ #define TARGET_NR_getdents64 154 /* Linux specific */ #define TARGET_NR_fcntl64 155 /* Linux sparc32 Specific */ @@ -194,7 +194,7 @@ #define TARGET_NR_epoll_create 193 /* Linux Specific */ #define TARGET_NR_epoll_ctl 194 /* Linux Specific */ #define TARGET_NR_epoll_wait 195 /* Linux Specific */ -/* #define TARGET_NR_ulimit 196 Linux Specific */ +#define TARGET_NR_ioprio_set 196 #define TARGET_NR_getppid 197 /* Linux Specific */ #define TARGET_NR_sigaction 198 /* Linux Specific */ #define TARGET_NR_sgetmask 199 /* Linux Specific */ @@ -216,7 +216,7 @@ #define TARGET_NR_ipc 215 /* Linux Specific */ #define TARGET_NR_sigreturn 216 /* Linux Specific */ #define TARGET_NR_clone 217 /* Linux Specific */ -/* #define TARGET_NR_modify_ldt 218 Linux Specific - i386 specific, unused */ +#define TARGET_NR_ioprio_get 218 #define TARGET_NR_adjtimex 219 /* Linux Specific */ #define TARGET_NR_sigprocmask 220 /* Linux Specific */ #define TARGET_NR_create_module 221 /* Linux Specific */ @@ -230,7 +230,7 @@ #define TARGET_NR_setfsgid 229 /* Linux Specific */ #define TARGET_NR__newselect 230 /* Linux Specific */ #define TARGET_NR_time 231 /* Linux sparc32 */ -/* #define TARGET_NR_oldstat 232 Linux Specific */ +#define TARGET_NR_splice 232 #define TARGET_NR_stime 233 /* Linux Specific */ #define TARGET_NR_statfs64 234 /* Linux Specific */ #define TARGET_NR_fstatfs64 235 /* Linux Specific */ @@ -253,7 +253,7 @@ #define TARGET_NR_getsid 252 #define TARGET_NR_fdatasync 253 #define TARGET_NR_nfsservctl 254 -#define TARGET_NR_aplib 255 +#define TARGET_NR_sync_file_range 255 #define TARGET_NR_clock_settime 256 #define TARGET_NR_clock_gettime 257 #define TARGET_NR_clock_getres 258 @@ -310,7 +310,7 @@ #define TARGET_NR_epoll_pwait 309 #define TARGET_NR_utimensat 310 #define TARGET_NR_signalfd 311 -#define TARGET_NR_timerfd 312 +#define TARGET_NR_timerfd_create 312 #define TARGET_NR_eventfd 313 #define TARGET_NR_fallocate 314 #define TARGET_NR_timerfd_settime 315 @@ -355,3 +355,7 @@ #define TARGET_NR_listen 354 #define TARGET_NR_setsockopt 355 #define TARGET_NR_mlock2 356 +#define TARGET_NR_copy_file_range 357 +#define TARGET_NR_preadv2 358 +#define TARGET_NR_pwritev2 359 +#define TARGET_NR_statx 360 From patchwork Mon May 14 18:19:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8C13MhTz9s1R for ; Tue, 15 May 2018 04:20:45 +1000 (AEST) Received: from localhost ([::1]:47588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII5T-0005Fe-1m for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:20:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII4Z-0005Du-19 for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4V-0005C6-0c for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:47 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:38607) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4U-00059W-NS for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:42 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Lx0lJ-1eBdfz29vN-016emQ; Mon, 14 May 2018 20:19:34 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:25 +0200 Message-Id: <20180514181928.18034-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> X-Provags-ID: V03:K1:fzKKhx/sMc7+tBK1wWXTF1AmLXxQx6aux2Fa65PRax9TsIgI2ZT VUJH2PSHiHeaqGN7S1yuNL0/esBKhJC8EnuhpagFcChEQdUkt0JX4O9UVGNDFTYD8Q0GvEd 8g8esdojUfveA+HBg56NzG/YppEBB18FGm42/J/fgdGewL4N9KL7ULxpjKunsJ0yAiCQs8W UbVSfdlOte2bld5ZJn3sw== X-UI-Out-Filterresults: notjunk:1; V01:K0:nnulRSaLc8s=:VHQ9e3FWxF21+yNOzsmhQY bQva9PJYhq0EUc99+qZ82C2iflQnAfT8Sy4pQUxDJqO8114cvuHoSzeTm2Ejg0741USlZNIqL xpSeVknlhQOKFCVoTw/820os28LrQQVlvzaJZLBs/Eg429FDymVzeVM2ZR2yus6D/9BH+m69j 3oubo6dkATPxsaAXS2ZTtitMzdEEPktzRfUEOD4Q7lYtLB/SZgpWL0gEOom7K+w0FOOEXKMPz LvwAr/0V62tySQvN/iAPJxMhMF/FvddrMGetuOmkfc8/E7q0tsHR/9cKGMP2pfUq0lPF6Y8Si CUfL8l/UcbLTfE+2/cOAdm9oyxcfNE3FpnRX0MyYpRUJ9IAcKkzH3WJCyQQCmBX2LX5dvd3Ri uIyC5JK4XBYpwI1iMi/sKGkSDH/Ww4LFj67Q3XafQt+uBpZb/OEMGQfElaTC5OWiS91VPCS76 kax3udT/3jh/Do2dSJ3KcMBHih7G4ahvEunb2k5wpvl68OYf1eRKTWULwbTly5WpHRfcgFuxU EQghqop1dZzR2IX2aNkS5FrR5NHQ3N3SMzP4u+7eeukHrgPxBbZylfuNkFegNoZfRi+SNLxrs yivnnAw7VEUBclR9Hk3/BcAixI84oKfVcVYm7gJHtEbLStpjTKBrtB6l2FEIGcSFOD4E9wHAn Tl/c8LzkksHZhg1sMojm9Xe/JxPq6jSF6ak4uTmfp7EIvYNl/IFjjKQ+cKoU9clYnEPM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL 4/7] linux-user: fix conversion of flock/flock64 l_type field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As l_type values (F_RDLCK, F_WRLCK, F_UNLCK, F_EXLCK, F_SHLCK) are not bitmasks, we can't use target_to_host_bitmask() and host_to_target_bitmask() to convert them. Introduce target_to_host_flock() and host_to_target_flock() to convert values between host and target. Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov Message-Id: <20180509231123.20864-5-laurent@vivier.eu> --- linux-user/syscall.c | 66 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e4825747f9..af8603f1b7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6546,28 +6546,50 @@ static int target_to_host_fcntl_cmd(int cmd) return -TARGET_EINVAL; } -#define TRANSTBL_CONVERT(a) { -1, TARGET_##a, -1, a } -static const bitmask_transtbl flock_tbl[] = { - TRANSTBL_CONVERT(F_RDLCK), - TRANSTBL_CONVERT(F_WRLCK), - TRANSTBL_CONVERT(F_UNLCK), - TRANSTBL_CONVERT(F_EXLCK), - TRANSTBL_CONVERT(F_SHLCK), - { 0, 0, 0, 0 } -}; +#define FLOCK_TRANSTBL \ + switch (type) { \ + TRANSTBL_CONVERT(F_RDLCK); \ + TRANSTBL_CONVERT(F_WRLCK); \ + TRANSTBL_CONVERT(F_UNLCK); \ + TRANSTBL_CONVERT(F_EXLCK); \ + TRANSTBL_CONVERT(F_SHLCK); \ + } + +static int target_to_host_flock(int type) +{ +#define TRANSTBL_CONVERT(a) case TARGET_##a: return a + FLOCK_TRANSTBL +#undef TRANSTBL_CONVERT + return -TARGET_EINVAL; +} + +static int host_to_target_flock(int type) +{ +#define TRANSTBL_CONVERT(a) case a: return TARGET_##a + FLOCK_TRANSTBL +#undef TRANSTBL_CONVERT + /* if we don't know how to convert the value coming + * from the host we copy to the target field as-is + */ + return type; +} static inline abi_long copy_from_user_flock(struct flock64 *fl, abi_ulong target_flock_addr) { struct target_flock *target_fl; - short l_type; + int l_type; if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) { return -TARGET_EFAULT; } __get_user(l_type, &target_fl->l_type); - fl->l_type = target_to_host_bitmask(l_type, flock_tbl); + l_type = target_to_host_flock(l_type); + if (l_type < 0) { + return l_type; + } + fl->l_type = l_type; __get_user(fl->l_whence, &target_fl->l_whence); __get_user(fl->l_start, &target_fl->l_start); __get_user(fl->l_len, &target_fl->l_len); @@ -6586,7 +6608,7 @@ static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr, return -TARGET_EFAULT; } - l_type = host_to_target_bitmask(fl->l_type, flock_tbl); + l_type = host_to_target_flock(fl->l_type); __put_user(l_type, &target_fl->l_type); __put_user(fl->l_whence, &target_fl->l_whence); __put_user(fl->l_start, &target_fl->l_start); @@ -6604,14 +6626,18 @@ static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl, abi_ulong target_flock_addr) { struct target_oabi_flock64 *target_fl; - short l_type; + int l_type; if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) { return -TARGET_EFAULT; } __get_user(l_type, &target_fl->l_type); - fl->l_type = target_to_host_bitmask(l_type, flock_tbl); + l_type = target_to_host_flock(l_type); + if (l_type < 0) { + return l_type; + } + fl->l_type = l_type; __get_user(fl->l_whence, &target_fl->l_whence); __get_user(fl->l_start, &target_fl->l_start); __get_user(fl->l_len, &target_fl->l_len); @@ -6630,7 +6656,7 @@ static inline abi_long copy_to_user_oabi_flock64(abi_ulong target_flock_addr, return -TARGET_EFAULT; } - l_type = host_to_target_bitmask(fl->l_type, flock_tbl); + l_type = host_to_target_flock(fl->l_type); __put_user(l_type, &target_fl->l_type); __put_user(fl->l_whence, &target_fl->l_whence); __put_user(fl->l_start, &target_fl->l_start); @@ -6645,14 +6671,18 @@ static inline abi_long copy_from_user_flock64(struct flock64 *fl, abi_ulong target_flock_addr) { struct target_flock64 *target_fl; - short l_type; + int l_type; if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) { return -TARGET_EFAULT; } __get_user(l_type, &target_fl->l_type); - fl->l_type = target_to_host_bitmask(l_type, flock_tbl); + l_type = target_to_host_flock(l_type); + if (l_type < 0) { + return l_type; + } + fl->l_type = l_type; __get_user(fl->l_whence, &target_fl->l_whence); __get_user(fl->l_start, &target_fl->l_start); __get_user(fl->l_len, &target_fl->l_len); @@ -6671,7 +6701,7 @@ static inline abi_long copy_to_user_flock64(abi_ulong target_flock_addr, return -TARGET_EFAULT; } - l_type = host_to_target_bitmask(fl->l_type, flock_tbl); + l_type = host_to_target_flock(fl->l_type); __put_user(l_type, &target_fl->l_type); __put_user(fl->l_whence, &target_fl->l_whence); __put_user(fl->l_start, &target_fl->l_start); From patchwork Mon May 14 18:19:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8Ft7582z9s1w for ; Tue, 15 May 2018 04:23:14 +1000 (AEST) Received: from localhost ([::1]:47605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII7s-0007Ng-IP for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:23:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII4a-0005E3-8p for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4Y-0005HU-Es for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:48 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:36363) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4Y-0005Fy-3O for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:46 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M2kBW-1eSwMq49BO-00sbLB; Mon, 14 May 2018 20:19:35 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:26 +0200 Message-Id: <20180514181928.18034-6-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> X-Provags-ID: V03:K1:WlD6lD6A+vRhq7jAujefb4Kh+1vQZNh6wwEMAJEBIXOr/awyEFW 8195gIB4i83+DTNcSGy+qFVZLGOZRLuuqPrRorBasNiC+0RapE/vnxV3ai8B9bYIktpoTPF dbAS217BRe37c7smFFlKWw54yCgxZCwTP+X4cqS87v4yR9VyTHUoF6guFbzrxHMlyWPQ422 SJ6liIriEIntnjoSG3M7w== X-UI-Out-Filterresults: notjunk:1; V01:K0:8JV0t6rUQKs=:6RxUaf4IiN6/xtc7WiMY9a IM2WNXPTkusO0kLogCMz28dWYfd/mrYGUkVlLkwYb18/WHOkG4UO5BEc0M62PXFwnLOewfdU3 9uY4/heOtZuoWqUKSWsdKa3dBzuTo9clTy+kud0PyPJXmGJEdHQI0zYUyPxRjHyNvqo1aUApe id3/Zu/ErCC7laC2P3e3XemFhdn9h3XqeYYWmHHSzwf51daCzHY65bd0S+UZBEz4A2CGruz5T 0dqnlvSnAwn+7bZqFo3yiWCM7IgcniowCDN4/le5ePankB706TzhA0nP/MBfQciLVUSAHBtRq 2TWanfBnMyXjrYd7hyFUzxsdKPazQGam2IEpjwYqVnuhmGWKBdHfCL78RIG92Z6AtuXIicJXu 2mdZv25bqXce2GgPI4y76AsxF+6lLj4XEmiBQlI4bVx6FTbEH0PztdDYHJMmdAh8dJgrmIcTq x01Y0Voxqqott0vS2SpC8ZB/BMGz38gYuw3X7y5cPOqbBrjhQKh7MFuUSKG86+TJLmuIvMCKG h/6KYaEd16BAyi4D7nkkqENYAHJGL0+gN2u3E0YkNKC8pJMFiNLmwRJrFxx8B/CEcbg3/AIbX iIMEClC1J7X1ZnmjJ5kQMqdQovFndeMh4tl3+jib15EbCtBvuQRoza42gkioCINWY1KP6hgBE jLwkkCf5OEZ7EXksUvfgM2iP6K94vVu/zxkkGzPUvn9LsHog2Rht9UOJQrN/nDtcYrIU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL 5/7] linux-user: add sparc/sparc64 specific errno X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Copied from linux/arch/sparc/include/uapi/asm/errno.h Signed-off-by: Laurent Vivier Reviewed-by: Max Filippov Message-Id: <20180509231123.20864-6-laurent@vivier.eu> --- linux-user/sparc/target_errno.h | 207 ++++++++++++++++++++++++++++++++++++ linux-user/sparc/target_syscall.h | 2 + linux-user/sparc64/target_syscall.h | 3 +- 3 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 linux-user/sparc/target_errno.h diff --git a/linux-user/sparc/target_errno.h b/linux-user/sparc/target_errno.h new file mode 100644 index 0000000000..9b846899cd --- /dev/null +++ b/linux-user/sparc/target_errno.h @@ -0,0 +1,207 @@ +#ifndef SPARC_TARGET_ERRNO_H +#define SPARC_TARGET_ERRNO_H + +/* Target errno definitions taken from asm-sparc/errno.h */ +#undef TARGET_EWOULDBLOCK +#define TARGET_EWOULDBLOCK TARGET_EAGAIN /* Operation would block */ +#undef TARGET_EINPROGRESS +#define TARGET_EINPROGRESS 36 /* Operation now in progress */ +#undef TARGET_EALREADY +#define TARGET_EALREADY 37 /* Operation already in progress */ +#undef TARGET_ENOTSOCK +#define TARGET_ENOTSOCK 38 /* Socket operation on non-socket */ +#undef TARGET_EDESTADDRREQ +#define TARGET_EDESTADDRREQ 39 /* Destination address required */ +#undef TARGET_EMSGSIZE +#define TARGET_EMSGSIZE 40 /* Message too long */ +#undef TARGET_EPROTOTYPE +#define TARGET_EPROTOTYPE 41 /* Protocol wrong type for socket */ +#undef TARGET_ENOPROTOOPT +#define TARGET_ENOPROTOOPT 42 /* Protocol not available */ +#undef TARGET_EPROTONOSUPPORT +#define TARGET_EPROTONOSUPPORT 43 /* Protocol not supported */ +#undef TARGET_ESOCKTNOSUPPORT +#define TARGET_ESOCKTNOSUPPORT 44 /* Socket type not supported */ +#undef TARGET_EOPNOTSUPP +#define TARGET_EOPNOTSUPP 45 /* Op not supported on transport endpoint */ +#undef TARGET_EPFNOSUPPORT +#define TARGET_EPFNOSUPPORT 46 /* Protocol family not supported */ +#undef TARGET_EAFNOSUPPORT +#define TARGET_EAFNOSUPPORT 47 /* Address family not supported by protocol */ +#undef TARGET_EADDRINUSE +#define TARGET_EADDRINUSE 48 /* Address already in use */ +#undef TARGET_EADDRNOTAVAIL +#define TARGET_EADDRNOTAVAIL 49 /* Cannot assign requested address */ +#undef TARGET_ENETDOWN +#define TARGET_ENETDOWN 50 /* Network is down */ +#undef TARGET_ENETUNREACH +#define TARGET_ENETUNREACH 51 /* Network is unreachable */ +#undef TARGET_ENETRESET +#define TARGET_ENETRESET 52 /* Net dropped connection because of reset */ +#undef TARGET_ECONNABORTED +#define TARGET_ECONNABORTED 53 /* Software caused connection abort */ +#undef TARGET_ECONNRESET +#define TARGET_ECONNRESET 54 /* Connection reset by peer */ +#undef TARGET_ENOBUFS +#define TARGET_ENOBUFS 55 /* No buffer space available */ +#undef TARGET_EISCONN +#define TARGET_EISCONN 56 /* Transport endpoint is already connected */ +#undef TARGET_ENOTCONN +#define TARGET_ENOTCONN 57 /* Transport endpoint is not connected */ +#undef TARGET_ESHUTDOWN +#define TARGET_ESHUTDOWN 58 /* No send after transport endpoint shutdown*/ +#undef TARGET_ETOOMANYREFS +#define TARGET_ETOOMANYREFS 59 /* Too many references: cannot splice */ +#undef TARGET_ETIMEDOUT +#define TARGET_ETIMEDOUT 60 /* Connection timed out */ +#undef TARGET_ECONNREFUSED +#define TARGET_ECONNREFUSED 61 /* Connection refused */ +#undef TARGET_ELOOP +#define TARGET_ELOOP 62 /* Too many symbolic links encountered */ +#undef TARGET_ENAMETOOLONG +#define TARGET_ENAMETOOLONG 63 /* File name too long */ +#undef TARGET_EHOSTDOWN +#define TARGET_EHOSTDOWN 64 /* Host is down */ +#undef TARGET_EHOSTUNREACH +#define TARGET_EHOSTUNREACH 65 /* No route to host */ +#undef TARGET_ENOTEMPTY +#define TARGET_ENOTEMPTY 66 /* Directory not empty */ +#undef TARGET_EPROCLIM +#define TARGET_EPROCLIM 67 /* SUNOS: Too many processes */ +#undef TARGET_EUSERS +#define TARGET_EUSERS 68 /* Too many users */ +#undef TARGET_EDQUOT +#define TARGET_EDQUOT 69 /* Quota exceeded */ +#undef TARGET_ESTALE +#define TARGET_ESTALE 70 /* Stale file handle */ +#undef TARGET_EREMOTE +#define TARGET_EREMOTE 71 /* Object is remote */ +#undef TARGET_ENOSTR +#define TARGET_ENOSTR 72 /* Device not a stream */ +#undef TARGET_ETIME +#define TARGET_ETIME 73 /* Timer expired */ +#undef TARGET_ENOSR +#define TARGET_ENOSR 74 /* Out of streams resources */ +#undef TARGET_ENOMSG +#define TARGET_ENOMSG 75 /* No message of desired type */ +#undef TARGET_EBADMSG +#define TARGET_EBADMSG 76 /* Not a data message */ +#undef TARGET_EIDRM +#define TARGET_EIDRM 77 /* Identifier removed */ +#undef TARGET_EDEADLK +#define TARGET_EDEADLK 78 /* Resource deadlock would occur */ +#undef TARGET_ENOLCK +#define TARGET_ENOLCK 79 /* No record locks available */ +#undef TARGET_ENONET +#define TARGET_ENONET 80 /* Machine is not on the network */ +#undef TARGET_ERREMOTE +#define TARGET_ERREMOTE 81 /* SunOS: Too many lvls of remote in path */ +#undef TARGET_ENOLINK +#define TARGET_ENOLINK 82 /* Link has been severed */ +#undef TARGET_EADV +#define TARGET_EADV 83 /* Advertise error */ +#undef TARGET_ESRMNT +#define TARGET_ESRMNT 84 /* Srmount error */ +#undef TARGET_ECOMM +#define TARGET_ECOMM 85 /* Communication error on send */ +#undef TARGET_EPROTO +#define TARGET_EPROTO 86 /* Protocol error */ +#undef TARGET_EMULTIHOP +#define TARGET_EMULTIHOP 87 /* Multihop attempted */ +#undef TARGET_EDOTDOT +#define TARGET_EDOTDOT 88 /* RFS specific error */ +#undef TARGET_EREMCHG +#define TARGET_EREMCHG 89 /* Remote address changed */ +#undef TARGET_ENOSYS +#define TARGET_ENOSYS 90 /* Function not implemented */ +#undef TARGET_ESTRPIPE +#define TARGET_ESTRPIPE 91 /* Streams pipe error */ +#undef TARGET_EOVERFLOW +#define TARGET_EOVERFLOW 92 /* Value too large for defined data type */ +#undef TARGET_EBADFD +#define TARGET_EBADFD 93 /* File descriptor in bad state */ +#undef TARGET_ECHRNG +#define TARGET_ECHRNG 94 /* Channel number out of range */ +#undef TARGET_EL2NSYNC +#define TARGET_EL2NSYNC 95 /* Level 2 not synchronized */ +#undef TARGET_EL3HLT +#define TARGET_EL3HLT 96 /* Level 3 halted */ +#undef TARGET_EL3RST +#define TARGET_EL3RST 97 /* Level 3 reset */ +#undef TARGET_ELNRNG +#define TARGET_ELNRNG 98 /* Link number out of range */ +#undef TARGET_EUNATCH +#define TARGET_EUNATCH 99 /* Protocol driver not attached */ +#undef TARGET_ENOCSI +#define TARGET_ENOCSI 100 /* No CSI structure available */ +#undef TARGET_EL2HLT +#define TARGET_EL2HLT 101 /* Level 2 halted */ +#undef TARGET_EBADE +#define TARGET_EBADE 102 /* Invalid exchange */ +#undef TARGET_EBADR +#define TARGET_EBADR 103 /* Invalid request descriptor */ +#undef TARGET_EXFULL +#define TARGET_EXFULL 104 /* Exchange full */ +#undef TARGET_ENOANO +#define TARGET_ENOANO 105 /* No anode */ +#undef TARGET_EBADRQC +#define TARGET_EBADRQC 106 /* Invalid request code */ +#undef TARGET_EBADSLT +#define TARGET_EBADSLT 107 /* Invalid slot */ +#undef TARGET_EDEADLOCK +#define TARGET_EDEADLOCK 108 /* File locking deadlock error */ +#undef TARGET_EBFONT +#define TARGET_EBFONT 109 /* Bad font file format */ +#undef TARGET_ELIBEXEC +#define TARGET_ELIBEXEC 110 /* Cannot exec a shared library directly */ +#undef TARGET_ENODATA +#define TARGET_ENODATA 111 /* No data available */ +#undef TARGET_ELIBBAD +#define TARGET_ELIBBAD 112 /* Accessing a corrupted shared library */ +#undef TARGET_ENOPKG +#define TARGET_ENOPKG 113 /* Package not installed */ +#undef TARGET_ELIBACC +#define TARGET_ELIBACC 114 /* Can not access a needed shared library */ +#undef TARGET_ENOTUNIQ +#define TARGET_ENOTUNIQ 115 /* Name not unique on network */ +#undef TARGET_ERESTART +#define TARGET_ERESTART 116 /* Interrupted syscall should be restarted */ +#undef TARGET_EUCLEAN +#define TARGET_EUCLEAN 117 /* Structure needs cleaning */ +#undef TARGET_ENOTNAM +#define TARGET_ENOTNAM 118 /* Not a XENIX named type file */ +#undef TARGET_ENAVAIL +#define TARGET_ENAVAIL 119 /* No XENIX semaphores available */ +#undef TARGET_EISNAM +#define TARGET_EISNAM 120 /* Is a named type file */ +#undef TARGET_EREMOTEIO +#define TARGET_EREMOTEIO 121 /* Remote I/O error */ +#undef TARGET_EILSEQ +#define TARGET_EILSEQ 122 /* Illegal byte sequence */ +#undef TARGET_ELIBMAX +#define TARGET_ELIBMAX 123 /* Atmpt to link in too many shared libs */ +#undef TARGET_ELIBSCN +#define TARGET_ELIBSCN 124 /* .lib section in a.out corrupted */ +#undef TARGET_ENOMEDIUM +#define TARGET_ENOMEDIUM 125 /* No medium found */ +#undef TARGET_EMEDIUMTYPE +#define TARGET_EMEDIUMTYPE 126 /* Wrong medium type */ +#undef TARGET_ECANCELED +#define TARGET_ECANCELED 127 /* Operation Cancelled */ +#undef TARGET_ENOKEY +#define TARGET_ENOKEY 128 /* Required key not available */ +#undef TARGET_EKEYEXPIRED +#define TARGET_EKEYEXPIRED 129 /* Key has expired */ +#undef TARGET_EKEYREVOKED +#define TARGET_EKEYREVOKED 130 /* Key has been revoked */ +#undef TARGET_EKEYREJECTED +#define TARGET_EKEYREJECTED 131 /* Key was rejected by service */ +#undef TARGET_EOWNERDEAD +#define TARGET_EOWNERDEAD 132 /* Owner died */ +#undef TARGET_ENOTRECOVERABLE +#define TARGET_ENOTRECOVERABLE 133 /* State not recoverable */ +#undef TARGET_ERFKILL +#define TARGET_ERFKILL 134 /* Operation not possible due to RF-kill */ +#undef TARGET_EHWPOISON +#define TARGET_EHWPOISON 135 /* Memory page has hardware error */ +#endif diff --git a/linux-user/sparc/target_syscall.h b/linux-user/sparc/target_syscall.h index 5f09abfe89..3725875fcf 100644 --- a/linux-user/sparc/target_syscall.h +++ b/linux-user/sparc/target_syscall.h @@ -1,6 +1,8 @@ #ifndef SPARC_TARGET_SYSCALL_H #define SPARC_TARGET_SYSCALL_H +#include "target_errno.h" + struct target_pt_regs { abi_ulong psr; abi_ulong pc; diff --git a/linux-user/sparc64/target_syscall.h b/linux-user/sparc64/target_syscall.h index 2cbbaaed1b..34f49df4a1 100644 --- a/linux-user/sparc64/target_syscall.h +++ b/linux-user/sparc64/target_syscall.h @@ -1,6 +1,8 @@ #ifndef SPARC64_TARGET_SYSCALL_H #define SPARC64_TARGET_SYSCALL_H +#include "../sparc/target_errno.h" + struct target_pt_regs { abi_ulong u_regs[16]; abi_ulong tstate; @@ -29,5 +31,4 @@ static inline abi_ulong target_shmlba(CPUSPARCState *env) { return MAX(TARGET_PAGE_SIZE, 16 * 1024); } - #endif /* SPARC64_TARGET_SYSCALL_H */ From patchwork Mon May 14 18:19:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8Fs2GZKz9s1B for ; Tue, 15 May 2018 04:23:13 +1000 (AEST) Received: from localhost ([::1]:47604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII7q-0007Mf-Sn for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:23:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII4a-0005E4-ID for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4W-0005EX-Bc for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:48 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:47607) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4W-0005Cs-2K for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:44 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LgjC6-1eXQRt2FAU-00oHun; Mon, 14 May 2018 20:19:35 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:27 +0200 Message-Id: <20180514181928.18034-7-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:vdvPg9r0Wed0EJMry9XgY7ljxy6KeJiubgzaiyC+ae/xMR2tfER tBqPeHtOX1MgZcu07szuhGisMNAj6KkSTKGyS8e2erfT1nI+GxqL/MdGSfw0LNKtTD0iHZP j+RrU3lCWQwK58HcwmyhhSwly/jIFcVsZTgtOTJ2CPxFF4zHwYGeUkjyRVHjzLEosFdEX6b G5UChQ4UclokyQN/s7Usw== X-UI-Out-Filterresults: notjunk:1; V01:K0:XJ6379iC7eQ=:1QpL+iEfP8q83+QNuY4tun NJXiJCwmK9nL+KHfdmBymvvYqnJN2hRwFUIcBhejDTs19PRQCCqW0ExXqcMTkwluJZQlyTZNP hF7itiQK1vNcmvMq9daw45YCpzi9Jz/w3BxVqMxmnqWj3Q2csB7fSxI2/Hk5v2RRFuuqvJUGn CFPN4yK/aKMc/3LXVZ9Zemat5lh4sBvg8WQgqIQCLok8y2pIHJVwMaidT8f5X1GAv5EVfpi6d JkSvOH+CpWkjmLnuefYNichhO4lTHcs9PNzKVCGj9EO5DPrG83xOW9f+s++5ydUJLHi1GP9Qr nopktlzt/UA1fddPOZLZ58j4EJgFsc+SxUAIVGfe1ITvuHdnzm1t4OZXh0A/ppLi+z6MzNcrV o4p7Gj7IuQRRRRo+xzjA7HqX2XMv+I7hoTd4tdhW/vBUNEqIKHmjW5P1qcY1S1MrzbTsK0yFq SwfM4sZu5CKK+TBuw1DAlF1sGynbr4sI0ZpCZo0ErSyX6wyC1fpoRTtvOSpsRFgD77tulG9ck SrfGCI6t+p44ByRZH2+9UbvHcLhxY+nisteaqOxmAGbCMJrstZt5uxZJ/f6qESMhMkhuEf1Lt qZJDC/CdiYO+1q0iPgaHoEWFww76dN2z/GyKQmWZrxQi4dj+cLahBd9ojpUKOj7o/JSBUsrak 0JYVLrZl6Q5kFVeTt7APoJQyD1vYn8nnIW7svHAvxmw7w584WwYaqBDCyUef9OiHnzi8xGuN1 EtGhEaJRyVCr1k0X X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 6/7] linux-user: fix UNAME_MACHINE for sparc/sparc64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" "sun4" is not recognized by config.guess. linux defines sparc and sparc64 in arch/sparc/Makefile. Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Max Filippov Message-Id: <20180509231123.20864-7-laurent@vivier.eu> --- linux-user/sparc/target_syscall.h | 2 +- linux-user/sparc64/target_syscall.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/sparc/target_syscall.h b/linux-user/sparc/target_syscall.h index 3725875fcf..b9160a771b 100644 --- a/linux-user/sparc/target_syscall.h +++ b/linux-user/sparc/target_syscall.h @@ -11,7 +11,7 @@ struct target_pt_regs { abi_ulong u_regs[16]; }; -#define UNAME_MACHINE "sun4" +#define UNAME_MACHINE "sparc" #define UNAME_MINIMUM_RELEASE "2.6.32" /* SPARC kernels don't define this in their Kconfig, but they have the diff --git a/linux-user/sparc64/target_syscall.h b/linux-user/sparc64/target_syscall.h index 34f49df4a1..3073a23e03 100644 --- a/linux-user/sparc64/target_syscall.h +++ b/linux-user/sparc64/target_syscall.h @@ -12,7 +12,7 @@ struct target_pt_regs { abi_ulong fprs; }; -#define UNAME_MACHINE "sun4u" +#define UNAME_MACHINE "sparc64" #define UNAME_MINIMUM_RELEASE "2.6.32" /* SPARC kernels don't define this in their Kconfig, but they have the From patchwork Mon May 14 18:19:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 913187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40l8JJ5YYLz9s1R for ; Tue, 15 May 2018 04:25:20 +1000 (AEST) Received: from localhost ([::1]:47614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII9u-0000lS-Dt for incoming@patchwork.ozlabs.org; Mon, 14 May 2018 14:25:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fII4f-0005Gj-5B for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fII4a-0005LA-Kj for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:52 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:43111) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fII4a-0005JM-9R for qemu-devel@nongnu.org; Mon, 14 May 2018 14:19:48 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MdRyx-1f0tXg44YN-00IRdo; Mon, 14 May 2018 20:19:36 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 20:19:28 +0200 Message-Id: <20180514181928.18034-8-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514181928.18034-1-laurent@vivier.eu> References: <20180514181928.18034-1-laurent@vivier.eu> X-Provags-ID: V03:K1:bs00MlDvELKh1pi8qPs5AsWzR6pUpdw1euPNfJC0dRVmW8yk3Ne gpYmX+D3Db8xqXkP8fqjgEz+03/dWWqx37Z4YxDpUhBfOArJ1pJ6FcHpLCZq1rXgwryN/6T aVET6phVfhEoZEtUTYDj5i2Us58WCASYurKkvcMd2HS8/W5DDph76LJ3lSWyr458lZiegb/ 2DNIvsrMiZmZ8/LDW9cEw== X-UI-Out-Filterresults: notjunk:1; V01:K0:wkt+H0zRjDw=:SMuH5CmNzx4Ig9qjDLK3EU /rPqXetp+Nx8XA6h+jpqH14Cwe5kPDEq57IG6pzT+J9yvtg7ztRIfUVimZrYH6RyydrkQLwvJ sdWiI+D/A2ppfykl8qydXoqgM0ESXSqOLE7cddmLy/GGXIjHMTP4+N+ybadigvr4Kqm99O/p7 1Y1T+EoUwC1djRciaq2+kdLhg/RyfhBmIcL5MbGR2TPsuCu7v/IWBiEbDZxxeVI5N8wWQPm3k wlCBIwKkoHGA7SSwWdnKYRFY9rhCDp9e4pGR2lP7+NKDmpet73Bu90k66mZ0mZrS0/SwIjPeY dzbXth+zhv/3GOgJUHoMYW+DMljnPlm8fewdsOfMAZnsHb9jmYsf0hgvNK0e1mZtyAK2jVVjv aYUGkUolH/vVxu+VIQA8g7KKq2wP2SN7YDdkqIN4PPKQiZSIKr0p2ErUtqbaouKkFKW3tsOzR Zun2PgcNIMWNJDiuDEjWQlNcSDSeaGC9aBoVu6wXN4JwSh8Y1cOeUXQFUnZhK1MnwjO2Te/0y ruUlRQBdose9QPo2qVIS3rj1bi7KEUaPT8BY6Azc0I1zxfzfvw5fm8CgSwqUxkGaJKviRBBMe nxRWILL5/tz5alb6VleZME9xLsZg/OQccpwfo8ikeODwGD6A/fotakOSADYByxdseF9YvOAhl 2iDO1S6jjx9S9miNOr5o8uC0P10ul9tuWsme963eN8f+WdyCqwCJnjrhYNk52Uo9lo8w= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 7/7] linux-user: correctly align types in thunking code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is a follow up of patch: commit c2e3dee6e03527baf8698698cce76b1a3174969a Author: Laurent Vivier Date: Sun Feb 13 23:37:34 2011 +0100 linux-user: Define target alignment size In my case m68k aligns "int" on 2 not 4. You can check this with the following program: int main(void) { struct rtentry rt; printf("rt_pad1 %ld %zd\n", offsetof(struct rtentry, rt_pad1), sizeof(rt.rt_pad1)); printf("rt_dst %ld %zd\n", offsetof(struct rtentry, rt_dst), sizeof(rt.rt_dst)); printf("rt_gateway %ld %zd\n", offsetof(struct rtentry, rt_gateway), sizeof(rt.rt_gateway)); printf("rt_genmask %ld %zd\n", offsetof(struct rtentry, rt_genmask), sizeof(rt.rt_genmask)); printf("rt_flags %ld %zd\n", offsetof(struct rtentry, rt_flags), sizeof(rt.rt_flags)); printf("rt_pad2 %ld %zd\n", offsetof(struct rtentry, rt_pad2), sizeof(rt.rt_pad2)); printf("rt_pad3 %ld %zd\n", offsetof(struct rtentry, rt_pad3), sizeof(rt.rt_pad3)); printf("rt_pad4 %ld %zd\n", offsetof(struct rtentry, rt_pad4), sizeof(rt.rt_pad4)); printf("rt_metric %ld %zd\n", offsetof(struct rtentry, rt_metric), sizeof(rt.rt_metric)); printf("rt_dev %ld %zd\n", offsetof(struct rtentry, rt_dev), sizeof(rt.rt_dev)); printf("rt_mtu %ld %zd\n", offsetof(struct rtentry, rt_mtu), sizeof(rt.rt_mtu)); printf("rt_window %ld %zd\n", offsetof(struct rtentry, rt_window), sizeof(rt.rt_window)); printf("rt_irtt %ld %zd\n", offsetof(struct rtentry, rt_irtt), sizeof(rt.rt_irtt)); } And result is : i386 rt_pad1 0 4 rt_dst 4 16 rt_gateway 20 16 rt_genmask 36 16 rt_flags 52 2 rt_pad2 54 2 rt_pad3 56 4 rt_pad4 62 2 rt_metric 64 2 rt_dev 68 4 rt_mtu 72 4 rt_window 76 4 rt_irtt 80 2 m68k rt_pad1 0 4 rt_dst 4 16 rt_gateway 20 16 rt_genmask 36 16 rt_flags 52 2 rt_pad2 54 2 rt_pad3 56 4 rt_pad4 62 2 rt_metric 64 2 rt_dev 66 4 rt_mtu 70 4 rt_window 74 4 rt_irtt 78 2 This affects the "route" command : WITHOUT this patch: $ sudo route add -net default gw 10.0.3.1 window 1024 irtt 2 eth0 $ netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 10.0.3.1 0.0.0.0 UG 0 67108866 32768 eth0 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 WITH this patch: $ sudo route add -net default gw 10.0.3.1 window 1024 irtt 2 eth0 $ netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 10.0.3.1 0.0.0.0 UG 0 1024 2 eth0 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Message-Id: <20180510205949.26455-1-laurent@vivier.eu> --- include/exec/user/thunk.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h index f19ef4b230..8f55b233b3 100644 --- a/include/exec/user/thunk.h +++ b/include/exec/user/thunk.h @@ -149,20 +149,32 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host) case TYPE_CHAR: return 1; case TYPE_SHORT: - return 2; + if (is_host) { + return __alignof__(short); + } else { + return ABI_SHORT_ALIGNMENT; + } case TYPE_INT: - return 4; + if (is_host) { + return __alignof__(int); + } else { + return ABI_INT_ALIGNMENT; + } case TYPE_LONGLONG: case TYPE_ULONGLONG: - return 8; + if (is_host) { + return __alignof__(long long); + } else { + return ABI_LLONG_ALIGNMENT; + } case TYPE_LONG: case TYPE_ULONG: case TYPE_PTRVOID: case TYPE_PTR: if (is_host) { - return sizeof(void *); + return __alignof__(long); } else { - return TARGET_ABI_BITS / 8; + return ABI_LONG_ALIGNMENT; } break; case TYPE_OLDDEVT: