{"id":817528,"url":"http://patchwork.ozlabs.org/api/patches/817528/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170922140237.10869-4-carenas@gmail.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170922140237.10869-4-carenas@gmail.com>","list_archive_url":null,"date":"2017-09-22T14:02:34","name":"[RFC,3/6] linux-user: refactor socket.h for mips","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e064f4b0d527bdc22c5d7830cdfa8bc71ceac4a1","submitter":{"id":72390,"url":"http://patchwork.ozlabs.org/api/people/72390/?format=json","name":"Carlo Arenas","email":"carenas@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170922140237.10869-4-carenas@gmail.com/mbox/","series":[{"id":4635,"url":"http://patchwork.ozlabs.org/api/series/4635/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4635","date":"2017-09-22T14:02:31","name":"linux-user: refactor socket.h into architecture specific sockbits","version":1,"mbox":"http://patchwork.ozlabs.org/series/4635/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/817528/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/817528/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"E6sKRAwp\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzFdJ1j41z9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 00:06:12 +1000 (AEST)","from localhost ([::1]:59088 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvOao-0000FF-B6\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 10:06:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53795)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <carenas@gmail.com>) id 1dvOXx-0006uk-PU\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:03:20 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <carenas@gmail.com>) id 1dvOXq-0001N2-QO\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:03:13 -0400","from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:36993)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <carenas@gmail.com>) id 1dvOXq-0001Mc-IU\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 10:03:06 -0400","by mail-pf0-x244.google.com with SMTP id e69so499337pfg.4\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 07:03:06 -0700 (PDT)","from localhost.localdomain (c-73-189-82-67.hsd1.ca.comcast.net.\n\t[73.189.82.67]) by smtp.gmail.com with ESMTPSA id\n\td124sm6428901pfc.42.2017.09.22.07.03.03\n\t(version=TLS1 cipher=AES128-SHA bits=128/128);\n\tFri, 22 Sep 2017 07:03:03 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=9+aqmHi6OSn9QQFJASH1cvYQoI/UsCTlXU04UMH+Cd8=;\n\tb=E6sKRAwpMIotWc9YD1vj7kjr6RwBUQ35Fq5idfuLoveHFv0JuRJNm9m5Y2DXHsJjGP\n\tNK7zzfR/1CmvJekBADeFazHyiH7X+p8kVwn13SwXIF4gklY6enisl+iEnjgAZyLNjqO2\n\tJVKZn+Sh7Z42M6SQhPUrIMfJDCXt0/BmB0GYr+Sbl/wydbvVlYj2N6D9f3v/JHrXUM7l\n\tOrAUtFw+TGClHyFmKkqLfi7F2Oc/2N3FT7Js9YnizjyZVol91NddJ80Bzh4J/jP7W94O\n\tpNs0wlTRn5cD4RQP7/4SdYvPoocMiv1Mul7OUzd5PreX6ofFCKPhSOH/1mfwbstAPvUt\n\tp84w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=9+aqmHi6OSn9QQFJASH1cvYQoI/UsCTlXU04UMH+Cd8=;\n\tb=JuWVA0QZ224CcsJcy9ZzX/+TEjZbH6hBItSo6r/wxq88rPApbj0E+CUdG+eO+uHuxX\n\tF1WKmNGdkkj8tbr29+lRZ6lxbHguVASoJAnT3MDGhky30LTFmDWlFLf2rK0fdt+FR/W1\n\tVxVGq1pDql699IM/DLRYRWMeWJ7+bjvgLpHIYHiJgxhG+gfliiBR4Gnig2SSJ0MVoJxq\n\t2z4zaLzvD/SIQGwVMr9j6qwvYu4MpBR3NQrYa1nYWannFXIZpU4lFI3J0yAjLZglNjI1\n\tjNL2Hvb91Rr6Y+x3UC0db++2qvrn7xWpbuvF5JzoRoWXSU90Angn6YnUgRb3HRPLBvwd\n\tk9Ig==","X-Gm-Message-State":"AHPjjUiUT5pbKg1tKGEk6vO3Bm7w7d7R+urNsRUx1+gR0pB7ISxMn2cJ\n\tl9O0UDJUsJmXf6pHgm5IU/YgZcWU","X-Google-Smtp-Source":"AOwi7QBN5l0nau/79H5GNQUUoP1MaAqlndTqIYLBw7iS0LoC64ni6RdcYpmTizyyug1tEKzYHmG6nQ==","X-Received":"by 10.98.11.207 with SMTP id 76mr9430399pfl.187.1506088984959;\n\tFri, 22 Sep 2017 07:03:04 -0700 (PDT)","From":"=?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= <carenas@gmail.com>","To":"qemu-devel@nongnu.org","Date":"Fri, 22 Sep 2017 07:02:34 -0700","Message-Id":"<20170922140237.10869-4-carenas@gmail.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170922140237.10869-1-carenas@gmail.com>","References":"<20170922140237.10869-1-carenas@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c00::244","Subject":"[Qemu-devel] [RFC 3/6] linux-user: refactor socket.h for mips","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"=?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= <carenas@gmail.com>,\n\triku.voipio@iki.fi, laurent@vivier.eu, rth@twiddle.net","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"fresh bits from linux 4.14, redefine SO_STYLE and {SO,SCM}_TIMESTAMP to\nthe target values and enables SO_REUSEPORT\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n linux-user/mips/sockbits.h | 107 +++++++++++++++++++++++++++++++++++++++++++++\n linux-user/socket.h        | 103 +------------------------------------------\n 2 files changed, 108 insertions(+), 102 deletions(-)\n create mode 100644 linux-user/mips/sockbits.h","diff":"diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h\nnew file mode 100644\nindex 0000000000..6d8ea8aba2\n--- /dev/null\n+++ b/linux-user/mips/sockbits.h\n@@ -0,0 +1,107 @@\n+#define TARGET_SOL_SOCKET     0xffff\n+\n+#define TARGET_SO_DEBUG       0x0001 /* Record debugging information.  */\n+#define TARGET_SO_REUSEADDR   0x0004 /* Allow reuse of local addresses.  */\n+#define TARGET_SO_KEEPALIVE   0x0008 /* Keep connections alive and send\n+                                        SIGPIPE when they die. */\n+#define TARGET_SO_DONTROUTE   0x0010 /* Don't do local routing. */\n+#define TARGET_SO_BROADCAST   0x0020 /* Allow transmission of\n+                                        broadcast messages. */\n+#define TARGET_SO_LINGER      0x0080 /* Block on close of a reliable\n+                                        socket to transmit pending data. */\n+#define TARGET_SO_OOBINLINE   0x0100 /* Receive out-of-band data in-band. */\n+#define TARGET_SO_REUSEPORT   0x0200 /* Allow local address and port reuse. */\n+#define TARGET_SO_TYPE        0x1008 /* Compatible name for TARGET_SO_STYLE. */\n+#define TARGET_SO_STYLE       TARGET_SO_TYPE /* Synonym */\n+#define TARGET_SO_ERROR       0x1007         /* get error status and clear */\n+#define TARGET_SO_SNDBUF      0x1001         /* Send buffer size. */\n+#define TARGET_SO_RCVBUF      0x1002         /* Receive buffer. */\n+#define TARGET_SO_SNDLOWAT    0x1003         /* send low-water mark */\n+#define TARGET_SO_RCVLOWAT    0x1004         /* receive low-water mark */\n+#define TARGET_SO_SNDTIMEO    0x1005         /* send timeout */\n+#define TARGET_SO_RCVTIMEO    0x1006         /* receive timeout */\n+#define TARGET_SO_ACCEPTCONN  0x1009\n+#define TARGET_SO_PROTOCOL    0x1028         /* protocol type */\n+#define TARGET_SO_DOMAIN      0x1029         /* domain/socket family */\n+#define TARGET_SO_NO_CHECK                      11\n+#define TARGET_SO_PRIORITY                      12\n+#define TARGET_SO_BSDCOMPAT                     14\n+#define TARGET_SO_PASSCRED                      17\n+#define TARGET_SO_PEERCRED                      18\n+#define TARGET_SO_SECURITY_AUTHENTICATION       22\n+#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23\n+#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK   24\n+#define TARGET_SO_BINDTODEVICE                  25\n+#define TARGET_SO_ATTACH_FILTER                 26\n+#define TARGET_SO_DETACH_FILTER                 27\n+#define TARGET_SO_GET_FILTER                    TARGET_SO_ATTACH_FILTER\n+#define TARGET_SO_PEERNAME                      28\n+#define TARGET_SO_TIMESTAMP                     29\n+#define TARGET_SCM_TIMESTAMP                    TARGET_SO_TIMESTAMP\n+#define TARGET_SO_PEERSEC                       30\n+#define TARGET_SO_SNDBUFFORCE                   31\n+#define TARGET_SO_RCVBUFFORCE                   33\n+#define TARGET_SO_PASSSEC                       34\n+#define TARGET_SO_TIMESTAMPNS                   35\n+#define TARGET_SCM_TIMESTAMPNS                  TARGET_SO_TIMESTAMPNS\n+#define TARGET_SO_MARK                          36\n+#define TARGET_SO_TIMESTAMPING                  37\n+#define TARGET_SCM_TIMESTAMPING                 TARGET_SO_TIMESTAMPING\n+#define TARGET_SO_RXQ_OVFL                      40\n+#define TARGET_SO_WIFI_STATUS                   41\n+#define TARGET_SCM_WIFI_STATUS                  TARGET_SO_WIFI_STATUS\n+#define TARGET_SO_PEEK_OFF                      42\n+#define TARGET_SO_NOFCS                         43\n+#define TARGET_SO_LOCK_FILTER                   44\n+#define TARGET_SO_SELECT_ERR_QUEUE              45\n+#define TARGET_SO_BUSY_POLL                     46\n+#define TARGET_SO_MAX_PACING_RATE               47\n+#define TARGET_SO_BPF_EXTENSIONS                48\n+#define TARGET_SO_INCOMING_CPU                  49\n+#define TARGET_SO_ATTACH_BPF                    50\n+#define TARGET_SO_DETACH_BPF                    TARGET_SO_DETACH_FILTER\n+#define TARGET_SO_ATTACH_REUSEPORT_CBPF         51\n+#define TARGET_SO_ATTACH_REUSEPORT_EBPF         52\n+#define TARGET_SO_CNX_ADVICE                    53\n+#define TARGET_SCM_TIMESTAMPING_OPT_STATS       54\n+#define TARGET_SO_MEMINFO                       55\n+#define TARGET_SO_INCOMING_NAPI_ID              56\n+#define TARGET_SO_COOKIE                        57\n+#define TARGET_SCM_TIMESTAMPING_PKTINFO         58\n+#define TARGET_SO_PEERGROUPS                    59\n+#define TARGET_SO_ZEROCOPY                      60\n+\n+/** sock_type - Socket types\n+ *\n+ * Please notice that for binary compat reasons MIPS has to\n+ * override the enum sock_type in include/linux/net.h, so\n+ * we define ARCH_HAS_SOCKET_TYPES here.\n+ *\n+ * @SOCK_DGRAM - datagram (conn.less) socket\n+ * @SOCK_STREAM - stream (connection) socket\n+ * @SOCK_RAW - raw socket\n+ * @SOCK_RDM - reliably-delivered message\n+ * @SOCK_SEQPACKET - sequential packet socket\n+ * @SOCK_DCCP - Datagram Congestion Control Protocol socket\n+ * @SOCK_PACKET - linux specific way of getting packets at the dev level.\n+ *                For writing rarp and other similar things on the user\n+ *                level.\n+ * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.\n+ * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.\n+ */\n+enum sock_type {\n+    TARGET_SOCK_DGRAM       = 1,\n+    TARGET_SOCK_STREAM      = 2,\n+    TARGET_SOCK_RAW         = 3,\n+    TARGET_SOCK_RDM         = 4,\n+    TARGET_SOCK_SEQPACKET   = 5,\n+    TARGET_SOCK_DCCP        = 6,\n+    TARGET_SOCK_PACKET      = 10,\n+    TARGET_SOCK_CLOEXEC     = 02000000,\n+    TARGET_SOCK_NONBLOCK    = 0x0080,\n+};\n+\n+#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)\n+#define TARGET_SOCK_TYPE_MASK 0xf  /* Covers up to TARGET_SOCK_MAX - 1. */\n+\n+#define ARCH_HAS_SOCKET_TYPES 1\ndiff --git a/linux-user/socket.h b/linux-user/socket.h\nindex 115bdf2ddb..036270a6e4 100644\n--- a/linux-user/socket.h\n+++ b/linux-user/socket.h\n@@ -1,106 +1,5 @@\n-\n #if defined(TARGET_MIPS)\n-    /* MIPS special values for constants */\n-\n-    /*\n-     * For setsockopt(2)\n-     *\n-     * This defines are ABI conformant as far as Linux supports these ...\n-     */\n-    #define TARGET_SOL_SOCKET      0xffff\n-\n-    #define TARGET_SO_DEBUG        0x0001  /* Record debugging information. */\n-    #define TARGET_SO_REUSEADDR    0x0004  /* Allow reuse of local addresses. */\n-    #define TARGET_SO_KEEPALIVE    0x0008  /* Keep connections alive and send\n-                                              SIGPIPE when they die. */\n-    #define TARGET_SO_DONTROUTE    0x0010  /* Don't do local routing. */\n-    #define TARGET_SO_BROADCAST    0x0020  /* Allow transmission of\n-                                              broadcast messages. */\n-    #define TARGET_SO_LINGER       0x0080  /* Block on close of a reliable\n-                                            * socket to transmit pending data.\n-                                            */\n-    #define TARGET_SO_OOBINLINE 0x0100     /* Receive out-of-band data in-band.\n-                                            */\n-    #if 0\n-    /* To add: Allow local address and port reuse. */\n-    #define TARGET_SO_REUSEPORT 0x0200\n-    #endif\n-\n-    #define TARGET_SO_TYPE         0x1008  /* Compatible name for SO_STYLE. */\n-    #define TARGET_SO_STYLE        SO_TYPE /* Synonym */\n-    #define TARGET_SO_ERROR        0x1007  /* get error status and clear */\n-    #define TARGET_SO_SNDBUF       0x1001  /* Send buffer size. */\n-    #define TARGET_SO_RCVBUF       0x1002  /* Receive buffer. */\n-    #define TARGET_SO_SNDLOWAT     0x1003  /* send low-water mark */\n-    #define TARGET_SO_RCVLOWAT     0x1004  /* receive low-water mark */\n-    #define TARGET_SO_SNDTIMEO     0x1005  /* send timeout */\n-    #define TARGET_SO_RCVTIMEO     0x1006  /* receive timeout */\n-    #define TARGET_SO_ACCEPTCONN   0x1009\n-\n-    /* linux-specific, might as well be the same as on i386 */\n-    #define TARGET_SO_NO_CHECK     11\n-    #define TARGET_SO_PRIORITY     12\n-    #define TARGET_SO_BSDCOMPAT    14\n-\n-    #define TARGET_SO_PASSCRED     17\n-    #define TARGET_SO_PEERCRED     18\n-\n-    /* Security levels - as per NRL IPv6 - don't actually do anything */\n-    #define TARGET_SO_SECURITY_AUTHENTICATION              22\n-    #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT        23\n-    #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK          24\n-\n-    #define TARGET_SO_BINDTODEVICE         25\n-\n-    /* Socket filtering */\n-    #define TARGET_SO_ATTACH_FILTER        26\n-    #define TARGET_SO_DETACH_FILTER        27\n-\n-    #define TARGET_SO_PEERNAME             28\n-    #define TARGET_SO_TIMESTAMP            29\n-    #define SCM_TIMESTAMP          SO_TIMESTAMP\n-\n-    #define TARGET_SO_PEERSEC              30\n-    #define TARGET_SO_SNDBUFFORCE          31\n-    #define TARGET_SO_RCVBUFFORCE          33\n-    #define TARGET_SO_PASSSEC              34\n-\n-    /** sock_type - Socket types\n-     *\n-     * Please notice that for binary compat reasons MIPS has to\n-     * override the enum sock_type in include/linux/net.h, so\n-     * we define ARCH_HAS_SOCKET_TYPES here.\n-     *\n-     * @SOCK_DGRAM - datagram (conn.less) socket\n-     * @SOCK_STREAM - stream (connection) socket\n-     * @SOCK_RAW - raw socket\n-     * @SOCK_RDM - reliably-delivered message\n-     * @SOCK_SEQPACKET - sequential packet socket\n-     * @SOCK_DCCP - Datagram Congestion Control Protocol socket\n-     * @SOCK_PACKET - linux specific way of getting packets at the dev level.\n-     *                For writing rarp and other similar things on the user\n-     *                level.\n-     * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.\n-     * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.\n-     */\n-\n-    #define ARCH_HAS_SOCKET_TYPES          1\n-\n-    enum sock_type {\n-           TARGET_SOCK_DGRAM       = 1,\n-           TARGET_SOCK_STREAM      = 2,\n-           TARGET_SOCK_RAW         = 3,\n-           TARGET_SOCK_RDM         = 4,\n-           TARGET_SOCK_SEQPACKET   = 5,\n-           TARGET_SOCK_DCCP        = 6,\n-           TARGET_SOCK_PACKET      = 10,\n-           TARGET_SOCK_CLOEXEC     = 02000000,\n-           TARGET_SOCK_NONBLOCK    = 0200,\n-    };\n-\n-    #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)\n-    #define TARGET_SOCK_TYPE_MASK    0xf  /* Covers up to TARGET_SOCK_MAX-1. */\n-\n+#include \"mips/sockbits.h\"\n #elif defined(TARGET_ALPHA)\n #include \"alpha/sockbits.h\"\n #elif defined(TARGET_HPPA)\n","prefixes":["RFC","3/6"]}