From patchwork Wed Jan 20 19:53:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12033571 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, URIBL_BLOCKED,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 5CEEBC433DB for ; Wed, 20 Jan 2021 19:55:42 +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 B2FE82343E for ; Wed, 20 Jan 2021 19:55:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2FE82343E 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]:55350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2JZs-0003h8-Ic for qemu-devel@archiver.kernel.org; Wed, 20 Jan 2021 14:55:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXl-0001z6-1r for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:29 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:33535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXi-0002zr-QN for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:28 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N49Ul-1m29WV1Dub-0108ou; Wed, 20 Jan 2021 20:53:22 +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: Wed, 20 Jan 2021 20:53:13 +0100 Message-Id: <20210120195317.84222-2-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210120195317.84222-1-laurent@vivier.eu> References: <20210120195317.84222-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:N3RF0IJ+riHmTTL3ZPKNyyt8pj9sc+ZJQFba2Fgl/AsOKSNcnsD mXI35ThLZChqnVZRev55hY4i5t17K2/b6V5y90OMGYSC3ctPhnB87/RL0RzU6P5vo9RUG3H vZZyvozE7y0C/AoWfb+iFXFubWGhZfBGGkvLxy1Y50zWLD28HNqPnZXVSN+XfLGY41bH0JO Oz9G1MEsZhiJos4fR/8WQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:x/WkA89aGbM=:GJxrvkIjVwwcIo/aLc+zzc oES07V23nyrDFiP7rEhaQfob+kYg7OHU/b5AFqyvDOAQBBXaFQHXjidDTtMjiMZuWrHVS7o+4 wzhnQOMe2bAUV7HseREXTAy4tFd8pkcBPeHkjUmh2l9Ac1l67Vv+pSyJySZeJ3Z0END5SpPPd k8l7q+AihN5LV0MNZzC++DV9yEJC+RENcF0AYpb+EHuM/LAaR1ulyrhom9szY1LzyK4nuvtpv asAOeuGjkfhXSAQVa/3Agko49b3vYiORd3wXi0fyjkkcSoTSQ/jEXH4wFvVJsOpkS0iyLzDJ/ ruJidwSnuZvniRpWVvoWNTCsYpqeT8wJTUZOJpMV03Sivoril/CnuUXgIUyXSoNsRcYr5omr0 9+0KkwjUT81l6UWhCENiKodBArCyhDLfZcBSWBtaC6jmZZXAJ52JxNU8AzjNG69EJ0lQY3Y2V eJxllHfPLg== Received-SPF: none client-ip=217.72.192.75; 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 Wed Jan 20 19:53:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12033597 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,URIBL_BLOCKED,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 28447C433E0 for ; Wed, 20 Jan 2021 19:57: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 A237C23440 for ; Wed, 20 Jan 2021 19:57:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A237C23440 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]:34536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2Jbs-0006tY-LH for qemu-devel@archiver.kernel.org; Wed, 20 Jan 2021 14:57:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXl-0001zV-Ve for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:30 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:40865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXi-000303-4x for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:29 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M9Ezx-1l8evc178J-006Kos; Wed, 20 Jan 2021 20:53:23 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/5] linux-user: add missing UDP get/setsockopt option Date: Wed, 20 Jan 2021 20:53:14 +0100 Message-Id: <20210120195317.84222-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210120195317.84222-1-laurent@vivier.eu> References: <20210120195317.84222-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Ds0ty491rqaxPe7S1hdn37l/g9D89NRGntnS/utNubqsvs2JImt 084IRJo8NVBY3rnSqGfFpDPlUvLvgDQMTAnbjS5p36qo5lVn0jmc/zVqpZX31K+6UZubtCo ydtBQnMJNurz0PPuE8kM78NSSReIn7QkQPpp/sZU50Sz0I0ILKq0StJDgyLe6PaZnj2SRcg +Znn0M7t/rpSh6Up00IqQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:dGWcFPmxJ+w=:hpVXDvosoPBWYX5RUgxVbo Z3NIfQR6x7Ap6PbsrevrSWbPCDja92BwT9a/1Wt8cLtf5x4wuJ7upySUvWlNBcKUn80ZpRcX0 qWEOxoe70kEeJNaNRJDRUE7FHdLKO1k/6BCZumGp2Dwgddi6s2kUokn+J++mYttSTBxrS30Kq JWg8UbLXOAQ+p15SDU1P3khQd27TE9ns0bKAFd3JR49GBRvuMbgalfTzsaDsDJf6d+HmGzngU y2R5Qv22aag+MXCpQUI0iFQYQgwYXEOJpzJ489an0BTI4IqZzeZEzZWTHXvplue3OtPpr7EA0 IBkuKJe42uoM4luFaUrfg4psKqUurzWhTGaSQJ0pZdsIGXq43SAMJ0Qt2S/6bADggGD8JjjhA kK8hlT4FAOaFLQkLBvV+yLXL1yHx3MjIlCil3OejoiduJ8q2JNdOjkKMRFHleHxms4SORPieK VShbkSulgw== Received-SPF: none client-ip=212.227.17.24; 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 Wed Jan 20 19:53:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12033599 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,URIBL_BLOCKED,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 77E0DC433DB for ; Wed, 20 Jan 2021 19:57:51 +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 EB9A723440 for ; Wed, 20 Jan 2021 19:57:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB9A723440 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]:34666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2Jby-0006wo-0h for qemu-devel@archiver.kernel.org; Wed, 20 Jan 2021 14:57:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXw-000231-7B for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:41 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:57383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXr-00032U-GN for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:40 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MLhsE-1lJyx20j2G-00HhKf; Wed, 20 Jan 2021 20:53:24 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 3/5] linux-user: add missing IPv6 get/setsockopt option Date: Wed, 20 Jan 2021 20:53:15 +0100 Message-Id: <20210120195317.84222-4-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210120195317.84222-1-laurent@vivier.eu> References: <20210120195317.84222-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:0Kp7dotUjG9j39lJazbcAYX7CrI/sgFCna4Ku8BS/Hfp09NDD4H JiD8WvAU9Kt6tHMMjTEm+kWE/+aIco/Sv2zRVsPoubpwbVoYswgDkpHTWioyAiE3+wGGlw9 yFpFD54Rqcs8sz6gqX08oBuJIufsZcij5iChjszQ93yWPBjnJRrxTfSg7Qkl4XnF8m0Coso uXgKnkN6DJM8ochwojX+A== X-UI-Out-Filterresults: notjunk:1;V03:K0:fvaAj96Ssxs=:ddZcLxOHF2t17h1Hidzmlu sZVodVjWtwr1pCnpcF1gw7x0v3aOGEpjzdD+kUHIsNmQP9z0qdw8jMMZdGG1UtnqLEEVpa7Yz KL0utkhScWDj0GRaiVAM8TqP2mB0q2gWfaD9i/hukvV/sjcFtYGpz4Y7llHTHU5LbHSirvmMT i93nuD89go5xBsENf/6pj5jg3vEhwqOAS797Xv/kmIONNxxGuFFJY4tYuw90+aq904a4wTTMn 0lsRaIALjTjEry4R19TNMKmxiaOJA6fQ8U5xnRf0tGJyNCJYkzNfJJ3M8tm4RwkH0ZFyf0TtW tFFt/rX2rNxFKn/ZovvmMtGvrcFRqqlWHG4AMfP/afkqSHb0RsuFAmlGn2Mm3V2/YRk/XMy6v aWNnpTy9B1ANd5VReu1Wbvh9i1jlt6vdJN+GW59xLWZD3iRQBn8bVRbOTunWOR1J/dtHBhnZE ubZft3/TfQ== Received-SPF: none client-ip=212.227.17.10; 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , 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> [PMD: Add missing include for IPV6_ADDR_PREFERENCES] Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 969db2008104..5d482dcbefd6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -51,6 +51,7 @@ #include #include //#include +#include #include #include #include @@ -58,6 +59,7 @@ #include #include #include +#include #include #include #ifdef CONFIG_TIMERFD @@ -2272,6 +2274,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 +2929,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 Wed Jan 20 19:53:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12033575 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,URIBL_BLOCKED,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 F1091C433E9 for ; Wed, 20 Jan 2021 19:55:42 +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 88D142343E for ; Wed, 20 Jan 2021 19:55:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88D142343E 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]:55468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2JZt-0003kE-DK for qemu-devel@archiver.kernel.org; Wed, 20 Jan 2021 14:55:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXm-0001zg-96 for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:30 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:52557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXi-00030q-Tp for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:30 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N9d91-1m7fpR2PRN-015cTA; Wed, 20 Jan 2021 20:53:24 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 4/5] linux-user: Add IPv6 options to do_print_sockopt() Date: Wed, 20 Jan 2021 20:53:16 +0100 Message-Id: <20210120195317.84222-5-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210120195317.84222-1-laurent@vivier.eu> References: <20210120195317.84222-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:X4PMQ8sJjwlXRPuO9hnBAdQzxVcYXqtE4mlGZcNukSl2eKj88cR BQTvA7gJmyGUscvNzQXv73jAZ0D4j6xRQ6sLNmIMENKUASNU3+rdJF2g6jDUn2Tz0jjCTX0 r0/W8Yt8HAEg5/7y1LRrEZ8lZFzsGsH+XQWqlhtZFotwlGJJqGqfvKe+dqp8hCIdEz0rg4z 1MXYjwDtjYDHVyvOb44jA== X-UI-Out-Filterresults: notjunk:1;V03:K0:EiiSjPoQpRM=:ic5iIN3/+1ARZGMJ55Q+1l sM35l8q4Y/JiwbvwtVaNoHMHZYPIz0ELUtK24HrARQ6W0W3t5TOP0DFgLHJ7h6JRu3eXC/H3C +ZJYRa6dh8wODf6wewN41uyucg+gcTqVN7O6EMQW2Gn4s0MvAkOpUdgUZuyA31Z35YTx5F5D2 hkROSHXTNTFs2upmGUE4fPiscSRsbhSlF2JVxLIM+bRbiGpam6pajzTTz5gl7iPbTJFZAwuon CgS0crUpHwleQodlGEIwtQd8+IPGX3FXxYXtff275Tl83zPlWkWSI8F/OXrgOv1AbDFq6LIIV xLLPcVfvjaQ4Q723+8eLcaUzA1cb87Ctq+GAq6tQcUoZgCq2zEHePNVC9RWjRFpx3ag6YYljL 4u/hQd5PUrXn/G6ihwdiluVurOyu4LEz/sEFiYO4HQEXHri25b2utlUDzjU2qvd7sTJfnGF98 CzEUM3K+Fg== Received-SPF: none client-ip=212.227.17.10; 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 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 Wed Jan 20 19:53:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12033573 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,URIBL_BLOCKED, 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 E385DC433E6 for ; Wed, 20 Jan 2021 19:55:42 +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 57F9323441 for ; Wed, 20 Jan 2021 19:55:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57F9323441 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]:55506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2JZt-0003lM-5B for qemu-devel@archiver.kernel.org; Wed, 20 Jan 2021 14:55:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXq-00020p-3j for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:35 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:51615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXj-00030x-V9 for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:32 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1My3Mv-1lxBBS1OAR-00zWsE; Wed, 20 Jan 2021 20:53:25 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 5/5] linux-user: Remove obsolete F_SHLCK and F_EXLCK translation Date: Wed, 20 Jan 2021 20:53:17 +0100 Message-Id: <20210120195317.84222-6-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210120195317.84222-1-laurent@vivier.eu> References: <20210120195317.84222-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:QAZ4FLYEoPryPKduNQNDvFYt3By7bigGK8Lr6lZcwqO/GkLCVO9 BQ3IiwAz9PyxagtZtaSep+He93kpi8Wdwxvq0mbVUbZBHNjpyj8cCCX6gXlb+4dDjGFqs6o SLoPtpOPsOjr+2/VeaUUWTdjVRS25TOSlLKcUHFc4K8B2DrWYGsWq2cAT2YWqdGToqh86bm j/cSbY/EZDRylU7kKM7Fw== X-UI-Out-Filterresults: notjunk:1;V03:K0:Z6Fxvz+78n0=:G0zg9/qmoMmss1spMS4J8D YFWeZ6sVzGb/IOXqdyQgIfSlq1pGBwAlW7uf/nflrJ/Rot890bw1ooD8duORb2tW/SzC1OS2B sA6N7KoWAjC/q8eMZ9VT10PimQqmjTalFGXBhzq1KXXK4R6arWRZHtdYf3Bb7THFHoAIHLbBK wiWO2exxZn+008CpbpPZgvRaCFM58hyGSIkLHRiZhn4gnizSie67J9fmhf/4cwo8mcm7LuCHe FM98ac00IAkPo6lXYfSv3GcBzwHVqLlHFjCYwsU9eOe7c+rDvvWsdMmTNh3N6eQLmD5CYr54O KoHlv1mnXxweLeMiCHh0OZ/GYnCw7bZbsvVmVrJCwfVmkPBrAI+MrEX8F58ma7Ab2adXD3hZ8 qF1DlC4leVh9mWaCNtb4omPXWgozTL4THgL22YYorKMmF+5riW47l64aMW83O Received-SPF: none client-ip=212.227.17.10; 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 5d482dcbefd6..34760779c8ec 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6679,8 +6679,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)