From patchwork Tue Jan 19 17:54:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12030343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCF9FC433E0 for ; Tue, 19 Jan 2021 18:49:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08A3D2310C for ; Tue, 19 Jan 2021 18:49:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08A3D2310C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1vcv-0006nm-RO for qemu-devel@archiver.kernel.org; Tue, 19 Jan 2021 13:21:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vDB-00027o-E4 for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:37 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:38943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vD9-00041F-Er for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:37 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5FtF-1m0Nb00Ghx-0117LD; Tue, 19 Jan 2021 18:54:31 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/5] linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls Date: Tue, 19 Jan 2021 18:54:23 +0100 Message-Id: <20210119175427.2050737-2-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119175427.2050737-1-laurent@vivier.eu> References: <20210119175427.2050737-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:nQ/XkIVQ63nTCKEJsoyjKiUs+ljebC9TvOoOECIp9QgejxINY42 R47V20pXbuRgE2QMrL/GeEancwtyFc1zKGeOZIF2X6xKwfkKnxGo4HSHESkGvgO7M2eWdRS iuxwQd646f2IQ6vIRR9eu9smIKSND0w4r4eZv+uzwfFOAGDlwa9SuksBbmd4rBTbZNTTsPN tFKEyAKzzqAJqenLDCt9g== X-UI-Out-Filterresults: notjunk:1;V03:K0:toZv0CJ7gL4=:DCkOoqPJiC5vBh5tKFXkaC +lqF/8ZnAc6eb5Ne19yBiSV4HCh9bZpgeHBsfu05SpYzJ8I5t073j4efSP6XSCEc5gtBMBF0Z QSDUyixPRq9mNp/hem3budWDl2MihI3ljjiz2BoZxwW8JFgNXKZNBsqigh0SEE+oIjSxyRAeh umLPIsDWf0Qi2sNBjeCrM6sPgFBf/1hp/bPQ3yxlALSC7yli0Q4TkccXC0iCWRKuj5pT1efmY LeaH4HHtk4mSk//ER8smLDYUkRqDp+V8koHWG/ZUYm+coRiycT9H6kQiSfUv17TQpP7Al+Rp8 bWbL+cm4iyvyiYwgBSmpRBkvsuOZ5K1BxWDQ3ozI56v8HwDxVJl1Q2fa7XE8g0IzA6t850Vii ZVFHWOL54MgSN5QsGbxLis18GLwgjkRb4qKNPefMuLfnPeKY8Boa2PRZA355C Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Shu-Chun Weng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Shu-Chun Weng Also reorder blocks so that they are all in the same order everywhere. Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20201218193213.3566856-2-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 39 ++++++++++++++++++++++++++++++++------- linux-user/syscall.c | 10 ++++++++++ linux-user/syscall_defs.h | 14 ++++++++------ 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index e00275fcb51b..227812c07e63 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -2066,11 +2066,34 @@ print_fcntl(void *cpu_env, const struct syscallname *name, break; case TARGET_F_SETLEASE: qemu_log("F_SETLEASE,"); - print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); break; case TARGET_F_GETLEASE: qemu_log("F_GETLEASE"); break; +#ifdef F_DUPFD_CLOEXEC + case TARGET_F_DUPFD_CLOEXEC: + qemu_log("F_DUPFD_CLOEXEC,"); + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); + break; +#endif + case TARGET_F_NOTIFY: + qemu_log("F_NOTIFY,"); + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); + break; +#ifdef F_GETOWN_EX + case TARGET_F_GETOWN_EX: + qemu_log("F_GETOWN_EX,"); + print_pointer(arg2, 1); + break; +#endif +#ifdef F_SETOWN_EX + case TARGET_F_SETOWN_EX: + qemu_log("F_SETOWN_EX,"); + print_pointer(arg2, 1); + break; +#endif +#ifdef F_SETPIPE_SZ case TARGET_F_SETPIPE_SZ: qemu_log("F_SETPIPE_SZ,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); @@ -2078,14 +2101,16 @@ print_fcntl(void *cpu_env, const struct syscallname *name, case TARGET_F_GETPIPE_SZ: qemu_log("F_GETPIPE_SZ"); break; - case TARGET_F_DUPFD_CLOEXEC: - qemu_log("F_DUPFD_CLOEXEC,"); - print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); +#endif +#ifdef F_ADD_SEALS + case TARGET_F_ADD_SEALS: + qemu_log("F_ADD_SEALS,"); + print_raw_param("0x"TARGET_ABI_FMT_lx, arg2, 1); break; - case TARGET_F_NOTIFY: - qemu_log("F_NOTIFY,"); - print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); + case TARGET_F_GET_SEALS: + qemu_log("F_GET_SEALS"); break; +#endif default: print_raw_param(TARGET_ABI_FMT_ld, arg1, 0); print_pointer(arg2, 1); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d182890ff04a..98aaca01872f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6639,6 +6639,14 @@ static int target_to_host_fcntl_cmd(int cmd) case TARGET_F_GETPIPE_SZ: ret = F_GETPIPE_SZ; break; +#endif +#ifdef F_ADD_SEALS + case TARGET_F_ADD_SEALS: + ret = F_ADD_SEALS; + break; + case TARGET_F_GET_SEALS: + ret = F_GET_SEALS; + break; #endif default: ret = -TARGET_EINVAL; @@ -6931,6 +6939,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) case TARGET_F_GETLEASE: case TARGET_F_SETPIPE_SZ: case TARGET_F_GETPIPE_SZ: + case TARGET_F_ADD_SEALS: + case TARGET_F_GET_SEALS: ret = get_errno(safe_fcntl(fd, host_cmd, arg)); break; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a00bfc2647c7..f98c1c1c8de4 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2408,12 +2408,14 @@ struct target_statfs64 { #endif #define TARGET_F_LINUX_SPECIFIC_BASE 1024 -#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0) -#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1) -#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6) -#define TARGET_F_SETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 7) -#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8) -#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE+2) +#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0) +#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1) +#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6) +#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE + 2) +#define TARGET_F_SETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 7) +#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8) +#define TARGET_F_ADD_SEALS (TARGET_F_LINUX_SPECIFIC_BASE + 9) +#define TARGET_F_GET_SEALS (TARGET_F_LINUX_SPECIFIC_BASE + 10) #include "target_fcntl.h" From patchwork Tue Jan 19 17:54:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12030325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37322C433E0 for ; Tue, 19 Jan 2021 18:42:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BEF3223339 for ; Tue, 19 Jan 2021 18:42:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEF3223339 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1vQ9-0002yI-TM for qemu-devel@archiver.kernel.org; Tue, 19 Jan 2021 13:08:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vDD-000293-Qv for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:39 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:59769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vD9-00041H-Et for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:39 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mf0Ru-1lhHZN1xVq-00gbvc; Tue, 19 Jan 2021 18:54:31 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/5] linux-user: add missing UDP get/setsockopt option Date: Tue, 19 Jan 2021 18:54:24 +0100 Message-Id: <20210119175427.2050737-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119175427.2050737-1-laurent@vivier.eu> References: <20210119175427.2050737-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:KMdifg9/aD+juG9NMB48iSLOLflGSvxgTFdmQ12t1CI5znhiv0i wRfpySnZvRp/0w43ee95HzbXTjbXCIa4Ovw0qkF6FbdavbxwIDxEfjGJuG4oaoRsf5C5Aq1 ciUzfq5kJuf415PWhiAJ8o23nq0usZBGRXxpwmPjan7Bgn67TRN5GsKA6zr2PMokk/xtYY/ NiUTvEMbTWwlx133Xp0LQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:zt5CsZbw7Rs=:XB4zAGva2PaH//F9VELHSs 0w8TwJeAMuCRWpcm9PKscgotMSg5ATwinrEDZkKkDhpzwBtBznxHpIzHBYj3z4nx8XFEN7Syc gyod3UkLkBwhUoyiUtZnkCv+K/FZFMuVKDWIatEoPDVtsUs6eG+KWU6zmQstjU7bpsgBNhhSo Hv3lJg5lNP1fIxIqo4h/QPRubHnGxbhic5kIooeiN/h8sdfuPY6+tgB0eyRqshhvg0t3IoylY RgZiEXRkW4LHibmYE+vom9Xk/4NJebJjNjT4vwGtr2LR9i9A+MJ+CV4p6+SVlapAPQRqbGoX6 /bNSxxHAByjjzBSyDYbvyjn0m47QKHdZwxhy58dbPKAQp/jcK11Dkk+RydvLSzFhLnVH2rFps p+ZZUsqPbxRxJQP9reZuV/UwJXwtlk0MkDx/SQ5x6r/KrmTxWqxkBmdNo0CWllJSZ+/+TXxp/ vo6x7qq+bw== Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Shu-Chun Weng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Shu-Chun Weng SOL_UDP manipulate options at UDP level. All six options currently defined in linux source include/uapi/linux/udp.h take integer values. Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20201218193213.3566856-3-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 6 ++++++ linux-user/syscall.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 227812c07e63..64172de99d98 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -2644,6 +2645,11 @@ static void do_print_sockopt(const char *name, abi_long arg1) print_raw_param(TARGET_ABI_FMT_ld, optname, 0); print_pointer(optval, 0); break; + case SOL_UDP: + qemu_log("SOL_UDP,"); + print_raw_param(TARGET_ABI_FMT_ld, optname, 0); + print_pointer(optval, 0); + break; case SOL_IP: qemu_log("SOL_IP,"); print_raw_param(TARGET_ABI_FMT_ld, optname, 0); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 98aaca01872f..969db2008104 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -53,6 +53,7 @@ //#include #include #include +#include #include #include #include @@ -2184,7 +2185,8 @@ static abi_long do_setsockopt(int sockfd, int level, int optname, switch(level) { case SOL_TCP: - /* TCP options all take an 'int' value. */ + case SOL_UDP: + /* TCP and UDP options all take an 'int' value. */ if (optlen < sizeof(uint32_t)) return -TARGET_EINVAL; @@ -2832,7 +2834,8 @@ get_timeout: } break; case SOL_TCP: - /* TCP options all take an 'int' value. */ + case SOL_UDP: + /* TCP and UDP options all take an 'int' value. */ int_case: if (get_user_u32(len, optlen)) return -TARGET_EFAULT; From patchwork Tue Jan 19 17:54:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12030307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E361C433E0 for ; Tue, 19 Jan 2021 18:31:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CBDD23103 for ; Tue, 19 Jan 2021 18:31:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CBDD23103 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1vn6-0008QT-Gz for qemu-devel@archiver.kernel.org; Tue, 19 Jan 2021 13:31:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vDD-00028N-Ew for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:39 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:37675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vD9-00041L-Eu for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:39 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N3bjH-1m0w5s3btL-010Zdp; Tue, 19 Jan 2021 18:54:32 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 3/5] linux-user: add missing IPv6 get/setsockopt option Date: Tue, 19 Jan 2021 18:54:25 +0100 Message-Id: <20210119175427.2050737-4-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119175427.2050737-1-laurent@vivier.eu> References: <20210119175427.2050737-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:cE+nRZZ8neKadDPXHjqjUGXRTwcOaCoeTWrq4tXu8Xd4+9bVTfs QXE1WdqAE6fW3KZgM0Z8Nazasi9YLjdCkTPw0kjPqKBDNH3C8EVyrK8h7hNFYkbL8uo//yG 667PF7UROIY8jMtqN2mMbQLbZYVcvl4CgbWwpb4R/dJZ76jD/BM+CTtCaC5wVqVXjOCUGwO IFmDoW1f4/FegoP82jVdg== X-UI-Out-Filterresults: notjunk:1;V03:K0:vhXVF3FY7Bc=:DZqfNNUes80axSBDAWfyZQ QhMOjFHqUu6wECGbdZUymsJZohNoZgAB7KQuZgl3T75/7N0Gl4671HUUzWDxfDIsruTjiXves 6gA4uWI8r2S4TM5hEgYswKhf/UEOccKDSbJ+0HTXxp8sxg6Y9K1dw+4hh70aDWHpcGecU9o23 7KFXFMWqiumjv/ULW7seHrezaYs+dquxYJzwxL5BxjtfCnAmnr7/WgHAewnKNcWPF4yRIpzJc 0vOrajpp3yeHI6p8VPjpSf0/Ej3CGxopSdEIcue2hKntN5N/ZM+AH97laWEnxVcretVN3X6PU hv/tutgr9RNPs3bRr3FRjLZ9lbOyzYrJdFI48oKJPS4SsusvNk/UOVkB6NKk5EUh6RrEhWWy7 DzMUL6kvmejZLfDTOa0YNU29oOwVrQ3MjL/t1o5dN+km94WVRF2d7VNT3O8sQZJ8kFKOwKpqR ONvS1S1wLg== Received-SPF: none client-ip=212.227.126.130; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Shu-Chun Weng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Shu-Chun Weng IPV6_ADDR_PREFERENCES (RFC5014: Source address selection) was not supported. Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20201218193213.3566856-4-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 969db2008104..70c61d15ebf8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -51,6 +51,7 @@ #include #include //#include +#include #include #include #include @@ -2272,6 +2273,7 @@ static abi_long do_setsockopt(int sockfd, int level, int optname, case IPV6_RECVDSTOPTS: case IPV6_2292DSTOPTS: case IPV6_TCLASS: + case IPV6_ADDR_PREFERENCES: #ifdef IPV6_RECVPATHMTU case IPV6_RECVPATHMTU: #endif @@ -2926,6 +2928,7 @@ get_timeout: case IPV6_RECVDSTOPTS: case IPV6_2292DSTOPTS: case IPV6_TCLASS: + case IPV6_ADDR_PREFERENCES: #ifdef IPV6_RECVPATHMTU case IPV6_RECVPATHMTU: #endif From patchwork Tue Jan 19 17:54:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12030319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C0BBC433E6 for ; Tue, 19 Jan 2021 18:40:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8060420706 for ; Tue, 19 Jan 2021 18:40:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8060420706 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1vkk-0006Rm-M1 for qemu-devel@archiver.kernel.org; Tue, 19 Jan 2021 13:29:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vDE-00029a-2F for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:40 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:39415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vD9-00041S-Eu for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:39 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MOzCW-1lP3h614Q8-00PLlG; Tue, 19 Jan 2021 18:54:32 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 4/5] linux-user: Add IPv6 options to do_print_sockopt() Date: Tue, 19 Jan 2021 18:54:26 +0100 Message-Id: <20210119175427.2050737-5-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119175427.2050737-1-laurent@vivier.eu> References: <20210119175427.2050737-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:WaskIXOXU+oClRSROHwIUuAN1iBErHakOLCtvU8gLRuYejxPpC6 0TKEMY8V7w8MsvxTdL0X3Lovzr/mlrWaSfMyy1hBUnIQkMpXJf0r8D8NBAmGtRcuxG50fnP nUSidKrqFgRO6+F8rbn20AYsiT6MGnPRg2nFnSZvyFOrJ7dLR1yjVKTdWuz8UDfeMnf0npX bCEAW/RDq5gcV9VztsvWg== X-UI-Out-Filterresults: notjunk:1;V03:K0:smVlYxbLOQQ=:UT5oQA5UbvcAzC5AIv/kwx /jBHQ0OjM8zbCo6G4ptmdoCMSguuhdypx4bTKeZtw28Xgz7rjiDoePbZRytfa8PhHRwQNAeyK s/gHCopAX8l7WTwqKpVi0oeW4bWt6hm8u9unmfX95mt6Qu92XwIZerMe6E5Y/HVtiARxamC72 56c+pOe61jG5f2+qCM9Xs/rO8MFXbtyToXng67GJgViW0jViRaSS8zEQr8MuBxHRuX1C9Omw0 Rj2uWti+n0ntKxhTqITZ8JNqBNqPpylGr+GyGGBhjmnYs57ISG/gTbZi/xIk7llwoLTI/35gc u4AKsjHyCqF6s0pAFBRI4B0/m2hL7tJrepzi37Vd+JdQXGL6I98zuPevW/LyEuwLyfuhqufa2 OnavcZsXPygmFHgRoAqAlG8g6Fr401Wks82LPU1NrReLTydy/GPj3AgU/Hewh Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 , Shu-Chun Weng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Shu-Chun Weng Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20201218193213.3566856-5-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 108 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c index 64172de99d98..bc3bb6b2f949 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -2761,6 +2762,113 @@ print_optint: break; } break; + case SOL_IPV6: + qemu_log("SOL_IPV6,"); + switch (optname) { + case IPV6_MTU_DISCOVER: + qemu_log("IPV6_MTU_DISCOVER,"); + goto print_optint; + case IPV6_MTU: + qemu_log("IPV6_MTU,"); + goto print_optint; + case IPV6_V6ONLY: + qemu_log("IPV6_V6ONLY,"); + goto print_optint; + case IPV6_RECVPKTINFO: + qemu_log("IPV6_RECVPKTINFO,"); + goto print_optint; + case IPV6_UNICAST_HOPS: + qemu_log("IPV6_UNICAST_HOPS,"); + goto print_optint; + case IPV6_MULTICAST_HOPS: + qemu_log("IPV6_MULTICAST_HOPS,"); + goto print_optint; + case IPV6_MULTICAST_LOOP: + qemu_log("IPV6_MULTICAST_LOOP,"); + goto print_optint; + case IPV6_RECVERR: + qemu_log("IPV6_RECVERR,"); + goto print_optint; + case IPV6_RECVHOPLIMIT: + qemu_log("IPV6_RECVHOPLIMIT,"); + goto print_optint; + case IPV6_2292HOPLIMIT: + qemu_log("IPV6_2292HOPLIMIT,"); + goto print_optint; + case IPV6_CHECKSUM: + qemu_log("IPV6_CHECKSUM,"); + goto print_optint; + case IPV6_ADDRFORM: + qemu_log("IPV6_ADDRFORM,"); + goto print_optint; + case IPV6_2292PKTINFO: + qemu_log("IPV6_2292PKTINFO,"); + goto print_optint; + case IPV6_RECVTCLASS: + qemu_log("IPV6_RECVTCLASS,"); + goto print_optint; + case IPV6_RECVRTHDR: + qemu_log("IPV6_RECVRTHDR,"); + goto print_optint; + case IPV6_2292RTHDR: + qemu_log("IPV6_2292RTHDR,"); + goto print_optint; + case IPV6_RECVHOPOPTS: + qemu_log("IPV6_RECVHOPOPTS,"); + goto print_optint; + case IPV6_2292HOPOPTS: + qemu_log("IPV6_2292HOPOPTS,"); + goto print_optint; + case IPV6_RECVDSTOPTS: + qemu_log("IPV6_RECVDSTOPTS,"); + goto print_optint; + case IPV6_2292DSTOPTS: + qemu_log("IPV6_2292DSTOPTS,"); + goto print_optint; + case IPV6_TCLASS: + qemu_log("IPV6_TCLASS,"); + goto print_optint; + case IPV6_ADDR_PREFERENCES: + qemu_log("IPV6_ADDR_PREFERENCES,"); + goto print_optint; +#ifdef IPV6_RECVPATHMTU + case IPV6_RECVPATHMTU: + qemu_log("IPV6_RECVPATHMTU,"); + goto print_optint; +#endif +#ifdef IPV6_TRANSPARENT + case IPV6_TRANSPARENT: + qemu_log("IPV6_TRANSPARENT,"); + goto print_optint; +#endif +#ifdef IPV6_FREEBIND + case IPV6_FREEBIND: + qemu_log("IPV6_FREEBIND,"); + goto print_optint; +#endif +#ifdef IPV6_RECVORIGDSTADDR + case IPV6_RECVORIGDSTADDR: + qemu_log("IPV6_RECVORIGDSTADDR,"); + goto print_optint; +#endif + case IPV6_PKTINFO: + qemu_log("IPV6_PKTINFO,"); + print_pointer(optval, 0); + break; + case IPV6_ADD_MEMBERSHIP: + qemu_log("IPV6_ADD_MEMBERSHIP,"); + print_pointer(optval, 0); + break; + case IPV6_DROP_MEMBERSHIP: + qemu_log("IPV6_DROP_MEMBERSHIP,"); + print_pointer(optval, 0); + break; + default: + print_raw_param(TARGET_ABI_FMT_ld, optname, 0); + print_pointer(optval, 0); + break; + } + break; default: print_raw_param(TARGET_ABI_FMT_ld, level, 0); print_raw_param(TARGET_ABI_FMT_ld, optname, 0); From patchwork Tue Jan 19 17:54:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12030311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D1BEC433DB for ; Tue, 19 Jan 2021 18:34:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE22822D2A for ; Tue, 19 Jan 2021 18:34:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE22822D2A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1vpZ-0001i1-2g for qemu-devel@archiver.kernel.org; Tue, 19 Jan 2021 13:34:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vDE-00029i-48 for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:40 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:55179) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vD9-00041d-Ro for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:39 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M5fdC-1l7wod1WRO-007HB2; Tue, 19 Jan 2021 18:54:33 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 5/5] linux-user: Remove obsolete F_SHLCK and F_EXLCK translation Date: Tue, 19 Jan 2021 18:54:27 +0100 Message-Id: <20210119175427.2050737-6-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119175427.2050737-1-laurent@vivier.eu> References: <20210119175427.2050737-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:fumJ+ZWoY5AtkIg385dIrUQEzDcuIlFq9fy6UAfNCw29lpcL5O7 p9w0lwg0EFiHa7UY0HkSfcPhnY6Q5bwB2q9MGQ26ggTTJTNyIsEs/nDQlEjxGPNkC5oo59R C/AMRdodhNgUy6qcu7QFjAX3Qn8TrrF6QdYVOo15yAxohY2oFI2Epi+ohm8bDXDvMwKM2RG koJP8X3yPMc3qeWcV/qOQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:xQ5K6p3YTgU=:0htVeI1VEVhgy4zgVIq/cz pdbLw0lc5LtwTKSE4EDgODWavvZ3e+6Uf6sZ+MhgoKRjg6+cgVnZ5qJ78etcGsxWVhuRX6lg1 ZslQp4xzNriuiQmTbH5wTosrvpkHl+EPD5npwyGDr1ghssOjWv7c2xyCmwlnjP5LaERd1Diqq qVqqMV3gSTsXgT4lA8FRoUE7ccS80FpQZSlmSMqRCfxbJQyCV7ne5b9qbQ80Bk59dzydPq2mE O4FzAbPd+OKfQ3sfLD/n6x7geq1FR2Ypxoeguauyj3KAmHCny/JOam5RZpnC3GuGwYFZAZejb uZnFfKNBbXh0PymnkBJBp6nNiHPxTwafca7RMz1+mtARwQhdoAD3ROOr0i2XIudeSsVHlgVIb pNdhYpSgtJ956TFVGV1nO4uZMn6HT7HNrJ7JbIIsLyFsIYTripBMly1i/heShEuF4K2QlXGlc 9soR3wc7Lg== Received-SPF: none client-ip=212.227.126.134; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Michael Forney Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Michael Forney These lock types are unsupported by Linux since v2.2[0][1] and always return EINVAL (except on SPARC up until v2.6, which just warned). musl libc does not define these constants, so just remove them from the translation cases. [0] https://github.com/mpe/linux-fullhistory/blob/v2.2.0/fs/locks.c#L322-L324 [1] https://github.com/mpe/linux-fullhistory/blob/v2.2.0/fs/locks.c#L429-L445 Signed-off-by: Michael Forney Reviewed-by: Laurent Vivier Message-Id: <20210114223602.9004-1-mforney@mforney.org> Signed-off-by: Laurent Vivier --- linux-user/alpha/target_fcntl.h | 2 -- linux-user/generic/fcntl.h | 5 ----- linux-user/syscall.c | 2 -- 3 files changed, 9 deletions(-) diff --git a/linux-user/alpha/target_fcntl.h b/linux-user/alpha/target_fcntl.h index 2617e73472b7..e16ed1d4157f 100644 --- a/linux-user/alpha/target_fcntl.h +++ b/linux-user/alpha/target_fcntl.h @@ -33,8 +33,6 @@ #define TARGET_F_RDLCK 1 #define TARGET_F_WRLCK 2 #define TARGET_F_UNLCK 8 -#define TARGET_F_EXLCK 16 -#define TARGET_F_SHLCK 32 #include "../generic/fcntl.h" #endif diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h index c85c5b9fed65..4568d1f42bdd 100644 --- a/linux-user/generic/fcntl.h +++ b/linux-user/generic/fcntl.h @@ -119,11 +119,6 @@ struct target_f_owner_ex { #define TARGET_F_UNLCK 2 #endif -#ifndef TARGET_F_EXLCK -#define TARGET_F_EXLCK 4 -#define TARGET_F_SHLCK 8 -#endif - #ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK #ifndef TARGET_ARCH_FLOCK_PAD #define TARGET_ARCH_FLOCK_PAD diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 70c61d15ebf8..1f91aa0ed5e3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6678,8 +6678,6 @@ static int target_to_host_fcntl_cmd(int cmd) 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)