From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712052; cv=none; d=zohomail.com; s=zohoarc; b=lclnHXdwfaYHjtM1b+pbQW9EeaZOmLKq30SkwB9T1Fl3guOQeaubqf0OtYPP6wlzQ1v3etdinK5PQtul+8LZPPfJ39VWuY6cf8+ZH5e0bjjGjJMjjg4pgkwJ5SWMiH1O7YMaEc2vwJaiTGa5/TIsB8sBgtYvWMJMKBuVGwSFqlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712052; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lB8MO249X427iLqZ++NhegtbS4T1YKEBqOK1UqaFraM=; b=FHBFmxhPZgVJEWpjs/b3CxEN97vPjlpdqcjBMy5o8D1a3pHlKSisWvfz8DyDtQJo5Jeeb+QjaceleElhhrbUKqtJSk34hn3DEmkFdNil1pefG2CUOzI3JxhznOIy7R1aCTqzv86SZqoAUVKfM5+EApr8VtZHDs9UKpKDOx43gOs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712052068132.24556650478416; Tue, 14 Jul 2020 00:34:12 -0700 (PDT) Received: from localhost ([::1]:46814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFS6-000374-JA for importer@patchew.org; Tue, 14 Jul 2020 03:34:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR7-0001Ur-I7 for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:09 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:53741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR5-00024N-RM for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:09 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MYN7M-1kQXgZ05MA-00VPAD; Tue, 14 Jul 2020 09:33:05 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/7] linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols Date: Tue, 14 Jul 2020 09:32:53 +0200 Message-Id: <20200714073259.1464675-2-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:W8tc4ceolGsH6LHGPhqIvvP44+GvrN4edGrQjVNEYtQcOZbSOWp K84EOwH1QSumPJ45j0WW6YGk9UspzlYMZnqBDbv7E8VFg9P/RKLY9EHi+Cmsp4TBLPCnzJV r59It/nbNC+KX7lshkEKUvi90pWOfNF8dmRJaNZMGWj9XxeFk4E/C5tBZKYMveKEGeHh7TJ Ioj7ODMtjvPoPYNhL6uBw== X-UI-Out-Filterresults: notjunk:1;V03:K0:FQpbJyN0Hhw=:H0gjQsm0qJ3RqZ/iqAz/iT Wu2eldudg6+crqCiNqXRukManuCYkEk7bFdkAtp60wv0pwzKvCHuPSvPnKJ2K9B0RlRj0FLnG bjRjNWhtWf5spNP93qp7Yu/QshGrHQbSSwBXJd5DGqn8l4rFGCD7liS0YFozwFYqpCFL6SKEa 3y01/VNFFE935z3/6pTXDshhydBMM5MoCeWSdp529Kk6lgUFdr8EfivOGH8vG1GKabgHiqCZB YqKzaTFlPSCpv2IKaUp5oWZDTy8OADliYjlNG4i/sj0flPBvZiPamW3sP051BwbaLnPi4NEwy oANSW2t7XidpVb6SOsTTo713ajAI/VsIVswVgEmcMCyltIb+1D45Q+wQAUtCkp9AiO4ooQHf/ 6xT1+BojLiEhnENChvHw/owk/TthCnU1ezxTtbQUiDtHcr/fp3D7cKuoptytjZ8X2qsd9aMqt eyRgQ3Jn6QVqH/fIHJjjjJyQUpMDjcjD0zrtPDGXnSHtZk6D2p01RX5OuhmgLHOgbsNhQdg4u W0APXVOJxr9XDHfxfh+5V8MrjhW89S1K7++RHclMJiSH7v//b/xEkGcYyS+qvYyypvwUuldxH cBIwgapiOAvrIRVcVV808j1uTDjFrQ5utxsGqR6kURyn/5yNlVPrzT2PExIWiStLR4EEJyWYY qKot4RsIWsStskhJ8IQ/mFEHnY+21NfYp+bmKV/tvelW0pVT5JBtTpui5y+BbofgSu9K5Quwu oHojcqOCq8dCKqLL3cV3JR8GTy0nK0XDs8a12crdwcC0zFUWdJ0FJG4p3JYIZFVk9EPHJmu7D 5f2lZtmE28R39BdzDrxJwgevvIukuuvP7BrVeeyQagaQfM49fjsS72JCLO3fR/9dVf+7BOA Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:33:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Josh Kunz , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Josh Kunz Linux uses the EPROTONOSUPPORT error code[1] if the users requests a netlink socket with an unsupported netlink protocol. This change switches linux-user to use the same code as Linux, instead of EPFNOSUPPORT (which AFAIK is just an anachronistic version of EAFNOSUPPORT). Tested by compiling all linux-user targets on x86. [1]: https://github.com/torvalds/linux/blob/bfe91da29bfad9941d5d703d45e29f0812a2= 0724/net/netlink/af_netlink.c#L683 Signed-off-by: Josh Kunz Reviewed-by: Laurent Vivier Message-Id: <20200707001036.1671982-1-jkz@google.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 98ea86ca81fb..e9f53340cd65 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2990,7 +2990,7 @@ static abi_long do_socket(int domain, int type, int p= rotocol) #endif protocol =3D=3D NETLINK_KOBJECT_UEVENT || protocol =3D=3D NETLINK_AUDIT)) { - return -TARGET_EPFNOSUPPORT; + return -TARGET_EPROTONOSUPPORT; } =20 if (domain =3D=3D AF_PACKET || --=20 2.26.2 From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712054; cv=none; d=zohomail.com; s=zohoarc; b=coaBoW8fxDeKe1/RLP4Bq1arZu6hndtVXaykl45X1xpu7lIP7aBvu1LRUU5cd+G6X9z5n7eyoyN43kxyBch8UB70tT449y8vzK4MJFspKA468wTe7EK4y8lNgn5GEXvDVP0oO3jHdLCwR5WYxhTt3e0VR2L1bxqncb/3oJrl2qc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712054; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jBRWjA9zAdp0xwdkoq000oEtH31bY41S5i6R7pR82pE=; b=X0atFMlpV/MI1MCLhsFhl2HYybmyrJXLK/1a+8p7kb4mMm2JwWUZtSAdG+cAMt5tEncgEVQLV9W9RUxTR0/iuCZE33HDLA4vJ0MLB3kMBs1uyDYfHVGBtXFLiB8CYT4+uTlpFuvid16tNn9BIXsmnCyw6h3a+GhIKqWiy8ptyD0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712054263744.7404236182258; Tue, 14 Jul 2020 00:34:14 -0700 (PDT) Received: from localhost ([::1]:47096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFS9-0003Du-15 for importer@patchew.org; Tue, 14 Jul 2020 03:34:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR9-0001Xy-Dg for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:11 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:40887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR7-00024h-Cx for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:11 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MI4cT-1k7dDy2451-00FFBo; Tue, 14 Jul 2020 09:33:05 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/7] linux-user: refactor ipc syscall and support of semtimedop syscall Date: Tue, 14 Jul 2020 09:32:54 +0200 Message-Id: <20200714073259.1464675-3-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:uQJ81YhjAukFjG6a0Dvb8tSdrCIWf7M9Bg5Wf5qUuBcn/xM+jvI R5sLEnTDoMAGTQlVynbCPna+Qy32YjTz5JMpNM02jha32UiS5rSmbKOL4wBWcaFBf3FPU/t j6xm0Wyj+YNTaun3+NVjCSoBmSiTnmXSkFzuKuWaaicOszUHwcmI3xoNSAoI+Nia3sogzSX Bgc0xt8Ba5B78XTWL1ofA== X-UI-Out-Filterresults: notjunk:1;V03:K0:9eR0s16Qioo=:KaXqzTyng+OHiJVUj88y36 vlERKUFLJqAOlspWyfpK3ZiEWfR9P522iM5AfE05ht5jBiFhrPHuwgbzzHecn1PEWKlsWwJTg i0xtzsedzVHq1sZXR6JaIOM+dpdLSIgJ7ygmedp5OASHfi63iJ8zDPv7LNdry9xD7vXZ1FMCA kAGzY/+3q14m62HIMIewmuUtm/DD7QYWMT/VBLF2wEBR8OJrfpNrNwSaG6KW2QTVV2Gz5gz9P hLMIDOlN5b66a19ChqLqgZHxxu52qCh8kjK/kMI/aqclT308rp1RhJI144ULmHejdOX8odJSe sV3Oq0s+rdwGIkonRiDNy5uC80w7+MOSR3TkhgLFG9Sr0asxuVw9Y4+ERQoMhLsDvkyTD9dT6 VytMIipG+2oDG6tHCGOhMa/IhkD8O8BoGqGAGKOHp1JkhPuB93b+J54Hi2r2bWXQmVPkzu8iT UkYEYB5vF25p/LqSRpbdkPiPCGU95f597MUclArqVMtYfBSw5U3KoOhkWm0KVPmmkQbt4cdVP 5G8geNc3VaNnCcMvoB0WUlAGyRVcKPE2Fz5nWIpo1I0WBP5r1z47GzSuM/ycfLb3WraExLYuI w6MfNgunCEhe81J4c0Fr4sNmj+yMVpTdqtCP+M7K2aWDRk/PQiC9OZS05tZ/wvOdb3xWGaQZu bs6qaxU+hNY/yLFVar91cj/fkY1/yZJHoC7f6bouSQ/Iw9QpAfrAzEg81TKt2FzWBhtiEEY82 7afSEmnSpIERpzBGeTr93bOyChG238G2YBCtxGd3IKt8O/VqSh91eTML3T+74LqQ+vQxWByVp SUf5uThs1l94MyveA7B5b3PfUh4uBZ6Ykp5wM5aFtKMwxgFiQCo1/u4od8JFvOXRhPToR5S Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:33:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Laurent Vivier , Matus Kysel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Matus Kysel Refactoring ipc syscall for s390x and SPARC, so it matches glibc implementa= tion We should add support of semtimedop syscall as new version of glibc 2.31 uses semop based on semtimedop (commit: https://gitlab.com/freedesktop-sdk/mirrors/sourceware/glibc/-/comm= it/765cdd0bffd77960ae852104fc4ea5edcdb8aed3 ). Signed-off-by: Matus Kysel Message-Id: <20200626124612.58593-2-mkysel@tachyum.com> Message-Id: <20200626124612.58593-3-mkysel@tachyum.com> Reviewed-by: Laurent Vivier [lv: merged PATCH 1 & 2 to avoid build break on PATCH 1] Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 84 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e9f53340cd65..1211e759c26c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -817,9 +817,14 @@ safe_syscall4(int, clock_nanosleep, const clockid_t, c= lock, int, flags, const struct timespec *, req, struct timespec *, rem) #endif #ifdef __NR_ipc +#ifdef __s390x__ +safe_syscall5(int, ipc, int, call, long, first, long, second, long, third, + void *, ptr) +#else safe_syscall6(int, ipc, int, call, long, first, long, second, long, third, void *, ptr, long, fifth) #endif +#endif #ifdef __NR_msgsnd safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz, int, flags) @@ -1230,7 +1235,8 @@ static inline abi_long copy_to_user_timeval64(abi_ulo= ng target_tv_addr, defined(TARGET_NR_pselect6) || defined(TARGET_NR_pselect6) || \ defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \ defined(TARGET_NR_utimensat) || defined(TARGET_NR_mq_timedsend) || \ - defined(TARGET_NR_mq_timedreceive) + defined(TARGET_NR_mq_timedreceive) || defined(TARGET_NR_ipc) || \ + defined(TARGET_NR_semop) || defined(TARGET_NR_semtimedop) static inline abi_long target_to_host_timespec(struct timespec *host_ts, abi_ulong target_addr) { @@ -3878,25 +3884,53 @@ static inline abi_long target_to_host_sembuf(struct= sembuf *host_sembuf, return 0; } =20 -static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops) +#if defined(TARGET_NR_ipc) || defined(TARGET_NR_semop) || \ + defined(TARGET_NR_semtimedop) + +/* + * This macro is required to handle the s390 variants, which passes the + * arguments in a different order than default. + */ +#ifdef __s390x__ +#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \ + (__nsops), (__timeout), (__sops) +#else +#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \ + (__nsops), 0, (__sops), (__timeout) +#endif + +static inline abi_long do_semtimedop(int semid, + abi_long ptr, + unsigned nsops, + abi_long timeout) { struct sembuf sops[nsops]; + struct timespec ts, *pts =3D NULL; abi_long ret; =20 + if (timeout) { + pts =3D &ts; + if (target_to_host_timespec(pts, timeout)) { + return -TARGET_EFAULT; + } + } + if (target_to_host_sembuf(sops, ptr, nsops)) return -TARGET_EFAULT; =20 ret =3D -TARGET_ENOSYS; #ifdef __NR_semtimedop - ret =3D get_errno(safe_semtimedop(semid, sops, nsops, NULL)); + ret =3D get_errno(safe_semtimedop(semid, sops, nsops, pts)); #endif #ifdef __NR_ipc if (ret =3D=3D -TARGET_ENOSYS) { - ret =3D get_errno(safe_ipc(IPCOP_semtimedop, semid, nsops, 0, sops= , 0)); + ret =3D get_errno(safe_ipc(IPCOP_semtimedop, semid, + SEMTIMEDOP_IPC_ARGS(nsops, sops, (long)pt= s))); } #endif return ret; } +#endif =20 struct target_msqid_ds { @@ -4056,8 +4090,13 @@ static inline abi_long do_msgsnd(int msqid, abi_long= msgp, #endif #ifdef __NR_ipc if (ret =3D=3D -TARGET_ENOSYS) { +#ifdef __s390x__ + ret =3D get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, + host_mb)); +#else ret =3D get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, host_mb, 0)); +#endif } #endif g_free(host_mb); @@ -4066,6 +4105,20 @@ static inline abi_long do_msgsnd(int msqid, abi_long= msgp, return ret; } =20 +#ifdef __NR_ipc +#if defined(__sparc__) +/* SPARC for msgrcv it does not use the kludge on final 2 arguments. */ +#define MSGRCV_ARGS(__msgp, __msgtyp) __msgp, __msgtyp +#elif defined(__s390x__) +/* The s390 sys_ipc variant has only five parameters. */ +#define MSGRCV_ARGS(__msgp, __msgtyp) \ + ((long int[]){(long int)__msgp, __msgtyp}) +#else +#define MSGRCV_ARGS(__msgp, __msgtyp) \ + ((long int[]){(long int)__msgp, __msgtyp}), 0 +#endif +#endif + static inline abi_long do_msgrcv(int msqid, abi_long msgp, ssize_t msgsz, abi_long msgtyp, int msgflg) @@ -4094,7 +4147,7 @@ static inline abi_long do_msgrcv(int msqid, abi_long = msgp, #ifdef __NR_ipc if (ret =3D=3D -TARGET_ENOSYS) { ret =3D get_errno(safe_ipc(IPCOP_CALL(1, IPCOP_msgrcv), msqid, msg= sz, - msgflg, host_mb, msgtyp)); + msgflg, MSGRCV_ARGS(host_mb, msgtyp))); } #endif =20 @@ -4372,7 +4425,20 @@ static abi_long do_ipc(CPUArchState *cpu_env, =20 switch (call) { case IPCOP_semop: - ret =3D do_semop(first, ptr, second); + ret =3D do_semtimedop(first, ptr, second, 0); + break; + case IPCOP_semtimedop: + /* + * The s390 sys_ipc variant has only five parameters instead of six + * (as for default variant) and the only difference is the handling of + * SEMTIMEDOP where on s390 the third parameter is used as a pointer + * to a struct timespec where the generic variant uses fifth parameter. + */ +#if defined(TARGET_S390X) + ret =3D do_semtimedop(first, ptr, second, third); +#else + ret =3D do_semtimedop(first, ptr, second, fifth); +#endif break; =20 case IPCOP_semget: @@ -9684,7 +9750,11 @@ static abi_long do_syscall1(void *cpu_env, int num, = abi_long arg1, #endif #ifdef TARGET_NR_semop case TARGET_NR_semop: - return do_semop(arg1, arg2, arg3); + return do_semtimedop(arg1, arg2, arg3, 0); +#endif +#ifdef TARGET_NR_semtimedop + case TARGET_NR_semtimedop: + return do_semtimedop(arg1, arg2, arg3, arg4); #endif #ifdef TARGET_NR_semctl case TARGET_NR_semctl: --=20 2.26.2 From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712135; cv=none; d=zohomail.com; s=zohoarc; b=XawzjCYGKzZcOnBJnNdk1u3nh17bhjS+a9djeiK5GxX8ZTWe04S/JrGdyL0rEfsc+kIjp14sd5e1uZ2fs3eXjeswxxX/2scO4X7/xjqRy9A4lSPXIlQeTej5VUuoR2VZBtOFlXtYFxGHRWzOyMWgL+fH5S6Z0S7sNSU6su3jWwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712135; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fuxFjlV7eUDV6uuuCy6VcDlM/YtH2QKJdxcAAqzhBtY=; b=K36Qv1habXaSMbY9unPULMoKy2nDGpvpgbba6X1sCgGPJWqxS1+xhBpzmLuyKMlTUMVQEkyOQJzNGB5FMJrHmKXz3HkU5vr+dJCfiRT2DLV24qhsMlLKAMQElSBzGxMa1Ylk5VFGztermSww5xmYo+V2mBfUOmfZqYktKeFtwbU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712135639908.2788364776151; Tue, 14 Jul 2020 00:35:35 -0700 (PDT) Received: from localhost ([::1]:54520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFTS-0006CQ-7s for importer@patchew.org; Tue, 14 Jul 2020 03:35:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR8-0001WT-NL for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:10 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:55057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR6-00024R-2I for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:10 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MCsDe-1k457h45g0-008uTH; Tue, 14 Jul 2020 09:33:06 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 3/7] linux-user: Fix Coverity CID 1430271 / CID 1430272 Date: Tue, 14 Jul 2020 09:32:55 +0200 Message-Id: <20200714073259.1464675-4-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7Gfc1ASwvj47EHlnETkYlECSSDUswwk4+KQ5UOe0YwXlWEQdfyP VYRFiI+B8j8/95bdHhdglNHcmMc7kN5Xq2oWyvmWleS/Q9CQMoVBn0I2lBsdkRaM9/uedQK orUmdjZa5W324LNCAtjRGCmADvTHEnNGJrcAKLWnwVYeCXPBx23DV5luVpebe8pYmKIcJ82 zgbQjRvvaOzsYD/ZlEOzw== X-UI-Out-Filterresults: notjunk:1;V03:K0:+TspCWpgr5Y=:Y6SOb9c/f6KtzLoYN1kUpl FxWUXfxAJQvudDRkfNlMGi8yEjnSqmyiAsARIcWKYJh6M+7lCm18pTdyrBKxcFgu0eEPou8jx oByM/Fc1Glv1sfT2aa9gtuJtUCvdbAWQIIqURobYCoTuKGV0Md1bhn3wJpI/+XPdQuyu3un1h oofRTmNOnqfN9fhufoxHEWlfzRcSOqhaOrPesu0ZUI7Nohj6VT73ozg3u5UwHrP38bLpxgMBs vS8FcrzBFVWwsZWEmh9RGHdyaDj9UA5u2rrh1RUpq/8JNUYRcEODON8HsRaUdiExPX4+O2piX nBnXh3CwmMhB0f6+zhRTlR5lsppjyVAAqzJNouDWoSNK0JeSAHEVKeZkTW/DOO+RkiP7facrq xmL13akBiuxKxgMZuRR7yV/YYbqv7a/jL6WM1iaEgqHaoOs76kWSvdLz1ZrIK11REozO/WzdW LcuCeWZcOeAQaFMfRjNIYW2j8z8vzzj9cP3Ahiu04th5HGScZ79Holy3dofTvkSiNn9j08nUm SeTkttYItNUxs3BBdVMw5BpUYRKkd8BgqlXN9DQxjk+kbEgrHIuNC4oafqEupjXhWTvszk25m jrLdE7n9QEULkFAARQEKUPL/EzTMdSIwlGy4i0EOAu/iCcF6SFLEBZX/vX6pSPhCjM86twCqh MYMohC7GOaxzm2tOycu9HRTF11+ET1kfm53rMZFM6slHgT4KyJb4w3xgo64rYAFNoRGsBdYOy 0+YoDKulrVRzKKjUbE7puW3RZ5nlYIWcebqnbAiGxE/ucM9Ntyjezr5GD+fbQD63z7lIM0KWQ ruJ/fpPYOCH3/RLbgds4oeizTKxgSwcXCjbnPn/xFOKUA8sJMOEEchqdrh3e5Gvh8cwf5Wu Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:33:05 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" In new functions print_ioctl() and print_syscall_ret_ioctl(), we don't check if lock_user() returns NULL and this would cause a segfault in thunk_print(). If lock_user() returns NULL don't call thunk_print() but prints only the value of the (invalid) pointer. Tested with: # cat ioctl.c #include #include int main(void) { int ret; ret =3D ioctl(STDOUT_FILENO, TCGETS, 0xdeadbeef); ret =3D ioctl(STDOUT_FILENO, TCSETSF, 0xdeadbeef); return 0; } # QEMU_STRACE=3D ./ioctl ... 578 ioctl(1,TCGETS,0xdeadbeef) =3D -1 errno=3D2 (Bad address) 578 ioctl(1,TCSETSF,0xdeadbeef) =3D -1 errno=3D2 (Bad address) ... # QEMU_STRACE=3D passwd ... 623 ioctl(0,TCGETS,0x3fffed04) =3D 0 ({}) 623 ioctl(0,TCSETSF,{}) =3D 0 ... Reported-by: Peter Maydell Fixes: 79482e5987c8 ("linux-user: Add strace support for printing arguments= of ioctl()") Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell --- linux-user/strace.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 5235b2260cdd..39554d903911 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -889,8 +889,12 @@ print_syscall_ret_ioctl(const struct syscallname *name= , abi_long ret, arg_type++; target_size =3D thunk_type_size(arg_type, 0); argptr =3D lock_user(VERIFY_READ, arg2, target_size, 1); - thunk_print(argptr, arg_type); - unlock_user(argptr, arg2, target_size); + if (argptr) { + thunk_print(argptr, arg_type); + unlock_user(argptr, arg2, target_size); + } else { + print_pointer(arg2, 1); + } qemu_log(")"); } } @@ -3119,8 +3123,12 @@ print_ioctl(const struct syscallname *name, arg_type++; target_size =3D thunk_type_size(arg_type, 0); argptr =3D lock_user(VERIFY_READ, arg2, target_size, 1= ); - thunk_print(argptr, arg_type); - unlock_user(argptr, arg2, target_size); + if (argptr) { + thunk_print(argptr, arg_type); + unlock_user(argptr, arg2, target_size); + } else { + print_pointer(arg2, 1); + } break; } break; --=20 2.26.2 From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712132; cv=none; d=zohomail.com; s=zohoarc; b=LanC2Oya2KYX4wzy2cKWAdx8vOqE+clei3eyY4OOi4kujx9XxAy54dNU+DAnvA5LU+j3ZDjG9BqH7GiC7QlE4RWwYSzd3KQN8UuWuv7PrbUuDL7agdWBtfnymT9Bf7DXNBRGgYfSJTaqP7ixt22IXyNDr5xovnhrrTwWb3Eypu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712132; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x5YQX7Gv7Rs/dQvIBpihzF/V3BOQkOrCCJquszn0rXs=; b=P/YMe8eYV8IL3tA0o5zMTNHecOkNPPG6kLiexptW3tYwz7h/8Vo3LPOJ3pCZb44MboWvHACp487diH8ryhOnCQWoBKEn8jso1VV93YXWPt6D0pmRyKen0AW5pjB8wy+L4X6MXLZyhMo4wUWWdlNsG8boPKwxvkB7Ko5nlnIoNsU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712132652257.6476924469613; Tue, 14 Jul 2020 00:35:32 -0700 (PDT) Received: from localhost ([::1]:54266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFTP-00066J-5c for importer@patchew.org; Tue, 14 Jul 2020 03:35:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFRA-0001ZR-33 for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:12 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:43819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR5-00024P-Vx for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:11 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M734j-1jwac91SqV-008cPY; Tue, 14 Jul 2020 09:33:06 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 4/7] linux-user: add new netlink types Date: Tue, 14 Jul 2020 09:32:56 +0200 Message-Id: <20200714073259.1464675-5-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AbIAij+Z3f0St+yHezyXFOZxIBusGhUoJNPuAphHcS4/dzNbV8O 3lTx+skyChLXYcYMZmjv340Q+zxVlq0WJsfcg49qR6etqsPZfPoBhvsQfkmEkcaGXyqlesj mV66BIuWP8T3SqXAXyqqoExkcssxSx4Y2OkR7i3H35t0fAjo4ypJVre63+9xjvQpBX/74zz oPf0iH7AY6Y9s7TkoqWAw== X-UI-Out-Filterresults: notjunk:1;V03:K0:VXI+FDNetjk=:8dKehAlsZa1jYs3FQn1wYF IBhVW9CVqSf0rUHJCNcd3t2SBO6PEfakIZJ1Mtt2rH25LQgmcaUIbdMceCalFiLWtV5TWVp9V gNJp+ccZdrHePJtkojZDsfK//Z56CC5caWDfHyMp3zZewAbAo9FwCWqbWWOqwK0QUmWkQVoJl +0tv1Q0eJlZU4yQcO+ny5hJV+cxYAfDoGDME8WR3nXphEj2C+bCvWGlcrmt8fLg4nfqwZ3UWB By+oB6/QpHNxEgz5O1nwWZr0wlW6jnXq9Fy1h0+snGlFPEo0HP768zrGGpehDjeswuwRBfTPP 9p39dJANNmG/SVxt9VfqzR0qWThOknGXfHAwMHO6zPn0WqOWIpAKJJOm0WDGugcmlJsWDWvq7 3JcUie5IHKhlBH5XuW+1gEPiHE4clQFje40uCrRAjzTwmxV8DZtHymnkofO3Fq/JAICcNMn3p 6T7MMq2w2r/0YUbcXqRBrECcl8KYZ6c1P9tuSIwhvSfq+6myNFbnyX54AT7oNAE1mtoVSIQHE KRYOm30nWaVP1ZBstA2ckWejscz9Wgu2eZiRsu5s916k5dIBuhvm05dLYzgkKT99w9PUTfFXz S1QuEeaynHD/5GWOv2OnKG6g34tQ9ILehxL8m8QmGMkJoEWm4oUkv3rnE27Y8XsNUNGDrA8M3 qz4Xu5HFXtv+9HnU5x1qXlsvlIzFT/tBYA9ymasg+TQGJ7ZqRsByKXPR+gQuJ/2o2IfXu8f9L ajRIkI0wTA36QcYX3M/iTD6rSqGFby4dxxhQ4IDj8TVMDY7Yn3aSBjXoUcp8SBLSYxmsMPYp5 r87wGpnV41GdlpaVcNmTUXNtsNIok0YkjLPSUlL1fByUkr/K/5xCr8JnrmMMYyHbu8wCNZs Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:33:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Only implement IFLA_PERM_ADDRESS to fix the following error: Unknown host QEMU_IFLA type: 54 The couple of other ones, IFLA_PROP_LIST and IFLA_ALT_IFNAME, have been introduced to be used with RTM_NEWLINKPROP, RTM_DELLINKPROP and RTM_GETLINKPROP that are not implemented by QEMU. Signed-off-by: Laurent Vivier Message-Id: <20200709072332.890440-1-laurent@vivier.eu> --- linux-user/fd-trans.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index c0687c52e62b..5d49a53552b2 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -133,6 +133,9 @@ enum { QEMU_IFLA_NEW_IFINDEX, QEMU_IFLA_MIN_MTU, QEMU_IFLA_MAX_MTU, + QEMU_IFLA_PROP_LIST, + QEMU_IFLA_ALT_IFNAME, + QEMU_IFLA_PERM_ADDRESS, QEMU___IFLA_MAX }; =20 @@ -807,6 +810,7 @@ static abi_long host_to_target_data_link_rtattr(struct = rtattr *rtattr) /* binary stream */ case QEMU_IFLA_ADDRESS: case QEMU_IFLA_BROADCAST: + case QEMU_IFLA_PERM_ADDRESS: /* string */ case QEMU_IFLA_IFNAME: case QEMU_IFLA_QDISC: --=20 2.26.2 From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712055; cv=none; d=zohomail.com; s=zohoarc; b=Yon8T4jhvTNEaB6MKvfvzYlJOoQq24wfV/WMCBb2Zp7RRe9qFmDCnBkQ6OTReqnjApk9+l2mUR3uoTKAAzzLcHf8A2dCeX2n6P4xPtsP4M7u6Io5KoTMedRGNDtMICmX0UXhLZbl351zxscXSY4dLXWeSrfuxYPtb345s753euQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712055; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wJWY58YzOITpsjF/pL6m1iNK+A6L2C/c4I7TQAWf0ok=; b=C6kw7tDgV5Mk1vfaHfr1cA+nRHznlUdFIoQa87OSY5EIBAxtsnbdNdJU82cEbx0QBC6L3w140y+6zDbDjWc94wSiFVi/QMdQpKQIA8mPY7vTlpm26cprotffgYGDCHF4DvX2UWfDxuDVrMLhFCZVckkzUseHCY4cC/hMcsokTjw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712055469730.8810048004158; Tue, 14 Jul 2020 00:34:15 -0700 (PDT) Received: from localhost ([::1]:47152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFSA-0003FJ-73 for importer@patchew.org; Tue, 14 Jul 2020 03:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR9-0001YR-Ld for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:11 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:42057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR6-00024T-68 for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:11 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MMnru-1kBfrK2xgy-00IhZz; Tue, 14 Jul 2020 09:33:06 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 5/7] linux-user: add netlink RTM_SETLINK command Date: Tue, 14 Jul 2020 09:32:57 +0200 Message-Id: <20200714073259.1464675-6-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:YTr5QFQR2Wca624ayED3bdxReXiTeZe/3JxL/lhehSe2StzQ/T5 jZkSwbVvsiD2UL5UPdLvSDNcYKEGfv9ozDlRv9Dup45WebNunsfP+JmX+we8qBj20z02aSy 6xp0gQ9P2OOPgeS1uxeIfqL1br3xkyn0uKSPV937c5NfK12ZCpnydgnXFQs68pZAc669Ln/ WlAGByhblPgOxTLV+lvCQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:py25baA/w8o=:6nfN6g+EWhM2fUy8em6n4P +kSsPl7wvqJV32LS9tCwFJUFKPXaM+pnZCC5jM9+PgzDlC/Z7rpWZmBSvv593Aq1NEEwsLyN9 9TCoYxCe2lh0LlplvvbrdzH1E4l7lLiIJlMliMAB/ith19lffgjYQkXAbFcg9xohTsDbDoJaU FklNIGtChfHciSQ+pFOIs2eAW/hJEocLES3mP6I36GT6NjVq3UB9l3mBZXtNuUXk/uQw+zFwQ SElZ0kILEeBDMNdPAzOlCxTZFWL18bnSMWTxa6vmEjDNH+T8Kozdhqu2B6GKsuyewHUqg6uYr FlNMPtqENSSnuafp0rHCXB+5oRbJ5ju+F19tpNitTMdrH+F6JcGZf+XgWzTYWghTmQInS4z+j FAlbnAbFM8KkwHEL8ymgZia+UkuxqH3BNuWdXCmtAdWtkFgR94P/aE3ihb7TcvDXzOejGC/b7 Jubl4RB+KKmob3ORmKoxqXNb8dxwopgDo5EDAfDRRRQacGuZ9GxMTiwZSwj+lSKB9deKEtLFX HJcQxv0K7U8xk4/HcQm6gz6XJ2rjSHaVnJGldwjmQ/Gt1wkCSY7LMZ7IJ2jezDzb3Cvckxys1 ap07eDdyHblduxp4uM8RmlSk3GLdUh5A1ARQ93zrhTKZsVbk5m7SQFoZ4aLEyAlsnJDy5hEkl wAOOpG8k04Qz5kHXPqDFRcYmMk7FJsayI40IcopG1y5RSCmeBWrV6BgzJSQbTG9sEYHz+wufC 0HHUGZ8k6bgsOKLS1jNx13EWuQ4XGLb9beEQHCHCWC8P+Rd4ZbLelb6kKgUTU29cwVNVhi3QX 9hbyVNtGEBixnDdghKymPUXmly72dS9pZZZVfMrAczeDNSV50tPCWX9tOMZCu0/QfP6D0Gh Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:33:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This command is needed to be able to boot systemd in a container. $ sudo systemd-nspawn -D /chroot/armhf/sid/ -b Spawning container sid on /chroot/armhf/sid. Press ^] three times within 1s to kill container. systemd 245.6-2 running in system mode. Detected virtualization systemd-nspawn. Detected architecture arm. Welcome to Debian GNU/Linux bullseye/sid! Set hostname to . Failed to enqueue loopback interface start request: Operation not support= ed Caught , dumped core as pid 3. Exiting PID 1... Container sid failed with error code 255. Signed-off-by: Laurent Vivier Message-Id: <20200709072332.890440-2-laurent@vivier.eu> --- linux-user/fd-trans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 5d49a53552b2..1486c81aaa27 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -1204,6 +1204,7 @@ static abi_long target_to_host_data_route(struct nlms= ghdr *nlh) break; case RTM_NEWLINK: case RTM_DELLINK: + case RTM_SETLINK: if (nlh->nlmsg_len >=3D NLMSG_LENGTH(sizeof(*ifi))) { ifi =3D NLMSG_DATA(nlh); ifi->ifi_type =3D tswap16(ifi->ifi_type); --=20 2.26.2 From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712233; cv=none; d=zohomail.com; s=zohoarc; b=TyKgk3wvtI4gwMATWgDZ9GWJS9pRBZI36ZrruBqSbuBtjyrCY1xSzHHXXUEIn4i3ajwAM2Xtw0xOrkhrkQOTOOgdIGL/1yn/nPpeFFV4tWPlaRKgYupxJEfnDjBaSofeh/Tap29C+oDFcDx4ihA0aTtl9MIPs9sUbgprZ9VSUG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712233; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+yxAly8N8PHQzxAlkz8i9kt/vA0anC9py+m+zAeJ6G0=; b=nbFxTEeKAFJVbo1NjIEkVTxFD0fOp3UoOi6gmBefBW/dgV6L16xpaaG3GPxhJ72F6i4gbbnoMbOQxWuPKfJpyHJOUWZFmaUbgs9v8xOf0FAdqyHGJ1HwFYzWOrQD0/VKR6yg6q7qIQhVRGtgR99JuWTHQrdrn4BX3fK1ckJ+yvg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712233758177.72923141817535; Tue, 14 Jul 2020 00:37:13 -0700 (PDT) Received: from localhost ([::1]:59646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFV2-0008MV-Ie for importer@patchew.org; Tue, 14 Jul 2020 03:37:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFRC-0001fG-JF for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:14 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:43633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFRA-00025A-MA for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:14 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MAxLT-1k1b5O3U3F-00BONa; Tue, 14 Jul 2020 09:33:08 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 6/7] linux-user: fix the errno value in print_syscall_err() Date: Tue, 14 Jul 2020 09:32:58 +0200 Message-Id: <20200714073259.1464675-7-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:oCUu1ehJPhU3cSnwuBUwhoU/Os00IvSHSwc4weBqHvZLuio0IDa l+4ioJa6FCbqrWssA/ojEMMcDog1Rd5FtwucybHQc38ASUdAHNqg+nNwj0wRsdIb7CZPbkW guzn7LqIfmz7+SK3IsbuyGvuM7QSZcLIetSE1V3qyKPT0YDCo10XJPh80YVRhieg3f/so2M HVcrysSNgsV6Dtg6xMveA== X-UI-Out-Filterresults: notjunk:1;V03:K0:7dpG+BiOCmQ=:0gJOjl1qhHCMD+SiUvKFiF BW9BHtNfO8rIlWJ1pHGIjJskFbFTmAe/xCLDEcFSgbOZCQIiHkFMy+T4KpO2tFcGfDECx3zIT OY+9XXwkV4kZQjT+MMTQI1lKKiB1TUdxo1jZeVtgj02P3sIfrMmolY9kKM0BL9wpAIrzIxGEp Ui+Bxbpd2OmjRBznViNsmj+RrRYnHEzLAfQtJPCTSlkobdFA5bphSTDyrU6v/oq0261LQsUsu jgDNWgvaWA60/91mPH+Q7g6RsZQ5CrQnIgxj4wCMjDq7E4VfonOUMUjz6tKQbR9N8xBwJWoLn MYHaGLiNkHJuSLjwXXtBbp2NDQETBIo7yN8+hWF6JaOHEXchPli91PbooK7ppc7Vy49nQlWeC uwVIqDIPB7/iavoXKJ88srjI8fCm1F3KJ8PocLKd/J/7hMK/TBkLPluyGoZ3/hqbi1ebV+0lT XRBH1q5cslJFQqvksgkSOHX2RgH69VPMOcYiLABy68wp5o5thZAgBEubxE5ZJi4/SkHn+rUFf RyXWGQS4IvV6LjnuAWUMZqUyXaMZVV7v2ndkHv0JN9F2qVJFPtSMfvoKbwJoZTBY75rFKfcf5 bUZdEW1FctJIVwD7BfYUUbPgIrABAeR5vEL6xDYCOlcdS3xe2dDtExliLoo6mZD6tKDXoImIY jbs5+r+lLriVaYvsTStKMni/pMCO2o0FvMC2nv0h8QQ+Go6g7zJYHdeIczyPrnD8eN0hH9mES gGNRxUPBSbsm3kSOAjP3/mXyFLAI/y8oSEWdW+AT+BSGR3/4i5nXYaBMlSym/4dOdnM8jwVRa FDtfhTUSDIfTKuhUSyOnYkdTtZ3oPGYwBS6I9Lc462CQaW8ctudZEpxa/hC7JnzJUwcbwnA Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:28:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Richard Henderson , Laurent Vivier , Filip.Bozuta@syrmia.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" errno of the target is returned as a negative value by the syscall, not in the host errno variable. The emulation of the target syscall can return an error while the host doesn't set an errno value. Target errnos and host errnos can also differ in some cases. Fixes: c84be71f6854 ("linux-user: Extend strace support to enable argument = printing after syscall execution") Cc: Filip.Bozuta@syrmia.com Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Filip Bozuta Message-Id: <20200708152435.706070-2-laurent@vivier.eu> --- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 39554d903911..7769f53bd5ed 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -731,7 +731,7 @@ print_syscall_err(abi_long ret) =20 qemu_log(" =3D "); if (ret < 0) { - qemu_log("-1 errno=3D%d", errno); + qemu_log("-1 errno=3D%d", (int)-ret); errstr =3D target_strerror(-ret); if (errstr) { qemu_log(" (%s)", errstr); --=20 2.26.2 From nobody Fri May 17 02:03:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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=1594712142; cv=none; d=zohomail.com; s=zohoarc; b=Jmrk6Ppj+kMLPDm8KbiaasE4xxayTdTrq/wURbd3bJOiQBuSp4Hq9jD2lamRIBJzyQR2hto3c456HhKGt+CY0XLvxXH/6dBk5I7a12igU+SKEI62m06Qjau0robMhvs4ZAWvVLCsmGekD8OViptte1wDi/OUgn80DLIytkH63Rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594712142; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U7BHbwF4tAoc0+EjdlkKVfXTeUVNOlxOTUELKWZwBdU=; b=iNdqC8zFQlIkDGqSaZL9rBOLGZ4OrWWn/WQXSJw7aap0F2YpZgKs4it1xpPnCxdW/8Fay1iRLI3wGVHZIUqg0NwTzJ7m8rypAd3hEByON1uqDKjI7UkIW+uh18kijFXr//Ngb+6tp9TSbA6JCu+Tb61vUSKTUFQ3W2zmEv0ZpNo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.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 1594712142390524.3584956077475; Tue, 14 Jul 2020 00:35:42 -0700 (PDT) Received: from localhost ([::1]:54860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvFTY-0006Kb-GV for importer@patchew.org; Tue, 14 Jul 2020 03:35:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFRA-0001bR-WC for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:13 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:58391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvFR9-00024u-7d for qemu-devel@nongnu.org; Tue, 14 Jul 2020 03:33:12 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MyKYE-1knBOq1m4i-00yf6J; Tue, 14 Jul 2020 09:33:08 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 7/7] linux-user: fix print_syscall_err() when syscall returned value is negative Date: Tue, 14 Jul 2020 09:32:59 +0200 Message-Id: <20200714073259.1464675-8-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200714073259.1464675-1-laurent@vivier.eu> References: <20200714073259.1464675-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:i7X6BYcI8VIr4p155mf8zFTNYZOhu3NW3k/vGE+dXaC7rxI4vpp mAjLw4lW74ZcE5WlGKJVcbtvSvQfOqyh8K93ZB9vFA0dChXUgHo0AHYAeqXuzdFYGC6/voT UcOFrShgQ9XZseA+MFgy6LX6gPd+t3ugnqM3GPa9uUU2g10mDPKvNk29wn7QFrsWnXifOLa SGYwErTd8q4WhLZcHInaQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:V4vScfLCSFk=:gFsqR0wAN2YCrssNas5Ok3 /DGSbQhszeIYThncBLBbdm4RMVA3tECFDrufdyzsF2M0sesczx/WIGn4ozwG0bmeIlbcL2q0u M8+xk34A+1BdgJq08GTK/4GnhZZrcnVVFOh0DGQDzA7Hc4LPBRHbxPdNyHt5KunSwxBy8sqEH LXIoENAduY5Cl8itzDBm1PZA1HwMIKKFnEftBMhMIw2XPGdoPbJNyWtCU8wtlw97trSxleF75 254GnRzCiWsJUCpOjdJxpqph+fmaG4U1VQGJfVdYBWK1VJzf0wWyddpNConfXmAZalEw/CgWT dx7xDjdQDdu/y5clmZpHd7RTan5Jg2iljWfwgE342hJcPhdXCJM21LeJf6idB/C5w4eIBZEdl UqweA7WLTeSMci9Odab/t9m8KMm8IhZw8haQakOgxauxaqrzjxkqPlsXwIwlpeQ3w2SWn6UTK PZo0mG20VmPd1fdAU47YvVIXXs+wn06WUbo4PmUsIojPwpBnJTFO+erHaGpR0Z09yZyDNHoQU QgRHoYN2sD30e160C2HJ2y8rdtx1bwkX38HGeud0VZSdX/Vv16DnQebEpDHOEY93ni9DzmtNa s0VtRsF7SbjnCyzjZlOHIFzPCcooVr+dpaTP/bj3u5NraawdEXJG7lqfDf7nD+ymhnR35jvG2 IPN0cZjauKwzBb/hFDsDd3i+7N4RqP3ZQP3gqWNjmSEQPXOCZhq5g7wn18UFnb49pmT/bF+ic 8iEkvxcCSTBPldJ3iXl312mUye1qfyfIdyGjZpuO0SdvASqWxjVH1CM6ixDGrhE/tRm1tWIf1 O5MS4edFfobiIa/3HGLpYOcLm8UKyzpSp32WUr+7zo4vTIffOoKoVYUieRpHGE5DwnHGMvz Received-SPF: pass (zohomail.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; Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/14 03:33:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Laurent Vivier , Filip.Bozuta@syrmia.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" print_syscall_err() relies on the sign of the returned value to know if it is an errno value or not. But in some cases the returned value can have the most signicant bit set without being an errno. This patch restores previous behaviour that was also checking if we can decode the errno to validate it. This patch fixes this kind of problem (qemu-m68k): root@sid:/# QEMU_STRACE=3D ls 3 brk(NULL) =3D -1 errno=3D21473607683 uname(0x407fff8a) =3D 0 to become: root@sid:/# QEMU_STRACE=3D ls 3 brk(NULL) =3D 0x8001e000 3 uname(0xffffdf8a) =3D 0 Fixes: c84be71f6854 ("linux-user: Extend strace support to enable argument = printing after syscall execution") Cc: Filip.Bozuta@syrmia.com Signed-off-by: Laurent Vivier Message-Id: <20200708152435.706070-3-laurent@vivier.eu> --- linux-user/strace.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 7769f53bd5ed..13981341b327 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -724,19 +724,20 @@ print_ipc(const struct syscallname *name, * Variants for the return value output function */ =20 -static void +static bool print_syscall_err(abi_long ret) { - const char *errstr =3D NULL; + const char *errstr; =20 qemu_log(" =3D "); if (ret < 0) { - qemu_log("-1 errno=3D%d", (int)-ret); errstr =3D target_strerror(-ret); if (errstr) { - qemu_log(" (%s)", errstr); + qemu_log("-1 errno=3D%d (%s)", (int)-ret, errstr); + return true; } } + return false; } =20 static void @@ -744,11 +745,10 @@ print_syscall_ret_addr(const struct syscallname *name= , abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { - print_syscall_err(ret); - - if (ret >=3D 0) { - qemu_log("0x" TARGET_ABI_FMT_lx "\n", ret); + if (!print_syscall_err(ret)) { + qemu_log("0x" TARGET_ABI_FMT_lx, ret); } + qemu_log("\n"); } =20 #if 0 /* currently unused */ @@ -765,9 +765,7 @@ print_syscall_ret_newselect(const struct syscallname *n= ame, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { - print_syscall_err(ret); - - if (ret >=3D 0) { + if (!print_syscall_err(ret)) { qemu_log(" =3D 0x" TARGET_ABI_FMT_lx " (", ret); print_fdset(arg0, arg1); qemu_log(","); @@ -796,9 +794,7 @@ print_syscall_ret_adjtimex(const struct syscallname *na= me, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { - print_syscall_err(ret); - - if (ret >=3D 0) { + if (!print_syscall_err(ret)) { qemu_log(TARGET_ABI_FMT_ld, ret); switch (ret) { case TARGET_TIME_OK: @@ -833,9 +829,7 @@ print_syscall_ret_listxattr(const struct syscallname *n= ame, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { - print_syscall_err(ret); - - if (ret >=3D 0) { + if (!print_syscall_err(ret)) { qemu_log(TARGET_ABI_FMT_ld, ret); qemu_log(" (list =3D "); if (arg1 !=3D 0) { @@ -866,9 +860,7 @@ print_syscall_ret_ioctl(const struct syscallname *name,= abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { - print_syscall_err(ret); - - if (ret >=3D 0) { + if (!print_syscall_err(ret)) { qemu_log(TARGET_ABI_FMT_ld, ret); =20 const IOCTLEntry *ie; @@ -3197,9 +3189,7 @@ print_syscall_ret(int num, abi_long ret, arg1, arg2, arg3, arg4, arg5, arg6); } else { - print_syscall_err(ret); - - if (ret >=3D 0) { + if (!print_syscall_err(ret)) { qemu_log(TARGET_ABI_FMT_ld, ret); } qemu_log("\n"); --=20 2.26.2