From nobody Thu May 16 15:46:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1556905984; cv=none; d=zoho.com; s=zohoarc; b=l3Ajgb/3Xl8ugIXJy2qvvlXCj3wE19hWR/mYCKGg7v2CwetOzZXE1a3L41sBcVyC19Rb3KL2c83mIq/DxTrG89QAX+Hdb8hSCo1EZlfM5DBwETdrscE3ith8UMY7EVYFla1nVZFPx7/FewY2PJwjtpdESo5Hb9qxtUXSeUX4Bh0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556905984; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=bHOP/uqCAikh2LaMUE+HB4pz0hBuBhugFzTfySTU9Bw=; b=CAG5ZxG5uWTySoeqN5QeUE+1KLzp+DpBC33m5fI8gebI13qi5NWisyyxZfevrWjLKvlUWAUpL+uTvF9BA+MmhItvELTNNDrk0ZVLYPeF3k0KUgM06kheHqK7tEevqdPkk/DsZyAM1EmlIlvZOWVQX2xGgKDn1/vVdZSxh/iO8jY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556905983907595.3684480995271; Fri, 3 May 2019 10:53:03 -0700 (PDT) Received: from localhost ([127.0.0.1]:45361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcMg-0002FP-NZ for importer@patchew.org; Fri, 03 May 2019 13:52:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcKy-0001GT-DT for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMcKx-0007aQ-9r for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:08 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:55531 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMcKx-0007Z0-2Z for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:07 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 0D3391A2050; Fri, 3 May 2019 19:51:06 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id E245B1A1F9B; Fri, 3 May 2019 19:51:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 19:50:42 +0200 Message-Id: <1556905846-14074-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v4 1/5] linux-user: Fix support for the SIOCATMARK and SIOCGPGRP ioctls for xtensa X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, nchen@wavecomp.com, philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Fix support for the SIOCATMARK and SIOCGPGRP ioctls for xtensa by correcting corresponding macro definition. Values for TARGET_SIOCATMARK and TARGET_SIOCGPGRP are determined by Linux kernel. Following relevant lines (obtained by grep) are from the kernel source tree: arch/ia64/include/uapi/asm/sockios.h:#define SIOCATMARK 0x8905 arch/mips/include/uapi/asm/sockios.h:#define SIOCATMARK _IOR('s', 7, int) arch/parisc/include/uapi/asm/sockios.h:#define SIOCATMARK 0x8905 arch/sh/include/uapi/asm/sockios.h:#define SIOCATMARK _IOR('s', 7, int) arch/xtensa/include/uapi/asm/sockios.h:#define SIOCATMARK _IOR('s', 7, int) arch/alpha/include/uapi/asm/sockios.h:#define SIOCATMARK _IOR('s', 7, int) arch/sparc/include/uapi/asm/sockios.h:#define SIOCATMARK 0x8905 include/uapi/asm-generic/sockios.h:#define SIOCATMARK 0x8905 arch/ia64/include/uapi/asm/sockios.h:#define SIOCGPGRP 0x8904 arch/mips/include/uapi/asm/sockios.h:#define SIOCGPGRP _IOR('s', 9, pid= _t) arch/parisc/include/uapi/asm/sockios.h:#define SIOCGPGRP 0x8904 arch/sh/include/uapi/asm/sockios.h:#define SIOCGPGRP _IOR('s', 9, pid= _t) arch/xtensa/include/uapi/asm/sockios.h:#define SIOCGPGRP _IOR('s', 9, pid= _t) arch/alpha/include/uapi/asm/sockios.h:#define SIOCGPGRP _IOR('s', 9, pid= _t) arch/sparc/include/uapi/asm/sockios.h:#define SIOCGPGRP 0x8904 include/uapi/asm-generic/sockios.h:#define SIOCGPGRP 0x8904 It is visible from above that xtensa should have the same definitions as alpha, mips and sh4 already do. This patch brings QEMU to the accurate state wrt these two ioctls. Acked-by: Max Filippov Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/syscall_defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 12c8407..1e86fb9 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -736,7 +736,8 @@ struct target_pollfd { #define TARGET_KDSETLED 0x4B32 /* set led state [lights, not flags]= */ #define TARGET_KDSIGACCEPT 0x4B4E =20 -#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) +#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) |= | \ + defined(TARGET_XTENSA) #define TARGET_SIOCATMARK TARGET_IOR('s', 7, int) #define TARGET_SIOCGPGRP TARGET_IOR('s', 9, pid_t) #else --=20 2.7.4 From nobody Thu May 16 15:46:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1556906001; cv=none; d=zoho.com; s=zohoarc; b=ni4dXn6Wpih/uV8nhq+9UtrctqArsFFtO9/XDv5xaYziy2H9Pj1G2HbqhyNPXR3/erMZe/WkZnhlktV8R+JUlQ6P4s8/0EYgV9fIwNOEWNbm02mzHCR7w5Rq4S7YuxMK36pBXeo7vBec0nbX2Zs19Xw16jx3RyFHPMhMEgAvqeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556906001; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=s18hJph6PdjL0lu0r1MwNR6zhWD8hM5xLnbKdh/vvis=; b=mcNLgFY9T3SLkzjzYAcAfzxPfTFi9wYzNtPiI05P8NISq1lL17v5bsaRAT6/+1Up55lP8g+3YAsjqn1zUNma2OujR/VZaAhAioS0nIKNfN9OpJHO7Iw7J4qEzP0qpfnuFiswQnL1tW5kdmDY0cKxyvWf4fNZjx5hErtrDnUU7ec= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556906001352971.8578658566024; Fri, 3 May 2019 10:53:21 -0700 (PDT) Received: from localhost ([127.0.0.1]:45363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcN2-0002Vk-6r for importer@patchew.org; Fri, 03 May 2019 13:53:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcLA-0001TN-S2 for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMcL9-0007pF-RN for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:20 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56216 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMcL9-0007mX-LB for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:19 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 895CD1A200D; Fri, 3 May 2019 19:51:18 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 6AF841A1F9B; Fri, 3 May 2019 19:51:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 19:50:43 +0200 Message-Id: <1556905846-14074-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v4 2/5] linux-user: Add support for the SIOCSPGRP ioctl for all targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, nchen@wavecomp.com, philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Add support for setting the process (or process group) to receive SIGIO or SIGURG signals when I/O becomes possible or urgent data is available, using SIOCSPGRP ioctl. The ioctl numeric values for SIOCSPGRP are platform-dependent and are determined by following files in Linux kernel source tree: arch/ia64/include/uapi/asm/sockios.h:#define SIOCSPGRP 0x8902 arch/mips/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_= t) arch/parisc/include/uapi/asm/sockios.h:#define SIOCSPGRP 0x8902 arch/sh/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_= t) arch/xtensa/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_= t) arch/alpha/include/uapi/asm/sockios.h:#define SIOCSPGRP _IOW('s', 8, pid_= t) arch/sparc/include/uapi/asm/sockios.h:#define SIOCSPGRP 0x8902 include/uapi/asm-generic/sockios.h:#define SIOCSPGRP 0x8902 Hence the different definition for alpha, mips, sh4, and xtensa. Reviewed-by: Max Filippov Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 1 + linux-user/syscall_defs.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index ae89516..c37adc5 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -218,6 +218,7 @@ IOCTL(SIOCSRARP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_arpreq))) IOCTL(SIOCGRARP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_arpreq))) IOCTL(SIOCGIWNAME, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_char_ifreq))) + IOCTL(SIOCSPGRP, IOC_W, MK_PTR(TYPE_INT)) /* pid_t */ IOCTL(SIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) /* pid_t */ IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval))) IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 1e86fb9..2941231 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -739,11 +739,14 @@ struct target_pollfd { #if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) |= | \ defined(TARGET_XTENSA) #define TARGET_SIOCATMARK TARGET_IOR('s', 7, int) +#define TARGET_SIOCSPGRP TARGET_IOW('s', 8, pid_t) #define TARGET_SIOCGPGRP TARGET_IOR('s', 9, pid_t) #else #define TARGET_SIOCATMARK 0x8905 +#define TARGET_SIOCSPGRP 0x8902 #define TARGET_SIOCGPGRP 0x8904 #endif + #define TARGET_SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define TARGET_SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ =20 --=20 2.7.4 From nobody Thu May 16 15:46:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1556906134; cv=none; d=zoho.com; s=zohoarc; b=Z268OsChfO/1kxiuDUtNrNqamg0Jd6bPRON8KB3bS8ToL9u+OW57iXwEnRwf8z0Hs74Hq7iNXdUdLqkLlWVe8JS0L28QO2tGYuafGE/dPYqOE0UAwTUFpaW23bsdcWcDBiRWHeG7H2fLy/su/sHj3iOt8ENofDuVuQQNdwWxGk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556906134; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Sd2PceoNcMS1IiAoWLYQoEycPGn/QJQnAxztFoK7IIU=; b=EmKYmHWruwMl1ZreA6jL87iiq9QZIZHA+JM+M25V1+ej/k9zN9ZiRMzBPmlS8kFolXeDZEsFu/TI/0CJMZhqBTb9CNIiypDKV/ePNcfH8yHLx4aMHgSaKYxUBbPnRJeBSXyXkq/mHrcQmg15/0Idd1TFrpnf0e8Vw92VrLoJk1o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556906134442111.81262930407445; Fri, 3 May 2019 10:55:34 -0700 (PDT) Received: from localhost ([127.0.0.1]:45399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcPA-0004eF-Fe for importer@patchew.org; Fri, 03 May 2019 13:55:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcLR-0001h0-7d for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMcLQ-0008PG-4m for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:37 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56245 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMcLP-0008Mr-Uf for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id E4A7A1A2050; Fri, 3 May 2019 19:51:34 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id C5BA61A200D; Fri, 3 May 2019 19:51:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 19:50:44 +0200 Message-Id: <1556905846-14074-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v4 3/5] linux-user: Add support the SIOCIFPFLAGS ioctls for all targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, nchen@wavecomp.com, philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Neng Chen Add support for getting and setting extended private flags of a network device via SIOCSIFPFLAGS and SIOCGIFPFLAGS ioctls. The ioctl numeric values are platform-independent and determined by the file include/uapi/linux/sockios.h in Linux kernel source code: #define SIOCSIFPFLAGS 0x8934 #define SIOCGIFPFLAGS 0x8935 These ioctls get (or set) the field ifr_flags of type short in the structure ifreq. Such functionality is achieved in QEMU by using MK_STRUCT() and MK_PTR() macros with an appropriate argument, as it was done for existing similar cases. Signed-off-by: Neng Chen Signed-off-by: Aleksandar Markovic Message-Id: <1554839486-3527-1-git-send-email-aleksandar.markovic@rt-rk.com> Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index c37adc5..76375df 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -206,6 +206,8 @@ IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq))) IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq))) IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq))) + IOCTL(SIOCSIFPFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq))) + IOCTL(SIOCGIFPFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)= )) IOCTL(SIOCSIFLINK, 0, TYPE_NULL) IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf, MK_PTR(MK_STRUCT(STRUCT_ifconf))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 2941231..8904d35 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -781,6 +781,8 @@ struct target_pollfd { #define TARGET_SIOCADDMULTI 0x8931 /* Multicast address lists = */ #define TARGET_SIOCDELMULTI 0x8932 #define TARGET_SIOCGIFINDEX 0x8933 +#define TARGET_SIOCSIFPFLAGS 0x8934 /* set extended flags = */ +#define TARGET_SIOCGIFPFLAGS 0x8935 /* get extended flags = */ =20 /* Bridging control calls */ #define TARGET_SIOCGIFBR 0x8940 /* Bridging support = */ --=20 2.7.4 From nobody Thu May 16 15:46:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1556906027; cv=none; d=zoho.com; s=zohoarc; b=XxwNW2zxo1PKP2ek6fsMCgP3OQINppVyiZvhVxtFe4mmDD6MDk38Wrp3eFh+/SsoHqMTyka4Tvl4cyJe90+ZH+bNNnsV+oxcjbi3iUL+XbQFzDt4LZZers7Zn6HLmdoRcEPKxbzXHsFgLXZoorwmvT+h3v4YutVkSgRi9q1xfCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556906027; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0GtPrwgKzPTzXYxZR0oF8Csj19tobiDwNhnFuwrp0VA=; b=GhBxzAVNCXD1NTVbQkOOLrG0pVeAgm7t+WoNWcLRdH45Tl7JYUVzjparvX3s1VmDZlPbNkbPKRJ4By9ra76D5rvasnrxIFdBe8PjEDCFVwBvp1djunPlBGnzjNDeUx6RXvTIQUJ5SV1wddbZ/pbIbc5U8nuHM7yEfVlwDTbp3P8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556906027913694.9355855495718; Fri, 3 May 2019 10:53:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:45365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcNU-0002uB-OP for importer@patchew.org; Fri, 03 May 2019 13:53:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcLZ-0001lJ-VT for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMcLY-0008Vp-3C for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:45 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56287 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMcLW-0008U8-QV for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:44 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 58D831A200D; Fri, 3 May 2019 19:51:41 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 2E5121A1F9B; Fri, 3 May 2019 19:51:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 19:50:45 +0200 Message-Id: <1556905846-14074-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v4 4/5] linux-user: Add support for setsockopt() options IPV6__MEMBERSHIP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, nchen@wavecomp.com, philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Neng Chen Add support for options IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMPEMBERSHIP of the syscall setsockopt(). These options control membership in multicast groups. Their argument is a pointer to a struct ipv6_mreq, which is in turn defined as: struct ipv6_mreq { /* IPv6 multicast address of group */ struct in6_addr ipv6mr_multiaddr; /* local IPv6 address of interface */ int ipv6mr_interface; }; The in6_addr structure consists of fields that are always big-endian (on host of any endian), so the ipv6_mreq's field ipv6mr_multiaddr doesn't need any endian conversion, whereas ipv6mr_interface does. Signed-off-by: Neng Chen Signed-off-by: Aleksandar Markovic --- linux-user/syscall.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 96cd4bf..b7eb4b7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1892,6 +1892,25 @@ static abi_long do_setsockopt(int sockfd, int level,= int optname, &pki, sizeof(pki))); break; } + case IPV6_ADD_MEMBERSHIP: + case IPV6_DROP_MEMBERSHIP: + { + struct ipv6_mreq ipv6mreq; + + if (optlen < sizeof(ipv6mreq)) { + return -TARGET_EINVAL; + } + + if (copy_from_user(&ipv6mreq, optval_addr, sizeof(ipv6mreq))) { + return -TARGET_EFAULT; + } + + ipv6mreq.ipv6mr_interface =3D tswap32(ipv6mreq.ipv6mr_interfac= e); + + ret =3D get_errno(setsockopt(sockfd, level, optname, + &ipv6mreq, sizeof(ipv6mreq))); + break; + } default: goto unimplemented; } --=20 2.7.4 From nobody Thu May 16 15:46:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1556906114; cv=none; d=zoho.com; s=zohoarc; b=DiaQo2od1B/ziAtCqRIaxN4JCYw7pCQzg9sorJ1Uh/aNURBBA6MYEDdKz2ssF6q/dgujXzK89z864513LiPwc1SXNdloswexPwsQStGekiz/o/N2msQYoHQbMThTpvo6p7WzwnH1rq0EWLfNJnwc2pepf+zP/0Bd/lKlLjl5c+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556906114; 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:ARC-Authentication-Results; bh=RQcsjFcRh7eBw7iI0RpEqKFGxYz8AjHj4Wen6egb5dQ=; b=k6T49UA72HAX9kqqiJtEd0Y0WUDrFbfJdSKJPSLtsU9OvrDT3nVAOCvvIhGQJffc7fOuyb9/JCHiGHjnt7zpy5gG3epJ81Xx3UFOw4HQ8bUZyjiQyiyI4oi6Rb6A/oC9YKdpqoiaL8W98NUTdIU1Sl1ODTOW/djMWGYef2bc44U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556906114346799.2831371911029; Fri, 3 May 2019 10:55:14 -0700 (PDT) Received: from localhost ([127.0.0.1]:45386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcOs-0004RX-DB for importer@patchew.org; Fri, 03 May 2019 13:55:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMcLk-0001uk-Gf for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMcLh-0000Ar-Vh for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:56 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56325 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMcLg-00008B-2Q for qemu-devel@nongnu.org; Fri, 03 May 2019 13:51:52 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 2DC711A2050; Fri, 3 May 2019 19:51:49 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 1077A1A1F9B; Fri, 3 May 2019 19:51:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 19:50:46 +0200 Message-Id: <1556905846-14074-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556905846-14074-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v4 5/5] linux-user: Sanitize interp_info and, for mips only, init field fp_abi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, nchen@wavecomp.com, philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Daniel Santos Sanitize interp_info structure in load_elf_binary() and, for MIPS only, init its field fp_abi to MIPS_ABI_FP_UNKNOWN. This fixes appearances of "Unexpected FPU mode" message in some MIPS use cases. Currently, this bug is a complete stopper for some MIPS binaries. In load_elf_binary(), struct image_info interp_info is used without being properly initialized. One result is that when the ELF's program header doesn't contain an entry for the ABI flags, then the value of the struct image_info's fp_abi field is set to whatever happened to be in stack memory at the time. Backporting to 4.0 and, if possible, to 3.1 is recommended. Fixes: https://bugs.launchpad.net/qemu/+bug/1825002 Signed-off-by: Daniel Santos Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier --- linux-user/elfload.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index c1a2602..7f09d57 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2698,6 +2698,11 @@ int load_elf_binary(struct linux_binprm *bprm, struc= t image_info *info) char *elf_interpreter =3D NULL; char *scratch; =20 + memset(&interp_info, 0, sizeof(interp_info)); +#ifdef TARGET_MIPS + interp_info.fp_abi =3D MIPS_ABI_FP_UNKNOWN; +#endif + info->start_mmap =3D (abi_ulong)ELF_START_MMAP; =20 load_elf_image(bprm->filename, bprm->fd, info, --=20 2.7.4