From patchwork Fri May 25 08:17:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfP66MQBz9s1b for ; Fri, 25 May 2018 18:22:02 +1000 (AEST) Received: from localhost ([::1]:42394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7z5-0004Lz-HI for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:21:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vd-0001lH-KJ for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vX-0008F5-O0 for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:25 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:60651) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vX-0008EJ-DY for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:19 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LrbAL-1gMNfI0Oy5-013NuC; Fri, 25 May 2018 10:18:09 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:42 +0200 Message-Id: <20180525081754.29506-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:EU/HSOMjfadeVO+auwVzyo+R7ssl3LHVKei2xQIyQ6+lAf+WkeK KWTXeJyMeTbqkHjsphJvpqpZneeOggqzuYw2oSd722nth6BlksAlQqF0m/5LmTXDDpQvg/h zfF3VRdzlgybut6hRgtE1uE71vKFe1gSIsYnDo/B+qpWp4ZxqRWAEXCPaGQqUqmALY1DqQV ZetVrhW6cNilo+1JZnNQQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:jWBonskw4Ao=:O5qpbhZPTFsSGci1P2Kw0M Mqw7krdroS7zlJWLBR7Zs4TfvN+iz5U0H3k20nSQOZ9t6C/UyoJES8CRiEDut4dyS9iwVbOzm irqojWUp0VfpnZAstVa97EfcBZOmx6Rl/iTh/A8Cn1ouJ8d4rumKKCxOn8Jy8u/azvzA2qax0 vG7t9D/f4eT+T2jLeqpmQdJsAxVNiysoaGBSaZ1awwbZvEZgbjNYvgazOtz0gjciZeClbvf9f c8zht28m/jxPlIqIQEw5OJrvfUf+2tbfJmEaf4e/bhQkQCxv9RsCDLhokuerp7fRbkBaHAHFB Tnlcm+qXyveZB7pbHv4IL2+QMBBBHfNoRpQ1u8QcTdbylwAi5piwWXPZYo5S7YJGUWkPbgGEZ BpKwARRReSVoiytEDSlrHwEl1K7HYjNmW+LycBf3+Ns9VHjbBgazfkdvU2k6oPZqOr5TUShhY q7QCgAJGk9dwL/10MbKnkCTJKwj7nJUQW97EE1+mW5oRClUX7tc4PUVNc32uasR5/h6FRxphn O6RR/2u+ZIcrI8KPRpjikipfwP9p5ornb46AlB/Jn/Iltqt1EtMgOjCVwd//DR3ydAEELAkhw AMZrio0FccNLsrNNVDI5bXN+3uBZxxyso9kMuq4+djtqX7kwNAcTieTEXZgjC0kNdvgXvB5t2 i3IMkI7OCLVaBi1tdeGbztlC6VGDhSgRbFQ/oz0ePYb4VIofC1nFfXn7ekx6ZUZmsOi8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PULL 01/13] linux-user: Assert on bad type in thunk_type_align() and thunk_type_size() 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: Peter Maydell , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In thunk_type_align() and thunk_type_size() we currently return -1 if the value at the type_ptr isn't one of the TYPE_* values we understand. However, this should never happen, and if it does then the calling code will go confusingly wrong because none of the callsites try to handle an error return. Switch to an assertion instead, so that if this does somehow happen we'll have a nice clear backtrace of what happened rather than a weird crash or misbehaviour. This also silences various Coverity complaints about not handling the negative return value (CID 1005735, 1005736, 1005738, 1390582). Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Message-Id: <20180514174616.19601-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- include/exec/user/thunk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h index 8f55b233b3..8d3af5a3be 100644 --- a/include/exec/user/thunk.h +++ b/include/exec/user/thunk.h @@ -135,7 +135,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host) se = struct_entries + type_ptr[1]; return se->size[is_host]; default: - return -1; + g_assert_not_reached(); } } @@ -185,7 +185,7 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host) se = struct_entries + type_ptr[1]; return se->align[is_host]; default: - return -1; + g_assert_not_reached(); } } From patchwork Fri May 25 08:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfRm3d4rz9s15 for ; Fri, 25 May 2018 18:24:20 +1000 (AEST) Received: from localhost ([::1]:42406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM81K-000653-4o for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:24:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7ve-0001mc-P5 for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vZ-0008HI-MT for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:33583) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Fj-Dn for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:21 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MRToW-1fohPF2Eoa-00SfVl; Fri, 25 May 2018 10:18:09 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:43 +0200 Message-Id: <20180525081754.29506-3-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:5RCsbSPVZxkrQtxEORu9Aa/wTJczNmigRcKw2CSAAO9yDBNJSiF vj94wudXnmEyKrVK9ovPwM7I2/sycB/r4vZcNlGCI0D6IR7w+L2i/1yKUS2AJVdg1Kbg10x LpcatJdCwp+NAhanhGgxBFOcGc1IRznVY9l1+0Aue8qgKsKmXhRJKlEiYdUIpNy9meqswox Q6YZKK7cPRCWxSfSUpXaA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ah63zDv5hjI=:RT5bM/sso+o8yAl2eXalhl EEiiOE9QAPI9wnDMQMG8AIw6CmZuv2Sn8yxyKz1jW08sY32CVJUAEjCfL63hLJlhu+xABZRMa VXoeFJKmjbYKeyL/kbM0f7ukoWkAW5747JCqu3GdEhrj5owNXh57z10s9ZD7gCl/3vWZKwN8q TXWWciIbtCpg+JoB7oWpi7fa/5TDJZyHByJVNswkf0PfYnvAzo36xFot2LYPmrPw6GHjExcRW m0ykHqcBbtcNmMHZD4RHvKlk3RkSErZyJ1JYyvUWYKXHgBc/NtK0muS6mZXn6NsDTX+f7G1cU CU4iAEViARntn66oFwN2YPptgLuyljh9hovIfMqisKEGesG5beZ2hNn9E0ZJXRuax3dEjU0P4 KalBjgLIM6V7zomxhUv02O4GWr5GB+IAM3JYiEUS37d8ZsQ79gCiYM2rF0UW5u4P3halszBFP 3Fg6v8Z6RHkJ/H9l6DUwTiRmtq4UHLWiX+gXXbitj4PB2z275fM2n3Pftm16RZrapQPB3ocxJ 5NXheUldgfAzAv78wyQu8AadL4ZFgZILfK6QD7sAuCrlDQ8ne2bOHTl9j9on8RVPOp6GnDgY8 3BDJI55AT21qjwHgTLQPuDVlETWWzVL+Y2WHp3rUSji84BW64j21Q/t5LnWqAbWrMJEYDlOGX mIbBeDbCDukMDWoz1cd+bdQ1N3Upa17fNb6QDKmiY6zq2RtKxew/mTr6qNSqYX2btCZY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 02/13] linux-user: update netlink emulation 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Update enums with entries from linux 4.17 Translate entries that generate logs with iproute2 4.9.0 and host kernel 4.15: # ip address show Unknown host QEMU_IFLA type: 43 Unknown host QEMU_IFLA type: 43 Unknown host QEMU_IFLA type: 43 Unknown QEMU_IFLA_BR type 41 Unknown QEMU_IFLA_BR type 42 Unknown QEMU_IFLA_BR type 43 Unknown QEMU_IFLA_BR type 44 Unknown host QEMU_IFLA type: 43 Unknown QEMU_IFLA_BR type 41 Unknown QEMU_IFLA_BR type 42 Unknown QEMU_IFLA_BR type 43 Unknown QEMU_IFLA_BR type 44 Unknown host QEMU_IFLA type: 43 Signed-off-by: Laurent Vivier Message-Id: <20180516221213.11111-1-laurent@vivier.eu> --- linux-user/syscall.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index af8603f1b7..dd77f86ea2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -405,6 +405,8 @@ enum { QEMU_IFLA_BR_PAD, QEMU_IFLA_BR_VLAN_STATS_ENABLED, QEMU_IFLA_BR_MCAST_STATS_ENABLED, + QEMU_IFLA_BR_MCAST_IGMP_VERSION, + QEMU_IFLA_BR_MCAST_MLD_VERSION, QEMU___IFLA_BR_MAX, }; @@ -453,6 +455,12 @@ enum { QEMU_IFLA_GSO_MAX_SIZE, QEMU_IFLA_PAD, QEMU_IFLA_XDP, + QEMU_IFLA_EVENT, + QEMU_IFLA_NEW_NETNSID, + QEMU_IFLA_IF_NETNSID, + QEMU_IFLA_CARRIER_UP_COUNT, + QEMU_IFLA_CARRIER_DOWN_COUNT, + QEMU_IFLA_NEW_IFINDEX, QEMU___IFLA_MAX }; @@ -484,6 +492,12 @@ enum { QEMU_IFLA_BRPORT_FLUSH, QEMU_IFLA_BRPORT_MULTICAST_ROUTER, QEMU_IFLA_BRPORT_PAD, + QEMU_IFLA_BRPORT_MCAST_FLOOD, + QEMU_IFLA_BRPORT_MCAST_TO_UCAST, + QEMU_IFLA_BRPORT_VLAN_TUNNEL, + QEMU_IFLA_BRPORT_BCAST_FLOOD, + QEMU_IFLA_BRPORT_GROUP_FWD_MASK, + QEMU_IFLA_BRPORT_NEIGH_SUPPRESS, QEMU___IFLA_BRPORT_MAX }; @@ -516,6 +530,15 @@ enum { QEMU___IFLA_INET6_MAX }; +enum { + QEMU_IFLA_XDP_UNSPEC, + QEMU_IFLA_XDP_FD, + QEMU_IFLA_XDP_ATTACHED, + QEMU_IFLA_XDP_FLAGS, + QEMU_IFLA_XDP_PROG_ID, + QEMU___IFLA_XDP_MAX, +}; + typedef abi_long (*TargetFdDataFunc)(void *, size_t); typedef abi_long (*TargetFdAddrFunc)(void *, abi_ulong, socklen_t); typedef struct TargetFdTrans { @@ -2182,6 +2205,10 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr, case QEMU_IFLA_BR_NF_CALL_IPTABLES: case QEMU_IFLA_BR_NF_CALL_IP6TABLES: case QEMU_IFLA_BR_NF_CALL_ARPTABLES: + case QEMU_IFLA_BR_VLAN_STATS_ENABLED: + case QEMU_IFLA_BR_MCAST_STATS_ENABLED: + case QEMU_IFLA_BR_MCAST_IGMP_VERSION: + case QEMU_IFLA_BR_MCAST_MLD_VERSION: break; /* uint16_t */ case QEMU_IFLA_BR_PRIORITY: @@ -2253,6 +2280,11 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, case QEMU_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK: case QEMU_IFLA_BRPORT_CONFIG_PENDING: case QEMU_IFLA_BRPORT_MULTICAST_ROUTER: + case QEMU_IFLA_BRPORT_MCAST_FLOOD: + case QEMU_IFLA_BRPORT_MCAST_TO_UCAST: + case QEMU_IFLA_BRPORT_VLAN_TUNNEL: + case QEMU_IFLA_BRPORT_BCAST_FLOOD: + case QEMU_IFLA_BRPORT_NEIGH_SUPPRESS: break; /* uint16_t */ case QEMU_IFLA_BRPORT_PRIORITY: @@ -2260,6 +2292,7 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, case QEMU_IFLA_BRPORT_DESIGNATED_COST: case QEMU_IFLA_BRPORT_ID: case QEMU_IFLA_BRPORT_NO: + case QEMU_IFLA_BRPORT_GROUP_FWD_MASK: u16 = NLA_DATA(nlattr); *u16 = tswap16(*u16); break; @@ -2434,6 +2467,27 @@ static abi_long host_to_target_data_spec_nlattr(struct nlattr *nlattr, return 0; } +static abi_long host_to_target_data_xdp_nlattr(struct nlattr *nlattr, + void *context) +{ + uint32_t *u32; + + switch (nlattr->nla_type) { + /* uint8_t */ + case QEMU_IFLA_XDP_ATTACHED: + break; + /* uint32_t */ + case QEMU_IFLA_XDP_PROG_ID: + u32 = NLA_DATA(nlattr); + *u32 = tswap32(*u32); + break; + default: + gemu_log("Unknown host XDP type: %d\n", nlattr->nla_type); + break; + } + return 0; +} + static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) { uint32_t *u32; @@ -2559,6 +2613,10 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rta_len, NULL, host_to_target_data_spec_nlattr); + case QEMU_IFLA_XDP: + return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rta_len, + NULL, + host_to_target_data_xdp_nlattr); default: gemu_log("Unknown host QEMU_IFLA type: %d\n", rtattr->rta_type); break; From patchwork Fri May 25 08:17:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920300 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfV84tH6z9s19 for ; Fri, 25 May 2018 18:26:24 +1000 (AEST) Received: from localhost ([::1]:42421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM83K-00081u-BZ for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:26:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7ve-0001mf-TN for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7va-0008Hj-2K for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:40425) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Ft-Pi for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:22 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MNtBT-1fRvUP0DrH-007TaI; Fri, 25 May 2018 10:18:10 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:44 +0200 Message-Id: <20180525081754.29506-4-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:Rmiz2ttCCN0tqn9VWk01+9Yf+cRQEkeKYyyEOj+g9z6/7LQz5Zh wc49/ukbCyLxxBDTKNr3N7z+FJAgUaYJATOQjDMM+7hzzsI981FyxpImKp0pslcBkoGZNQl RljEij1EKveJk0KRGOC2oHdJYPy1Z6ZX04n2yc/3rzBhsYEkD9XiXshForbbFK6vwcXRBXK iN74fSCrvGE77Iisz+k3Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:9DkWXaP77I0=:uIoEREDATBuukndiHzt3rl TeL87jdCmP+zXcYlfU4yqH1HfBUvN60WnKz2tsefe4x3zhrK4d1Vb5b2m9Y7ODHLbMTtstdDP WvvHGqS0azToa6XytKVBNdolEX2BQtr7sS6GDZ311yXx60KGGyXQlGcT43ZrpfljTMyROWBy5 xs888cHmjqtjyCpIopKaasPLXPv+Bc+ZETzQ16NNCJBWv2oYyMIr/YW2AiMEQlItW6sB/3hqs GYb7lYFC8uFAPFn1j6ykmAOCyfEm6fed4VcrhhmIvpR2mYGewm+LFKCnUlV5NXjPP/v4/WMBv +xk67Q7Mhxf2iznhZhG4LctchmNozz9j/gAfQNXGXzsWqlE3lpf5ZRQNky3JrlW3RX0CUN2Mc +wh3j9hxtkwJaVbi49mg2jP3PWmMbTYqXmbs2+5l166gNL9C8DxCwC9kd1C2yLiJuXT2vlreN S7NK2ytzTmhTwdDiX9sVuBd3WSwOVQOnjdWYJi/OGeJ9zTDsSkWgxKwWrzHxEzkv0REEJ5jPB pawj9mU/yNyvgRpNcix+VU2t02visY9ymqP79BKWRsLqP2lTdq3yZ/lAJDTBWLfg6AD/IWSML fMuZo2A9lXb4iRKBRadpXuVqTNW8vuc8hxj2D48MLJknpeOf3srf6KdmcbmrY8JZg6VTEDsif SWLrgG5w+uCsa1JYHjFxaO6Dk/uUN07kAPZEiDjswbR/Y0i76ARgUsZ0UXNZUaWV0wyU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PULL 03/13] linux-user: update comments to point to tcg_exec_init() 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: Igor Mammedov , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov cpu_init() was replaced by cpu_create() since 2.12 but comments weren't updated. So update stale comments to point that page sizes arei actually initialized by tcg_exec_init(). Also move another qemu_host_page_size related comment before tcg_exec_init() where it belongs. Signed-off-by: Igor Mammedov Reviewed-by: Laurent Vivier Message-Id: <1526557877-293151-1-git-send-email-imammedo@redhat.com> Signed-off-by: Laurent Vivier --- bsd-user/main.c | 7 ++++--- linux-user/main.c | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 283dc6fd25..da3b833975 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -898,9 +898,10 @@ int main(int argc, char **argv) cpu_model = "any"; #endif } + + /* init tcg before creating CPUs and to get qemu_host_page_size */ tcg_exec_init(0); - /* NOTE: we need to init the CPU at this stage to get - qemu_host_page_size */ + cpu_type = parse_cpu_model(cpu_model); cpu = cpu_create(cpu_type); env = cpu->env_ptr; @@ -917,7 +918,7 @@ int main(int argc, char **argv) envlist_free(envlist); /* - * Now that page sizes are configured in cpu_init() we can do + * Now that page sizes are configured in tcg_exec_init() we can do * proper page alignment for guest_base. */ guest_base = HOST_PAGE_ALIGN(guest_base); diff --git a/linux-user/main.c b/linux-user/main.c index 32347545c9..78d6d3e7eb 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -671,9 +671,8 @@ int main(int argc, char **argv, char **envp) } cpu_type = parse_cpu_model(cpu_model); + /* init tcg before creating CPUs and to get qemu_host_page_size */ tcg_exec_init(0); - /* NOTE: we need to init the CPU at this stage to get - qemu_host_page_size */ cpu = cpu_create(cpu_type); env = cpu->env_ptr; @@ -693,7 +692,7 @@ int main(int argc, char **argv, char **envp) envlist_free(envlist); /* - * Now that page sizes are configured in cpu_init() we can do + * Now that page sizes are configured in tcg_exec_init() we can do * proper page alignment for guest_base. */ guest_base = HOST_PAGE_ALIGN(guest_base); From patchwork Fri May 25 08:17:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfL23WPCz9s15 for ; Fri, 25 May 2018 18:19:21 +1000 (AEST) Received: from localhost ([::1]:42376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7wR-0001mj-6F for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:19:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vc-0001kB-ND for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vY-0008FW-DJ for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:24 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:32979) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vY-0008Er-3V for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:20 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M2MnE-1gBc182MhI-00s9UX; Fri, 25 May 2018 10:18:10 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:45 +0200 Message-Id: <20180525081754.29506-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:IbbJw5M6Y1RR3q3Xv7gDeApulJSgTNXh56P6/TcK5QAy6U4wBHl jTrWbwamv4D7w6CjEenGs042j8ZqmLaDFvtIJ22Cj5uXFHa6lzPcjZJDxU90yN5etr/b2Jv Cu0Wf8KK2LEqUDCBiLZlJbiVophutYyKE7J4HCjVq/Q7CVwPJZbmI7MlQ6qGqiYiBFZV/wV AIdGwDAdMZ0PbhrFTD6zw== X-UI-Out-Filterresults: notjunk:1; V01:K0:MNJF2hzXsxs=:EI1vn7HPiAFy3Zoyp22myx f0+Z9ra05qYGpOASqaW1NcZ3jWareF2Qe+o0xrvENYpuLEvkW2AsB7XQ9WtcAQiaJX6Lad5jE WDfrfq8IARwJi1hlBnXnvI42c/BknA0NZzbd7a/50sQTIcW9ssJ0BH2j70AzojJX6lNk5MsZ/ rR8iMbi5BCrhXv3X5OxB68iCEWG8C7RoxmALZuVizSYIGUgmsZnPVAppMvqDCqICWmqlgY/pm 2YyKzDxW/et/JPsyhAue8ceVLs6T2i0qgvDKiPPMRsJoc72AUjme7FkKYxo0IyvxJkQSJwgcG Wr35Oao0EcFGwMi6y3qmX6ha6X7dT1RzCD1cWfEEJ5cN4HNerzPuFL8G2v8eo+55irC6KEt5/ h5sB6ZJGtbzxVSTzziRDU0aidoiJNY67dJsrX/TzRXjRlWNdAMGk9/kEfJeYZpHy6799Jv01+ ocKrIOovX4ScP2aq73as/irk/H/xnOETYGbEzUBFaVu4Z3GXNBniUScuBaEeZPzDvbn4p+DF7 HIZ9b7/Dv6N1gqpietj1iTFvrY+2y6iZahAbe6xEdGQFvRZUIaNyyTfdgA6GrkbeUxg7Ki5st 2BT0t/F7iEXEzR2msIiXBWV5XqqDrRnVo3vr8HWMIXXyvaXaoPOnBUYAyMXfVKesy9VJ5oU8x p2XTCXy+wNsXOkZgckViK2zc2F3ctlWsuvuENTbPZYC3xhLtpAN+lfgGCzNlgrY9n1wE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.75 Subject: [Qemu-devel] [PULL 04/13] linux-user: Fix payload size logic in host_to_target_cmsg() 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: Peter Maydell , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Coverity points out that there's a missing break in the switch in host_to_target_cmsg() where we update tgt_len for cmsg_level/cmsg_type combinations which require a different length for host and target (CID 1385425). To avoid duplicating the default case (target length same as host) in both switches, set that before the switch so that only the cases which want to override it need any code. This fixes a bug where we would have used the wrong length for SOL_SOCKET/SO_TIMESTAMP messages where the target and host have differently sized 'struct timeval' (ie one is 32 bit and the other is 64 bit). Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Message-Id: <20180518184715.29833-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index dd77f86ea2..d02c16bbc6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1848,6 +1848,7 @@ static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh, /* Payload types which need a different size of payload on * the target must adjust tgt_len here. */ + tgt_len = len; switch (cmsg->cmsg_level) { case SOL_SOCKET: switch (cmsg->cmsg_type) { @@ -1857,8 +1858,8 @@ static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh, default: break; } + break; default: - tgt_len = len; break; } From patchwork Fri May 25 08:17:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfV80Sxbz9s15 for ; Fri, 25 May 2018 18:26:24 +1000 (AEST) Received: from localhost ([::1]:42418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM83J-00080q-Py for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:26:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vd-0001lF-KC for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vb-0008J6-IE for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:25 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:52051) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vb-0008IL-8G for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:23 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MbhTh-1fcHKg039B-00J5my; Fri, 25 May 2018 10:18:11 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:46 +0200 Message-Id: <20180525081754.29506-6-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:DdpG3saVq2s+0/DMNzX+RNlCNwmzFppI68xZBaFxzIoZELHLBEG UnzAYXL7PBI94eCCdmSPnHWs5Iml6MuDYp03ot2sEhKvxsI3CCP11/aj3nMzMESlDIFixAo X6pZ3O+sKLgQ6cmfxH/Q6TxDI2Hr0M0gScHjdseASk0LZs83EqFp9/UkhDCmRGFys0Oe7x4 YjZ02QasOl/1mUYz52ZAg== X-UI-Out-Filterresults: notjunk:1; V01:K0:x+VE2+8v3iQ=:dGejusCyll6HRLSFhZ+5gJ 341HiKJ6kkiLUjl36l87AD1JaG9wsMqeWcJv8ietUG6SHVOcnZFm59HSCcJNAXp/ofjtouy+t Efh8VVLccvu2pAx0xAfHBsvh6ylKUgWLuSxgKLSvQ33DAyT2Y2Z3n8IMXWqP7EreE7i59PVsy +6oIHpSaZvXf6JS4M3mvy0rU2Bv8x66w4ECShMsbeQnP+5RntewHYK9y/E07/3LQKK33ijtjx T3xLLWzBQGv0k9K+Zk8y+gQhvw33u+h002uk1SjTVsVm6h/eZvwlovLcgD1EqN1V7JQ6FMs2t x+MvG/UFPXPeuZzlEKasFx+zvBc7v40N/mO3TY8BXDtCpK7dRu1SjC4o7t93AJ8YGBgD2ElWi rRoo2zSZBxEeYOWzzHNSFTVNsUQDxrDVajUWbUZKVwC+aXsHiwo1arEQnoPLlzfGAxSqvkq92 ztwyBgogc5LA02vu7+zDm1yk8hutwCXKX7+JgEorhSfv9wNYrwrcItzuwpEWaTHCCyTtv+MKf U+6YlBl9I3ZgvR7mor8vdrkm4P7bHU37MgVPVLblEAvMoYOENGM9rDXdjlZv4ZWnYlANlV6BB eYBCJECt+LICBECKWTA4OEvIdnrrXWi696eSLocTpdsfmUwFKrfLmOzikLM/X91W84CaD0g07 KFzV5mfqsXMHmVGWcCFwTdzZ0nT+UsMqYfV9zb8RBO+J5fYEeYOOacgZg2JS6Auou815BbG/r Vz2490+NQCJB3VFX X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.13 Subject: [Qemu-devel] [PULL 05/13] linux-user: move mips socket.h definitions to mips/sockbits.h 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180519092956.15134-2-laurent@vivier.eu> --- linux-user/mips/sockbits.h | 110 +++++++++++++++++++++++++++++++++++++++++++ linux-user/mips64/sockbits.h | 1 + linux-user/socket.h | 106 +---------------------------------------- 3 files changed, 113 insertions(+), 104 deletions(-) create mode 100644 linux-user/mips/sockbits.h create mode 100644 linux-user/mips64/sockbits.h diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h new file mode 100644 index 0000000000..3fe5ac88e7 --- /dev/null +++ b/linux-user/mips/sockbits.h @@ -0,0 +1,110 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef MIPS_SOCKBITS_H +#define MIPS_SOCKBITS_H +/* MIPS special values for constants */ + +/* + * For setsockopt(2) + * + * This defines are ABI conformant as far as Linux supports these ... + */ +#define TARGET_SOL_SOCKET 0xffff + +#define TARGET_SO_DEBUG 0x0001 /* Record debugging information. */ +#define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */ +#define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and send + SIGPIPE when they die. */ +#define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */ +#define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of + broadcast messages. */ +#define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable + * socket to transmit pending data. + */ +#define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. + */ +#if 0 +/* To add: Allow local address and port reuse. */ +#define TARGET_SO_REUSEPORT 0x0200 +#endif + +#define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ +#define TARGET_SO_STYLE SO_TYPE /* Synonym */ +#define TARGET_SO_ERROR 0x1007 /* get error status and clear */ +#define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */ +#define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */ +#define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ +#define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ +#define TARGET_SO_ACCEPTCONN 0x1009 + +/* linux-specific, might as well be the same as on i386 */ +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_BSDCOMPAT 14 + +#define TARGET_SO_PASSCRED 17 +#define TARGET_SO_PEERCRED 18 + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 22 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER 26 +#define TARGET_SO_DETACH_FILTER 27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP 29 +#define SCM_TIMESTAMP SO_TIMESTAMP + +#define TARGET_SO_PEERSEC 30 +#define TARGET_SO_SNDBUFFORCE 31 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_PASSSEC 34 + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons MIPS has to + * override the enum sock_type in include/linux/net.h, so + * we define ARCH_HAS_SOCKET_TYPES here. + * + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_STREAM - stream (connection) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + * For writing rarp and other similar things on the user + * level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ + +#define ARCH_HAS_SOCKET_TYPES 1 + +enum sock_type { + TARGET_SOCK_DGRAM = 1, + TARGET_SOCK_STREAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP = 6, + TARGET_SOCK_PACKET = 10, + TARGET_SOCK_CLOEXEC = 02000000, + TARGET_SOCK_NONBLOCK = 0200, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ +#endif diff --git a/linux-user/mips64/sockbits.h b/linux-user/mips64/sockbits.h new file mode 100644 index 0000000000..e6b6d31ac9 --- /dev/null +++ b/linux-user/mips64/sockbits.h @@ -0,0 +1 @@ +#include "../mips/sockbits.h" diff --git a/linux-user/socket.h b/linux-user/socket.h index 7051cd2cf4..9c57da7a61 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,106 +1,6 @@ -#if defined(TARGET_MIPS) - /* MIPS special values for constants */ - - /* - * For setsockopt(2) - * - * This defines are ABI conformant as far as Linux supports these ... - */ - #define TARGET_SOL_SOCKET 0xffff - - #define TARGET_SO_DEBUG 0x0001 /* Record debugging information. */ - #define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */ - #define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and send - SIGPIPE when they die. */ - #define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */ - #define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of - broadcast messages. */ - #define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable - * socket to transmit pending data. - */ - #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. - */ - #if 0 - /* To add: Allow local address and port reuse. */ - #define TARGET_SO_REUSEPORT 0x0200 - #endif - - #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ - #define TARGET_SO_STYLE SO_TYPE /* Synonym */ - #define TARGET_SO_ERROR 0x1007 /* get error status and clear */ - #define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */ - #define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */ - #define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */ - #define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */ - #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ - #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ - #define TARGET_SO_ACCEPTCONN 0x1009 - - /* linux-specific, might as well be the same as on i386 */ - #define TARGET_SO_NO_CHECK 11 - #define TARGET_SO_PRIORITY 12 - #define TARGET_SO_BSDCOMPAT 14 - - #define TARGET_SO_PASSCRED 17 - #define TARGET_SO_PEERCRED 18 - - /* Security levels - as per NRL IPv6 - don't actually do anything */ - #define TARGET_SO_SECURITY_AUTHENTICATION 22 - #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 - #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 - - #define TARGET_SO_BINDTODEVICE 25 - - /* Socket filtering */ - #define TARGET_SO_ATTACH_FILTER 26 - #define TARGET_SO_DETACH_FILTER 27 - - #define TARGET_SO_PEERNAME 28 - #define TARGET_SO_TIMESTAMP 29 - #define SCM_TIMESTAMP SO_TIMESTAMP - - #define TARGET_SO_PEERSEC 30 - #define TARGET_SO_SNDBUFFORCE 31 - #define TARGET_SO_RCVBUFFORCE 33 - #define TARGET_SO_PASSSEC 34 - - /** sock_type - Socket types - * - * Please notice that for binary compat reasons MIPS has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. - */ - - #define ARCH_HAS_SOCKET_TYPES 1 - - enum sock_type { - TARGET_SOCK_DGRAM = 1, - TARGET_SOCK_STREAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 02000000, - TARGET_SOCK_NONBLOCK = 0200, - }; - - #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) - #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ - +#if defined(TARGET_MIPS) || defined(TARGET_HPPA) +#include "sockbits.h" #elif defined(TARGET_ALPHA) /* For setsockopt(2) */ @@ -205,8 +105,6 @@ #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ -#elif defined(TARGET_HPPA) -#include #else #if defined(TARGET_SPARC) From patchwork Fri May 25 08:17:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920293 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfP548Jxz9s19 for ; Fri, 25 May 2018 18:22:01 +1000 (AEST) Received: from localhost ([::1]:42393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7z5-0004LL-85 for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:21:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vc-0001kA-LX for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vY-0008FQ-8i for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:24 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:42047) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vX-0008Ei-Uy for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:20 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LaD2U-1g4ZZ72Nl0-00lzLX; Fri, 25 May 2018 10:18:11 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:47 +0200 Message-Id: <20180525081754.29506-7-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:82H/M4zBaMtF51T+jNfJchn933URAf8UCs3cmyeJreUv0jaYejD qMIElVO4wnG3hc7QYzdX624SYR32gkrlV838wxEQ6THmGiJNuz01koZV1VYKg3gTiRwwlDG +XAfskpJG82r0W+dXJcfsTlUUA34KiK/U596YYBwraJO0oV1yHPcU76wQpW4EMBT8i+UgeQ B1zrcuRcweuie8TC/bWWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:SsIrfsLI76k=:vkOk0PrHXeRPPI6NsXo7sN VTBlm7CEvhjdLMKeVXZaimMqgkIO+KuKqXp5F7hKY8ZxjpNtDisdDueeeGbpqFP7xpbOrFXn9 /CkVZtpN81isWgKom6By78bVo3AoxzMLfyHUf53QAn+WTZl5IyMuYUxaq4knU/HGjRF7mP/Or PtClRIKzO/x4O4EmxDFBCHTISOUhl+aF8vyBeLHikGdHb4akN7cHfk+gT0Dfq7ZzhmtyT/c8n 1fCR8Op0sgB9ILMagcQWQHHKkTgyWXT6kVOgA9PmhWMaHPRimihVvHkZsfpROvXed5Q1AtWe8 DW8mhT3Rtdze6dwbOcCUFKsSdNnjgJhwaSVOX5celR77ZSIkJRU2Ra3UoWZjk48pRsYRMgHH6 /RUTkrfoNN/Epl3E/neOuiHGl4XSRxsHbs7cN9ynq0IncoEYcpcTbgwCWKkRw8vqIqI1lURgS 3Zq7G2alALC+DIpF47j0/QWgnOCsh5PiEY7b7+zHzA8ljxv3wWUGrhyOsyesOlSGDn4C3AMIn pP+E3gfNd00MfenlQRyTbr3JDNHtbwywLFG5brDq5sa4PG4xDHgIgWiPlePHODpTYPOGksH1+ wwVDY+AqIV1ablpeTJPCRXpSGneC7Vrh9uVdYUp86/3tTUHrgpRKX/D8OR4n6IrLftwS9qAqS yEfPZJvES0ZjxjBikvSNw7seHCJLwvgiRKt0execzkwj05CWplUkPR1wjPz/FYQBqS+ITOgFG 0CnAlvJTmW6Q/IX4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PULL 06/13] linux-user: move alpha socket.h definitions to alpha/sockbits.h 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180519092956.15134-3-laurent@vivier.eu> --- linux-user/alpha/sockbits.h | 113 ++++++++++++++++++++++++++++++++++++++++++++ linux-user/socket.h | 106 +---------------------------------------- 2 files changed, 114 insertions(+), 105 deletions(-) create mode 100644 linux-user/alpha/sockbits.h diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h new file mode 100644 index 0000000000..4db3e52b67 --- /dev/null +++ b/linux-user/alpha/sockbits.h @@ -0,0 +1,113 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef ALPHA_SOCKBITS_H +#define ALPHA_SOCKBITS_H + +/* For setsockopt(2) */ +#define TARGET_SOL_SOCKET 0xffff + +#define TARGET_SO_DEBUG 0x0001 +#define TARGET_SO_REUSEADDR 0x0004 +#define TARGET_SO_KEEPALIVE 0x0008 +#define TARGET_SO_DONTROUTE 0x0010 +#define TARGET_SO_BROADCAST 0x0020 +#define TARGET_SO_LINGER 0x0080 +#define TARGET_SO_OOBINLINE 0x0100 +/* To add :#define TARGET_SO_REUSEPORT 0x0200 */ + +#define TARGET_SO_TYPE 0x1008 +#define TARGET_SO_ERROR 0x1007 +#define TARGET_SO_SNDBUF 0x1001 +#define TARGET_SO_RCVBUF 0x1002 +#define TARGET_SO_SNDBUFFORCE 0x100a +#define TARGET_SO_RCVBUFFORCE 0x100b +#define TARGET_SO_RCVLOWAT 0x1010 +#define TARGET_SO_SNDLOWAT 0x1011 +#define TARGET_SO_RCVTIMEO 0x1012 +#define TARGET_SO_SNDTIMEO 0x1013 +#define TARGET_SO_ACCEPTCONN 0x1014 +#define TARGET_SO_PROTOCOL 0x1028 +#define TARGET_SO_DOMAIN 0x1029 + +/* linux-specific, might as well be the same as on i386 */ +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_BSDCOMPAT 14 + +#define TARGET_SO_PASSCRED 17 +#define TARGET_SO_PEERCRED 18 +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER 26 +#define TARGET_SO_DETACH_FILTER 27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP 29 +#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP + +#define TARGET_SO_PEERSEC 30 +#define TARGET_SO_PASSSEC 34 +#define TARGET_SO_TIMESTAMPNS 35 +#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 19 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 20 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 21 + +#define TARGET_SO_MARK 36 + +#define TARGET_SO_TIMESTAMPING 37 +#define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING + +#define TARGET_SO_RXQ_OVFL 40 + +#define TARGET_SO_WIFI_STATUS 41 +#define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS +#define TARGET_SO_PEEK_OFF 42 + +/* Instruct lower device to use last 4-bytes of skb data as FCS */ +#define TARGET_SO_NOFCS 43 + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons ALPHA has to + * override the enum sock_type in include/linux/net.h, so + * we define ARCH_HAS_SOCKET_TYPES here. + * + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_STREAM - stream (connection) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + * For writing rarp and other similar things on the user + * level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ + +#define ARCH_HAS_SOCKET_TYPES 1 + +enum sock_type { + TARGET_SOCK_STREAM = 1, + TARGET_SOCK_DGRAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP = 6, + TARGET_SOCK_PACKET = 10, + TARGET_SOCK_CLOEXEC = 010000000, + TARGET_SOCK_NONBLOCK = 010000000000, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ +#endif diff --git a/linux-user/socket.h b/linux-user/socket.h index 9c57da7a61..1328906205 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,110 +1,6 @@ -#if defined(TARGET_MIPS) || defined(TARGET_HPPA) +#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) #include "sockbits.h" -#elif defined(TARGET_ALPHA) - - /* For setsockopt(2) */ - #define TARGET_SOL_SOCKET 0xffff - - #define TARGET_SO_DEBUG 0x0001 - #define TARGET_SO_REUSEADDR 0x0004 - #define TARGET_SO_KEEPALIVE 0x0008 - #define TARGET_SO_DONTROUTE 0x0010 - #define TARGET_SO_BROADCAST 0x0020 - #define TARGET_SO_LINGER 0x0080 - #define TARGET_SO_OOBINLINE 0x0100 - /* To add :#define TARGET_SO_REUSEPORT 0x0200 */ - - #define TARGET_SO_TYPE 0x1008 - #define TARGET_SO_ERROR 0x1007 - #define TARGET_SO_SNDBUF 0x1001 - #define TARGET_SO_RCVBUF 0x1002 - #define TARGET_SO_SNDBUFFORCE 0x100a - #define TARGET_SO_RCVBUFFORCE 0x100b - #define TARGET_SO_RCVLOWAT 0x1010 - #define TARGET_SO_SNDLOWAT 0x1011 - #define TARGET_SO_RCVTIMEO 0x1012 - #define TARGET_SO_SNDTIMEO 0x1013 - #define TARGET_SO_ACCEPTCONN 0x1014 - #define TARGET_SO_PROTOCOL 0x1028 - #define TARGET_SO_DOMAIN 0x1029 - - /* linux-specific, might as well be the same as on i386 */ - #define TARGET_SO_NO_CHECK 11 - #define TARGET_SO_PRIORITY 12 - #define TARGET_SO_BSDCOMPAT 14 - - #define TARGET_SO_PASSCRED 17 - #define TARGET_SO_PEERCRED 18 - #define TARGET_SO_BINDTODEVICE 25 - - /* Socket filtering */ - #define TARGET_SO_ATTACH_FILTER 26 - #define TARGET_SO_DETACH_FILTER 27 - - #define TARGET_SO_PEERNAME 28 - #define TARGET_SO_TIMESTAMP 29 - #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP - - #define TARGET_SO_PEERSEC 30 - #define TARGET_SO_PASSSEC 34 - #define TARGET_SO_TIMESTAMPNS 35 - #define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS - - /* Security levels - as per NRL IPv6 - don't actually do anything */ - #define TARGET_SO_SECURITY_AUTHENTICATION 19 - #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 20 - #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 21 - - #define TARGET_SO_MARK 36 - - #define TARGET_SO_TIMESTAMPING 37 - #define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING - - #define TARGET_SO_RXQ_OVFL 40 - - #define TARGET_SO_WIFI_STATUS 41 - #define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS - #define TARGET_SO_PEEK_OFF 42 - - /* Instruct lower device to use last 4-bytes of skb data as FCS */ - #define TARGET_SO_NOFCS 43 - - /** sock_type - Socket types - * - * Please notice that for binary compat reasons ALPHA has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. - */ - - #define ARCH_HAS_SOCKET_TYPES 1 - - enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 010000000, - TARGET_SOCK_NONBLOCK = 010000000000, - }; - - #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) - #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ #else #if defined(TARGET_SPARC) From patchwork Fri May 25 08:17:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920298 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfRp3vHjz9s15 for ; Fri, 25 May 2018 18:24:22 +1000 (AEST) Received: from localhost ([::1]:42407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM81L-00066y-RC for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:24:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vf-0001mi-3u for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vY-0008Fm-KW for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:27 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:50317) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vY-0008Ew-BZ for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:20 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LheU5-1g8ACb0U9B-00mq1U; Fri, 25 May 2018 10:18:12 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:48 +0200 Message-Id: <20180525081754.29506-8-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:eSI5Dqk5FpC0VNUcST5L0u8NwlwN2tWGwmm7BiWJJFzU72nenAL z6lwKgsynCVRJukZpFOr9BTgnVl31ivmDch8XKEwwP37bclfBThrPEJNb34V3RC/6GD5ZE2 AwLZ21Nmb/TrAVRHNdaCG3D/lHXQsGa7yEli4VpKtSqVGDpO8WRLYQyHfvV0lEd2LOVw02Q vn9bibcWVBPRwydcrz+TA== X-UI-Out-Filterresults: notjunk:1; V01:K0:UN/zgm7tczc=:3xrj1nc5I3toVXKokW+GZg QpWNviNpEgkAjURX0XjirT6xr05MW9qUYe+q6XL4CK1lVynGf1cMLelreKV/vcvia2r5lRRY+ l1YVPIeuw9wjM4xwXhO2EJxlVsZmWogqcSIKtQJuclxdkOl1Z3nxOjLyLH17DT//bbnFAKHu5 5MTdhHodUD837GaC3Eq9HKEsE4xEe9/2he7+8ib/jsSpZu676Ywq97APiQQVPFW8DvZMwCXex TKAyrgNm+y4vM95RSvW3SOZv9UO1D8uDPWqfQ4iqc9PPXWVFO8kgUEv9u5L/Ap7tuufS2l0tq Qfg/qrCWEn1MMdz9VyEFyzwwPdt//oMC68qiQWnXrTLI6DDyjlHJAi0z1FNqyYsmh+1w6HR/Q a7B48cVDlzR8/3zlf285BIsXDs/IB9ZX5IjvAHCkXKQe7LSnjmcKIlO6otshKfFo05QrDRlBh OJ8tDdBkgcBzdr7UsH2Vp81HzZhsO6u18joVJlL1fiuQ5qZBUkPCqYSpnrIRsNZqkBOZlgEKq eZz56FxY2QXtbPyrbimdSD3DzHJ2hGnSy75uGqQqtLm+2Bi2J8Aso0l97Dmc7QiF/35078MV9 SFpMxoTllzErTi5hCyBexj5Wi9a71cslkJEf8xw/BTME2n0p6ujA0QvkvXLhqWl7CzfECMHXq 00YMXgHpCMyZ37DslVzsTZn3rkeJn2cR5xRqHAm6x/JDBLLZc2e7CQPNhqlO16QsU+JpfM3bi 1DlKwTswtJHZadsS X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.13 Subject: [Qemu-devel] [PULL 07/13] linux-user: move sparc/sparc64 socket.h definitions to sparc/sockbits.h 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180519092956.15134-4-laurent@vivier.eu> --- linux-user/socket.h | 44 +------------------- linux-user/sparc/sockbits.h | 94 +++++++++++++++++++++++++++++++++++++++++++ linux-user/sparc64/sockbits.h | 1 + 3 files changed, 97 insertions(+), 42 deletions(-) create mode 100644 linux-user/sparc/sockbits.h create mode 100644 linux-user/sparc64/sockbits.h diff --git a/linux-user/socket.h b/linux-user/socket.h index 1328906205..8eb62ea3f2 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,49 +1,9 @@ -#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) +#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) || \ + defined(TARGET_SPARC) #include "sockbits.h" -#else - -#if defined(TARGET_SPARC) - /** sock_type - Socket types - * - * Please notice that for binary compat reasons SPARC has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. - */ - - #define ARCH_HAS_SOCKET_TYPES 1 - - enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 020000000, - TARGET_SOCK_NONBLOCK = 040000, - }; - - #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) - #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ - - #define TARGET_SO_PASSSEC 31 #else #define TARGET_SO_PASSSEC 34 -#endif /* For setsockopt(2) */ #define TARGET_SOL_SOCKET 1 diff --git a/linux-user/sparc/sockbits.h b/linux-user/sparc/sockbits.h new file mode 100644 index 0000000000..385061c8b0 --- /dev/null +++ b/linux-user/sparc/sockbits.h @@ -0,0 +1,94 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef SPARC_SOCKBITS_H +#define SPARC_SOCKBITS_H + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons SPARC has to + * override the enum sock_type in include/linux/net.h, so + * we define ARCH_HAS_SOCKET_TYPES here. + * + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_STREAM - stream (connection) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + * For writing rarp and other similar things on the user + * level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ + +#define ARCH_HAS_SOCKET_TYPES 1 + +enum sock_type { + TARGET_SOCK_STREAM = 1, + TARGET_SOCK_DGRAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP = 6, + TARGET_SOCK_PACKET = 10, + TARGET_SOCK_CLOEXEC = 020000000, + TARGET_SOCK_NONBLOCK = 040000, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ + +#define TARGET_SO_PASSSEC 31 + +/* For setsockopt(2) */ +#define TARGET_SOL_SOCKET 1 + +#define TARGET_SO_DEBUG 1 +#define TARGET_SO_REUSEADDR 2 +#define TARGET_SO_TYPE 3 +#define TARGET_SO_ERROR 4 +#define TARGET_SO_DONTROUTE 5 +#define TARGET_SO_BROADCAST 6 +#define TARGET_SO_SNDBUF 7 +#define TARGET_SO_RCVBUF 8 +#define TARGET_SO_SNDBUFFORCE 32 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_KEEPALIVE 9 +#define TARGET_SO_OOBINLINE 10 +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_LINGER 13 +#define TARGET_SO_BSDCOMPAT 14 +/* To add :#define TARGET_SO_REUSEPORT 15 */ +#define TARGET_SO_PASSCRED 16 +#define TARGET_SO_PEERCRED 17 +#define TARGET_SO_RCVLOWAT 18 +#define TARGET_SO_SNDLOWAT 19 +#define TARGET_SO_RCVTIMEO 20 +#define TARGET_SO_SNDTIMEO 21 + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 22 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER 26 +#define TARGET_SO_DETACH_FILTER 27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP 29 +#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP + +#define TARGET_SO_ACCEPTCONN 30 + +#define TARGET_SO_PEERSEC 31 +#endif diff --git a/linux-user/sparc64/sockbits.h b/linux-user/sparc64/sockbits.h new file mode 100644 index 0000000000..658899e4d3 --- /dev/null +++ b/linux-user/sparc64/sockbits.h @@ -0,0 +1 @@ +#include "../sparc/sockbits.h" From patchwork Fri May 25 08:17:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfX255TBz9s15 for ; Fri, 25 May 2018 18:28:02 +1000 (AEST) Received: from localhost ([::1]:42429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM84u-0000nB-7x for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:28:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7ve-0001mG-1D for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Gu-Jv for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50271) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Fc-AN for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:21 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LxfAZ-1gRLkV2TAh-017FFm; Fri, 25 May 2018 10:18:12 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:49 +0200 Message-Id: <20180525081754.29506-9-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:IfOe7ZztufPjDQHffaLm35XUTpoxwNuxxLJjMtN/c9Ur2IVEuTD i7TOKfHStCnzFiNn+mgfh8kn01q7EwDB5YzQ6YJE1xBf4zwbb8lQfawsyjI14j0kBogV858 A6dSgkVYL1gYwjoeDwYd2+vpnPC5l629jRrA4fqkg3FmgMbZeDdivXjvF2JaEwBCOW1yK9A S/f0YiKh133qbGXqX3hYQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:UzkeQaUSzXM=:HrqHC2C6twN959e/vgTvOb zVedEd4Duejdf/MIz90TUiEilqsxb45s22CQlny+1nzzmNBHi2UJtEHgpU9OqEMFbCwSzuNj0 S9UmPzPHkg+D8KhY0bqDHvR7fEzynbREN0toSQi5BnkGxkCrq9+p6R7QkbjQbDIuiFrkCpt0O zoVpk/tPHm+9jbwFhRN01B1Jv5frDi6kPTVhvnnAtp4bxTFmednb1bjjffvnJ3qkgjomyS+FX feWhsDb2+psp7jtKfsLebTbcov6D2t+g978/ZjrcTp+q66N9JEa07aIC0hCc/pIXz9BYTdR1J +LCN/L1TP/T3Vj+FspZiioaHnzkyifnrrBDAlcGazFEhcY2Y0C5OW4bGl/+KMBtfQhTQY4osz 6YqGDQ9iQ7c6UvnKwfFmvym6K52olzmLxxWHRKcEEohabgslhCAx8hLpA8gKySYJ7i3YM0dVr 2uaradECNy004i51w5rcW6czGgv7GQYFOEgyNP/p9FRc72S0/qUW71aVdjH0gDa2tSwOvkkhX /kIad0pNGc7n1v+T4eIXLmT7oQ9yESl7wlqGmVMaQPHNiDBmDzDqnXtNDXFFDJChXUkj1klp/ xCeuQOM3oxxPqW9gmiAqsLRDVrujsXj1R8WxgSNnxgIHfvpTnMl9XpHgO5wSpsqe8sY0qttSB mZnwJng/3Gv/yNt+YQ7adjsQwKgQBmE7cBH4FL5x8UahJDEMPmgmJlyjcpCSnYYctdAA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 08/13] linux-user: move socket.h generic definitions to generic/sockbits.h 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" and include the file from architectures without specific definitions Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Message-Id: <20180519092956.15134-5-laurent@vivier.eu> --- linux-user/aarch64/sockbits.h | 1 + linux-user/arm/sockbits.h | 1 + linux-user/cris/sockbits.h | 1 + linux-user/generic/sockbits.h | 67 ++++++++++++++++++++++++++++++++++++++++ linux-user/i386/sockbits.h | 1 + linux-user/m68k/sockbits.h | 1 + linux-user/microblaze/sockbits.h | 1 + linux-user/nios2/sockbits.h | 1 + linux-user/openrisc/sockbits.h | 1 + linux-user/ppc/sockbits.h | 1 + linux-user/riscv/sockbits.h | 1 + linux-user/s390x/sockbits.h | 1 + linux-user/sh4/sockbits.h | 1 + linux-user/socket.h | 61 ------------------------------------ linux-user/tilegx/sockbits.h | 1 + linux-user/x86_64/sockbits.h | 1 + linux-user/xtensa/sockbits.h | 1 + 17 files changed, 82 insertions(+), 61 deletions(-) create mode 100644 linux-user/aarch64/sockbits.h create mode 100644 linux-user/arm/sockbits.h create mode 100644 linux-user/cris/sockbits.h create mode 100644 linux-user/generic/sockbits.h create mode 100644 linux-user/i386/sockbits.h create mode 100644 linux-user/m68k/sockbits.h create mode 100644 linux-user/microblaze/sockbits.h create mode 100644 linux-user/nios2/sockbits.h create mode 100644 linux-user/openrisc/sockbits.h create mode 100644 linux-user/ppc/sockbits.h create mode 100644 linux-user/riscv/sockbits.h create mode 100644 linux-user/s390x/sockbits.h create mode 100644 linux-user/sh4/sockbits.h create mode 100644 linux-user/tilegx/sockbits.h create mode 100644 linux-user/x86_64/sockbits.h create mode 100644 linux-user/xtensa/sockbits.h diff --git a/linux-user/aarch64/sockbits.h b/linux-user/aarch64/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/aarch64/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/arm/sockbits.h b/linux-user/arm/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/arm/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/cris/sockbits.h b/linux-user/cris/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/cris/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h new file mode 100644 index 0000000000..093faf0a48 --- /dev/null +++ b/linux-user/generic/sockbits.h @@ -0,0 +1,67 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef GENERIC_SOCKBITS_H +#define GENERIC_SOCKBITS_H + +#define TARGET_SO_PASSSEC 34 + +/* For setsockopt(2) */ +#define TARGET_SOL_SOCKET 1 + +#define TARGET_SO_DEBUG 1 +#define TARGET_SO_REUSEADDR 2 +#define TARGET_SO_TYPE 3 +#define TARGET_SO_ERROR 4 +#define TARGET_SO_DONTROUTE 5 +#define TARGET_SO_BROADCAST 6 +#define TARGET_SO_SNDBUF 7 +#define TARGET_SO_RCVBUF 8 +#define TARGET_SO_SNDBUFFORCE 32 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_KEEPALIVE 9 +#define TARGET_SO_OOBINLINE 10 +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_LINGER 13 +#define TARGET_SO_BSDCOMPAT 14 +/* To add :#define TARGET_SO_REUSEPORT 15 */ +#if defined(TARGET_PPC) +#define TARGET_SO_RCVLOWAT 16 +#define TARGET_SO_SNDLOWAT 17 +#define TARGET_SO_RCVTIMEO 18 +#define TARGET_SO_SNDTIMEO 19 +#define TARGET_SO_PASSCRED 20 +#define TARGET_SO_PEERCRED 21 +#else +#define TARGET_SO_PASSCRED 16 +#define TARGET_SO_PEERCRED 17 +#define TARGET_SO_RCVLOWAT 18 +#define TARGET_SO_SNDLOWAT 19 +#define TARGET_SO_RCVTIMEO 20 +#define TARGET_SO_SNDTIMEO 21 +#endif + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 22 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER 26 +#define TARGET_SO_DETACH_FILTER 27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP 29 +#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP + +#define TARGET_SO_ACCEPTCONN 30 + +#define TARGET_SO_PEERSEC 31 +#endif diff --git a/linux-user/i386/sockbits.h b/linux-user/i386/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/i386/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/m68k/sockbits.h b/linux-user/m68k/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/m68k/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/microblaze/sockbits.h b/linux-user/microblaze/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/microblaze/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/nios2/sockbits.h b/linux-user/nios2/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/nios2/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/openrisc/sockbits.h b/linux-user/openrisc/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/openrisc/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/ppc/sockbits.h b/linux-user/ppc/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/ppc/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/riscv/sockbits.h b/linux-user/riscv/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/riscv/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/s390x/sockbits.h b/linux-user/s390x/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/s390x/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/sh4/sockbits.h b/linux-user/sh4/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/sh4/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/socket.h b/linux-user/socket.h index 8eb62ea3f2..135f438bdf 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,66 +1,5 @@ -#if defined(TARGET_MIPS) || defined(TARGET_HPPA) || defined(TARGET_ALPHA) || \ - defined(TARGET_SPARC) #include "sockbits.h" -#else - #define TARGET_SO_PASSSEC 34 - - /* For setsockopt(2) */ - #define TARGET_SOL_SOCKET 1 - - #define TARGET_SO_DEBUG 1 - #define TARGET_SO_REUSEADDR 2 - #define TARGET_SO_TYPE 3 - #define TARGET_SO_ERROR 4 - #define TARGET_SO_DONTROUTE 5 - #define TARGET_SO_BROADCAST 6 - #define TARGET_SO_SNDBUF 7 - #define TARGET_SO_RCVBUF 8 - #define TARGET_SO_SNDBUFFORCE 32 - #define TARGET_SO_RCVBUFFORCE 33 - #define TARGET_SO_KEEPALIVE 9 - #define TARGET_SO_OOBINLINE 10 - #define TARGET_SO_NO_CHECK 11 - #define TARGET_SO_PRIORITY 12 - #define TARGET_SO_LINGER 13 - #define TARGET_SO_BSDCOMPAT 14 - /* To add :#define TARGET_SO_REUSEPORT 15 */ -#if defined(TARGET_PPC) - #define TARGET_SO_RCVLOWAT 16 - #define TARGET_SO_SNDLOWAT 17 - #define TARGET_SO_RCVTIMEO 18 - #define TARGET_SO_SNDTIMEO 19 - #define TARGET_SO_PASSCRED 20 - #define TARGET_SO_PEERCRED 21 -#else - #define TARGET_SO_PASSCRED 16 - #define TARGET_SO_PEERCRED 17 - #define TARGET_SO_RCVLOWAT 18 - #define TARGET_SO_SNDLOWAT 19 - #define TARGET_SO_RCVTIMEO 20 - #define TARGET_SO_SNDTIMEO 21 -#endif - - /* Security levels - as per NRL IPv6 - don't actually do anything */ - #define TARGET_SO_SECURITY_AUTHENTICATION 22 - #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 - #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 - - #define TARGET_SO_BINDTODEVICE 25 - - /* Socket filtering */ - #define TARGET_SO_ATTACH_FILTER 26 - #define TARGET_SO_DETACH_FILTER 27 - - #define TARGET_SO_PEERNAME 28 - #define TARGET_SO_TIMESTAMP 29 - #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP - - #define TARGET_SO_ACCEPTCONN 30 - - #define TARGET_SO_PEERSEC 31 - -#endif #ifndef ARCH_HAS_SOCKET_TYPES /** sock_type - Socket types - default values diff --git a/linux-user/tilegx/sockbits.h b/linux-user/tilegx/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/tilegx/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/x86_64/sockbits.h b/linux-user/x86_64/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/x86_64/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" diff --git a/linux-user/xtensa/sockbits.h b/linux-user/xtensa/sockbits.h new file mode 100644 index 0000000000..0e4c8f012d --- /dev/null +++ b/linux-user/xtensa/sockbits.h @@ -0,0 +1 @@ +#include "../generic/sockbits.h" From patchwork Fri May 25 08:17:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfL23cGCz9s1b for ; Fri, 25 May 2018 18:19:21 +1000 (AEST) Received: from localhost ([::1]:42377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7wS-0001n1-9n for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:19:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vd-0001kO-CA for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Gc-IE for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:25 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:52041) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Fa-9S for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:21 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0Lc8iD-1g2dt20hvh-00jWdk; Fri, 25 May 2018 10:18:13 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:50 +0200 Message-Id: <20180525081754.29506-10-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:NO5rS5lCxjppOeXCkMIvNa2GFmEUtCuE+g+ydCKrATAWIwkJ0I2 hdE06PjpBI9x2N+MzzAy4d+YFI70H0LQ7eaQkW9u7MEnroZ5l2yIHjhFEbiAAZE/LtQHpwi R2Y5Q6Tz+jc6xPkr3TxlNZfUAgszvkqgQHXDk1OAdctrvo5hxrmWD1wMtiDE9+SEJx4VW6I +4i2QMUyxmSbknDLHHu1A== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZUtZSqeur+k=:AQi6tDwf7W/1aFlwoec1Mm x6gMGaN7Z0rnAad1xcuQODQq6d9VhDiCJAUM6kBYpRzdhIXpBA0mMOljWhcVdD7Ju+XWkRPjk XtE88p1lwB3dVtxCv/AizMUmtrshJPJy7M5Whato59aih43nfKPBcft7A1wBoT/GipAON/Djm MpkQCwCsqLWgn1NQqXwMClvPrZR7eWh05yqU13LsYgZmp11aj2PMbJfEKI9MwjDIhS9g/pUyh +J7rXqUAEhVDHvwiUM+GNsKJLmqCvycJwI71uGyx6Xe7/fGceUJn/9SzJzMOJdKJaLTWUIfd+ K4AEulew0t/BU6UgTMNxSBd3ibz6ilsJcezy+9P9NY9SbnuCvqy0m3wuDWvQi1dGpj9d77HDj ETPEke2N3EB3vOCBExE7OdwW8rrvmI+xgawaOtL+BVjNSe9KMjbTrjzRrrgkMxIRdQg66BpJU ZpY1H+C4amNq7eK0Wgzt44SYBgliMMX7d//KZdYcn40rtRmxD7L23VhvI2oNSCeTqKBNSV30J PJGj57OgOSPkvlIm25Ukjmnm3vp7qNrjhHTPFVB1cEki/NGpml6MR17uXRGnjqyvtKjaETjKX KEXmZL59WP3hS7iPB3N3AaFqiETRVdeqaVpIeTTxFWUSLeQixb1KEdxx8S25mJozQu9rIM/0F K8kr1IOeAvYJ6nmmkrvKei1EfokwRQJRHoX0pANtsjERTJ0g3HRFx4tX4EPXIReBOpNs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.75 Subject: [Qemu-devel] [PULL 09/13] linux-user: move ppc socket.h definitions to ppc/sockbits.h 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Change conditional #ifdef part by #undef of the symbols redefined for PPC relative to generic/socket.h Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Message-Id: <20180519092956.15134-6-laurent@vivier.eu> --- linux-user/generic/sockbits.h | 9 --------- linux-user/ppc/sockbits.h | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index 093faf0a48..99505f1f85 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -30,21 +30,12 @@ #define TARGET_SO_LINGER 13 #define TARGET_SO_BSDCOMPAT 14 /* To add :#define TARGET_SO_REUSEPORT 15 */ -#if defined(TARGET_PPC) -#define TARGET_SO_RCVLOWAT 16 -#define TARGET_SO_SNDLOWAT 17 -#define TARGET_SO_RCVTIMEO 18 -#define TARGET_SO_SNDTIMEO 19 -#define TARGET_SO_PASSCRED 20 -#define TARGET_SO_PEERCRED 21 -#else #define TARGET_SO_PASSCRED 16 #define TARGET_SO_PEERCRED 17 #define TARGET_SO_RCVLOWAT 18 #define TARGET_SO_SNDLOWAT 19 #define TARGET_SO_RCVTIMEO 20 #define TARGET_SO_SNDTIMEO 21 -#endif /* Security levels - as per NRL IPv6 - don't actually do anything */ #define TARGET_SO_SECURITY_AUTHENTICATION 22 diff --git a/linux-user/ppc/sockbits.h b/linux-user/ppc/sockbits.h index 0e4c8f012d..ee453347a3 100644 --- a/linux-user/ppc/sockbits.h +++ b/linux-user/ppc/sockbits.h @@ -1 +1,26 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef PPC_SOCKBITS_H +#define PPC_SOCKBITS_H + #include "../generic/sockbits.h" + +#undef TARGET_SO_RCVLOWAT +#define TARGET_SO_RCVLOWAT 16 +#undef TARGET_SO_SNDLOWAT +#define TARGET_SO_SNDLOWAT 17 +#undef TARGET_SO_RCVTIMEO +#define TARGET_SO_RCVTIMEO 18 +#undef TARGET_SO_SNDTIMEO +#define TARGET_SO_SNDTIMEO 19 +#undef TARGET_SO_PASSCRED +#define TARGET_SO_PASSCRED 20 +#undef TARGET_SO_PEERCRED +#define TARGET_SO_PEERCRED 21 + +#endif From patchwork Fri May 25 08:17:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfL26tfyz9s1d for ; Fri, 25 May 2018 18:19:22 +1000 (AEST) Received: from localhost ([::1]:42379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7wW-0001qq-Di for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:19:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vf-0001mg-1u for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7va-0008IE-87 for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:37651) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vZ-0008Fw-UG for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:22 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LrKBQ-1gMee92bxU-0136n3; Fri, 25 May 2018 10:18:13 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:51 +0200 Message-Id: <20180525081754.29506-11-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:WHxRIOJ4SPJXt61GqK88bv/87wEOBjNMOYW85I/KDK4TWQlv8GS e2ISz7iNCYLpzfneEPuORv4VzxN6FoNpv6uvZS0pceDN+lhZAgqVkUTIuxuyAH5x1m85Y0u yFkne+HW5HSH8J4006xDrK5xTZVqdZL179/GqE0RbAmJftsufh3QZq34xVWraQuadsjZimX m61Gm+xiZtTj7OAtr7T7Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:19XrSAb5FiI=:CAMgQHi4/0EeQTDjEE+LWT o372CcicTnSMK+se4Ribh5XxHUY75ljFYZw6U/gZuqVBvnnzWKyGBhB+f3z8Lh2VBgY/q7CAk Fn6Nyr/ItAXaI5eDzoxeqyN1raZL87sKMN8kOsbALJc09i1IupFyxelupwONF9AWitWhtXccn Rsm6e7FU4CIx7/mAKgMrYl6t1A3liA6AjILDSpsKG4WNuDnAQdbWesnMo8IqZn5fn4gs/zIfk i5Xq9csXcPFgnFhphyx/QWDqzdxv3wQFwl4i8+awP7RCN2ZQ65aZEmhKGAMV/3DkxHprJ51EU Twnu+3YUbHfvcqbGfnrPqEU5k4LSiD9ctK1XagGVcVkQsz/emUgZ8PR91QJVY0ypbBvlIAlJt FARE0TrLhOQ9gni+l7L+gqXHRQmm1erdtsm5oitFI67pVpeaFWwsE6xzhGpJsi6UzeQ6QFAIf kaOIuxX7B3vBhx+NhhS1aoiYfXuexZTIC+6EUCgpkinDyUq/A0iMaGeGlFeut3JfiukduvVc5 zBR2E0v5ycrEEw18ZLXY/GD4I8f0j/96vwSH49rGJfnUF1e2j3SWM28c9AqIjElWTPYSQ8ten rVPJsLd62iQkb4HFLjNaCPDrzQkahS8SjtvQeG89TQTdH99qnPatq095E8reGBybix+jY/V28 UoF2dZssJETT+tESPbhVn0bdk0C4JcApMCHm1xpiMFQ8rBmsWFadxk9yrngzAOVQSb70= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PULL 10/13] linux-user: update ARCH_HAS_SOCKET_TYPES use 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" to be like in the kernel and rename it TARGET_ARCH_HAS_SOCKET_TYPES Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Message-Id: <20180519092956.15134-7-laurent@vivier.eu> --- linux-user/alpha/sockbits.h | 36 +++----------------------- linux-user/hppa/sockbits.h | 33 +++--------------------- linux-user/mips/sockbits.h | 9 ++++--- linux-user/socket.h | 62 +++++++++++++++++++++++---------------------- linux-user/sparc/sockbits.h | 36 -------------------------- 5 files changed, 44 insertions(+), 132 deletions(-) diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h index 4db3e52b67..f5397dd875 100644 --- a/linux-user/alpha/sockbits.h +++ b/linux-user/alpha/sockbits.h @@ -75,39 +75,9 @@ /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define TARGET_SO_NOFCS 43 -/** sock_type - Socket types - * - * Please notice that for binary compat reasons ALPHA has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. +/* TARGET_O_NONBLOCK clashes with the bits used for socket types. Therefore we + * have to define SOCK_NONBLOCK to a different value here. */ +#define TARGET_SOCK_NONBLOCK 0x40000000 -#define ARCH_HAS_SOCKET_TYPES 1 - -enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 010000000, - TARGET_SOCK_NONBLOCK = 010000000000, -}; - -#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) -#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ #endif diff --git a/linux-user/hppa/sockbits.h b/linux-user/hppa/sockbits.h index 5044619e16..2641aea859 100644 --- a/linux-user/hppa/sockbits.h +++ b/linux-user/hppa/sockbits.h @@ -64,34 +64,7 @@ #define TARGET_SO_CNX_ADVICE 0x402E -/** sock_type - Socket types - default values - * - * - * @SOCK_STREAM - stream (connection) socket - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. +/* TARGET_O_NONBLOCK clashes with the bits used for socket types. Therefore we + * have to define SOCK_NONBLOCK to a different value here. */ -enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 010000000, - TARGET_SOCK_NONBLOCK = 0x40000000, -}; - -#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) -#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ - -#define ARCH_HAS_SOCKET_TYPES 1 +#define TARGET_SOCK_NONBLOCK 0x40000000 diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 3fe5ac88e7..370d13ed86 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -91,7 +91,7 @@ * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. */ -#define ARCH_HAS_SOCKET_TYPES 1 +#define TARGET_ARCH_HAS_SOCKET_TYPES 1 enum sock_type { TARGET_SOCK_DGRAM = 1, @@ -101,10 +101,13 @@ enum sock_type { TARGET_SOCK_SEQPACKET = 5, TARGET_SOCK_DCCP = 6, TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 02000000, - TARGET_SOCK_NONBLOCK = 0200, }; #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ + +/* Flags for socket, socketpair, paccept */ +#define TARGET_SOCK_CLOEXEC TARGET_O_CLOEXEC +#define TARGET_SOCK_NONBLOCK TARGET_O_NONBLOCK + #endif diff --git a/linux-user/socket.h b/linux-user/socket.h index 135f438bdf..4c0b5c2dfa 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,35 +1,37 @@ - #include "sockbits.h" -#ifndef ARCH_HAS_SOCKET_TYPES - /** sock_type - Socket types - default values - * - * - * @SOCK_STREAM - stream (connection) socket - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. - */ - enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 02000000, - TARGET_SOCK_NONBLOCK = 04000, - }; +#ifndef TARGET_ARCH_HAS_SOCKET_TYPES +/** sock_type - Socket types - default values + * + * + * @SOCK_STREAM - stream (connection) socket + * @SOCK_DGRAM - datagram (conn.less) socket + * @SOCK_RAW - raw socket + * @SOCK_RDM - reliably-delivered message + * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_DCCP - Datagram Congestion Control Protocol socket + * @SOCK_PACKET - linux specific way of getting packets at the dev level. + * For writing rarp and other similar things on the user + * level. + * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. + * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. + */ +enum sock_type { + TARGET_SOCK_STREAM = 1, + TARGET_SOCK_DGRAM = 2, + TARGET_SOCK_RAW = 3, + TARGET_SOCK_RDM = 4, + TARGET_SOCK_SEQPACKET = 5, + TARGET_SOCK_DCCP = 6, + TARGET_SOCK_PACKET = 10, +}; - #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) - #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ +/* Flags for socket, socketpair, accept4 */ +#define TARGET_SOCK_CLOEXEC TARGET_O_CLOEXEC +#ifndef TARGET_SOCK_NONBLOCK +#define TARGET_SOCK_NONBLOCK TARGET_O_NONBLOCK #endif +#endif /* TARGET_ARCH_HAS_SOCKET_TYPES */ diff --git a/linux-user/sparc/sockbits.h b/linux-user/sparc/sockbits.h index 385061c8b0..6434b07033 100644 --- a/linux-user/sparc/sockbits.h +++ b/linux-user/sparc/sockbits.h @@ -8,42 +8,6 @@ #ifndef SPARC_SOCKBITS_H #define SPARC_SOCKBITS_H -/** sock_type - Socket types - * - * Please notice that for binary compat reasons SPARC has to - * override the enum sock_type in include/linux/net.h, so - * we define ARCH_HAS_SOCKET_TYPES here. - * - * @SOCK_DGRAM - datagram (conn.less) socket - * @SOCK_STREAM - stream (connection) socket - * @SOCK_RAW - raw socket - * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket - * @SOCK_DCCP - Datagram Congestion Control Protocol socket - * @SOCK_PACKET - linux specific way of getting packets at the dev level. - * For writing rarp and other similar things on the user - * level. - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag. - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag. - */ - -#define ARCH_HAS_SOCKET_TYPES 1 - -enum sock_type { - TARGET_SOCK_STREAM = 1, - TARGET_SOCK_DGRAM = 2, - TARGET_SOCK_RAW = 3, - TARGET_SOCK_RDM = 4, - TARGET_SOCK_SEQPACKET = 5, - TARGET_SOCK_DCCP = 6, - TARGET_SOCK_PACKET = 10, - TARGET_SOCK_CLOEXEC = 020000000, - TARGET_SOCK_NONBLOCK = 040000, -}; - -#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) -#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ - #define TARGET_SO_PASSSEC 31 /* For setsockopt(2) */ From patchwork Fri May 25 08:17:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfYQ0Qptz9s15 for ; Fri, 25 May 2018 18:29:14 +1000 (AEST) Received: from localhost ([::1]:42434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM863-0001SJ-Pj for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:29:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vf-0001mh-2P for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vb-0008JE-L3 for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:27 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:35989) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7vb-0008IO-BO for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:23 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LcPxe-1g2Mdc0nOI-00jnUR; Fri, 25 May 2018 10:18:14 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:52 +0200 Message-Id: <20180525081754.29506-12-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> X-Provags-ID: V03:K1:gr3YWdH8AZ7SiBRR/CQBSMV6/i2BH72Uvsn5wc3hAs2qxALkCH+ uBgjUBvhfad1L2VM2bfzLbfoSI29TOcEJZhpSXnOSv6EX+9vnp34lz4TbsoHVNCUhQT3UkY hvnX+HZeTrBQVGmP+qFOnyz8kk2G7E4Ftqr+JdOD9yCe3u/qA5wvKhqn49H3O8UY8qZgD8E okh4ln2jzNM60u9+1TjTw== X-UI-Out-Filterresults: notjunk:1; V01:K0:SGvulhCWCmA=:5kjt5tJQv5PYy2lt6kRsaa RkyJf4P5LwVZyhg82b1G+RMe9eM6ZgrarhVrFR1tOVTnMfGgEvvcURyE6kllpmYZdtAYbFMjd 8FAQ7NehQoKAMI+j3R4QeqhYpWEaw5l622Mn0E2tPnuR0mK2J61BialG7x6oTyXul1PT4xJ85 EFaFgV2EAFn2yppgpHpvBtaxIUAVJJMDBLBqYH6TiZSIRHSpzeOaOnmSv1DOUSKieaSf6pQrd mPr3eqobGxRpNBBPw2kOUNhlSjz2YRV2cjR4LdFQaHaJckreXuZhOruO2zBCRuHxMQLSmvT7p 0Qo91D7ndilydD/9wMzGXL7a417+kYiFsrqu04amfdVjaxn2RGL31re8OGzIg0fA+fJjQwR87 SM5QdprRbeV9gt/UTu5LVmO891ivLQuIdkEwMQnHYs0SWk0zf5vdxWa/+Ut9mysL8CorvxUaQ xX1G8s/j3InyHIRE/Duy1HYOdHX9+NWD+uhksU/kKm8XYPEy9mGVywcD7VYOuAPyaxivvr3U1 bC5txg2GM5GFSQsydMbVfHZLjcQ5FNoBZp3R4cQdDwbHf97Wa8aoUHUgzT6NUklypWwgqCGkR lzChWXJy78T7Rhj6nRGKj4yGoeLu5jccs6ptqR3hJncRbRLUMTRCTFErlpioCz7oJ6ped81RL 5N1BgkvKkoR9wh5WEgjiHgrhgiHfZMz6HqOI8/opTfMNLFLdhfimRycUnOZtURcD0WZo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PULL 11/13] linux-user: copy sparc/sockbits.h definitions from linux 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Values defined for sparc are not correct. Copy the content of "arch/sparc/include/uapi/asm/socket.h" to fix them. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Message-Id: <20180519092956.15134-8-laurent@vivier.eu> --- linux-user/sparc/sockbits.h | 131 +++++++++++++++++++++++++++++++------------- 1 file changed, 92 insertions(+), 39 deletions(-) diff --git a/linux-user/sparc/sockbits.h b/linux-user/sparc/sockbits.h index 6434b07033..0a822e3e1f 100644 --- a/linux-user/sparc/sockbits.h +++ b/linux-user/sparc/sockbits.h @@ -8,51 +8,104 @@ #ifndef SPARC_SOCKBITS_H #define SPARC_SOCKBITS_H -#define TARGET_SO_PASSSEC 31 - /* For setsockopt(2) */ -#define TARGET_SOL_SOCKET 1 - -#define TARGET_SO_DEBUG 1 -#define TARGET_SO_REUSEADDR 2 -#define TARGET_SO_TYPE 3 -#define TARGET_SO_ERROR 4 -#define TARGET_SO_DONTROUTE 5 -#define TARGET_SO_BROADCAST 6 -#define TARGET_SO_SNDBUF 7 -#define TARGET_SO_RCVBUF 8 -#define TARGET_SO_SNDBUFFORCE 32 -#define TARGET_SO_RCVBUFFORCE 33 -#define TARGET_SO_KEEPALIVE 9 -#define TARGET_SO_OOBINLINE 10 -#define TARGET_SO_NO_CHECK 11 -#define TARGET_SO_PRIORITY 12 -#define TARGET_SO_LINGER 13 -#define TARGET_SO_BSDCOMPAT 14 -/* To add :#define TARGET_SO_REUSEPORT 15 */ -#define TARGET_SO_PASSCRED 16 -#define TARGET_SO_PEERCRED 17 -#define TARGET_SO_RCVLOWAT 18 -#define TARGET_SO_SNDLOWAT 19 -#define TARGET_SO_RCVTIMEO 20 -#define TARGET_SO_SNDTIMEO 21 +#define TARGET_SOL_SOCKET 0xffff -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define TARGET_SO_SECURITY_AUTHENTICATION 22 -#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 -#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 +#define TARGET_SO_DEBUG 0x0001 +#define TARGET_SO_PASSCRED 0x0002 +#define TARGET_SO_REUSEADDR 0x0004 +#define TARGET_SO_KEEPALIVE 0x0008 +#define TARGET_SO_DONTROUTE 0x0010 +#define TARGET_SO_BROADCAST 0x0020 +#define TARGET_SO_PEERCRED 0x0040 +#define TARGET_SO_LINGER 0x0080 +#define TARGET_SO_OOBINLINE 0x0100 +#define TARGET_SO_REUSEPORT 0x0200 +#define TARGET_SO_BSDCOMPAT 0x0400 +#define TARGET_SO_RCVLOWAT 0x0800 +#define TARGET_SO_SNDLOWAT 0x1000 +#define TARGET_SO_RCVTIMEO 0x2000 +#define TARGET_SO_SNDTIMEO 0x4000 +#define TARGET_SO_ACCEPTCONN 0x8000 + +#define TARGET_SO_SNDBUF 0x1001 +#define TARGET_SO_RCVBUF 0x1002 +#define TARGET_SO_SNDBUFFORCE 0x100a +#define TARGET_SO_RCVBUFFORCE 0x100b +#define TARGET_SO_ERROR 0x1007 +#define TARGET_SO_TYPE 0x1008 +#define TARGET_SO_PROTOCOL 0x1028 +#define TARGET_SO_DOMAIN 0x1029 + +/* Linux specific, keep the same. */ +#define TARGET_SO_NO_CHECK 0x000b +#define TARGET_SO_PRIORITY 0x000c -#define TARGET_SO_BINDTODEVICE 25 +#define TARGET_SO_BINDTODEVICE 0x000d -/* Socket filtering */ -#define TARGET_SO_ATTACH_FILTER 26 -#define TARGET_SO_DETACH_FILTER 27 +#define TARGET_SO_ATTACH_FILTER 0x001a +#define TARGET_SO_DETACH_FILTER 0x001b +#define TARGET_SO_GET_FILTER TARGET_SO_ATTACH_FILTER -#define TARGET_SO_PEERNAME 28 -#define TARGET_SO_TIMESTAMP 29 +#define TARGET_SO_PEERNAME 0x001c +#define TARGET_SO_TIMESTAMP 0x001d #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP -#define TARGET_SO_ACCEPTCONN 30 +#define TARGET_SO_PEERSEC 0x001e +#define TARGET_SO_PASSSEC 0x001f +#define TARGET_SO_TIMESTAMPNS 0x0021 +#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS + +#define TARGET_SO_MARK 0x0022 + +#define TARGET_SO_TIMESTAMPING 0x0023 +#define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING + +#define TARGET_SO_RXQ_OVFL 0x0024 + +#define TARGET_SO_WIFI_STATUS 0x0025 +#define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS +#define TARGET_SO_PEEK_OFF 0x0026 + +/* Instruct lower device to use last 4-bytes of skb data as FCS */ +#define TARGET_SO_NOFCS 0x0027 + +#define TARGET_SO_LOCK_FILTER 0x0028 + +#define TARGET_SO_SELECT_ERR_QUEUE 0x0029 + +#define TARGET_SO_BUSY_POLL 0x0030 + +#define TARGET_SO_MAX_PACING_RATE 0x0031 -#define TARGET_SO_PEERSEC 31 +#define TARGET_SO_BPF_EXTENSIONS 0x0032 + +#define TARGET_SO_INCOMING_CPU 0x0033 + +#define TARGET_SO_ATTACH_BPF 0x0034 +#define TARGET_SO_DETACH_BPF TARGET_SO_DETACH_FILTER + +#define TARGET_SO_ATTACH_REUSEPORT_CBPF 0x0035 +#define TARGET_SO_ATTACH_REUSEPORT_EBPF 0x0036 + +#define TARGET_SO_CNX_ADVICE 0x0037 + +#define TARGET_SCM_TIMESTAMPING_OPT_STATS 0x0038 + +#define TARGET_SO_MEMINFO 0x0039 + +#define TARGET_SO_INCOMING_NAPI_ID 0x003a + +#define TARGET_SO_COOKIE 0x003b + +#define TARGET_SCM_TIMESTAMPING_PKTINFO 0x003c + +#define TARGET_SO_PEERGROUPS 0x003d + +#define TARGET_SO_ZEROCOPY 0x003e + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 0x5001 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 0x5004 #endif From patchwork Fri May 25 08:17:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 920296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40sfRl0M8lz9s15 for ; Fri, 25 May 2018 18:24:19 +1000 (AEST) Received: from localhost ([::1]:42405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM81I-00064c-Mj for incoming@patchwork.ozlabs.org; Fri, 25 May 2018 04:24:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fM7vd-0001lS-Kw for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7vb-0008If-3h for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:25 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:43565) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fM7va-0008He-Qh for qemu-devel@nongnu.org; Fri, 25 May 2018 04:18:23 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LlFeI-1ftWvw2s7C-00b231; Fri, 25 May 2018 10:18:14 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 25 May 2018 10:17:53 +0200 Message-Id: <20180525081754.29506-13-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525081754.29506-1-laurent@vivier.eu> References: <20180525081754.29506-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:jtDcvMi80y5X71d4NHsdqS6QRin59eaI4KQg5VS+jq0JJmkQLQB 2BgCuYwHplXspXE2KrPZEHpBaNisPtplCs1EGe3FubMZxbRNkrOLMBmJyX90WMSQxaZqrdZ Q3TOv1Y0PjmG/MAUXr7VNdwbJBQh+dp8ETXOAoe/AwXpwQj/m0OjwJ4H126/GRFW0t4C7OU LRQqdUwMErtto5AoFsjbQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:PTWKTOKyEt8=:Ar+X5BLaCSntevl/cY6q5A JwxnLHR6B2cYotlzvSIWGC20zzNWZEjvGMynFi2OrHU23DoIQMbQIFq6X+cn0+hGQBY6JPf8m udqGqGRKDsMTUmk6Xc6Aqj3ht9BuKhuhe3qExQixxGfB3ftTpOCYn/xWLU/5hyORNcmgZGHaA 8awnZl/Q1tAzP/BvssxHBnzLr1Chz/G9o8F1M+6OIUhEODkufmmbzg7bHDtH8JIn3zOBoAIgv d7EXIl9CrmVWgsb9LqRoKJWILMsGTE0nzfZYeWdFUdODT5VgrVwJvOYFQTZNcw5sHyHrEF5aR V94oNEczys+vZTrv42iHXMIU3CDB9zSD7hlIQ7tY6f8f2yE5f+E1hpmvdEFl1XOs3H6w4mcs1 fkpCgbE/jes63iW7pTy9X5m0mkKhMzSxI7uPZhfJbj34/6dhs8v0j+faTF72y2AtTFYEmkXt/ 0aAeLVb48KMqvCr6ieEKO2/As9b7lwQtl6jZ2LYF9h7xPO+1PSVOEPzZPmUX9lLzYk1gfTwKP xMyCDPvKNy2Bncdns8w1MT9fZPv4Hjm40S6VSNey7UVk4ofIIvzjtUPz/AAR9/6EIUm0EzV2Q IJGwv9i2UOV0VcJ+YQBZB+7t2mqpXaizKndxH+Jnm+gylUW5azl8A8arUoaQMa49K31cVyYsu nKA0/tpNHCZl8GNKjhl0JwzNd9yy1AgLUdNf5KdKDUA3r60BHRR9EE+StUSGjjJzBCUkxtNB7 y6p6bB8DJKGzXNUR X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.13 Subject: [Qemu-devel] [PULL 12/13] linux-user: define TARGET_SO_REUSEPORT 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180519092956.15134-9-laurent@vivier.eu> --- linux-user/alpha/sockbits.h | 2 +- linux-user/generic/sockbits.h | 2 +- linux-user/mips/sockbits.h | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h index f5397dd875..d54dc98c09 100644 --- a/linux-user/alpha/sockbits.h +++ b/linux-user/alpha/sockbits.h @@ -18,7 +18,7 @@ #define TARGET_SO_BROADCAST 0x0020 #define TARGET_SO_LINGER 0x0080 #define TARGET_SO_OOBINLINE 0x0100 -/* To add :#define TARGET_SO_REUSEPORT 0x0200 */ +#define TARGET_SO_REUSEPORT 0x0200 #define TARGET_SO_TYPE 0x1008 #define TARGET_SO_ERROR 0x1007 diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index 99505f1f85..e44733c601 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -29,7 +29,7 @@ #define TARGET_SO_PRIORITY 12 #define TARGET_SO_LINGER 13 #define TARGET_SO_BSDCOMPAT 14 -/* To add :#define TARGET_SO_REUSEPORT 15 */ +#define TARGET_SO_REUSEPORT 15 #define TARGET_SO_PASSCRED 16 #define TARGET_SO_PEERCRED 17 #define TARGET_SO_RCVLOWAT 18 diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 370d13ed86..0f022cd598 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -28,10 +28,7 @@ */ #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */ -#if 0 -/* To add: Allow local address and port reuse. */ #define TARGET_SO_REUSEPORT 0x0200 -#endif #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ #define TARGET_SO_STYLE SO_TYPE /* Synonym */