Skip to contentSkip to conversation

linux-user: refactor socket.h into architecture specific sockbits

Qemu-devel In review Carlo Marcelo Arenas Belón 3 participants 15 messages Sep 25, 2017 – Oct 20, 2017

lore
Share & tools
lore
#0 lore raw

the definitions in socket.h are meant to reflect the ones in linux for each respective target, but are sometimes difficult to maintain.

hppa (AKA parisc) was initially merged with an independent file that mirrors more closely the corresponding one in linux but hasn't been updated since.

this series updates hppa with the latest bits from linux 4.14 and makes sure all relevant architectures had a sockbits file that would be easy to maintain going forward.

most of the changes are pretty mechanical and I had made (thanks to Laurent's tough review) every effort to ensure no value gets changed accidentaly and all changes (even the ones where the value remains but is now in a different base to better match what was used in the linux headers) are documented, so it should be fairly safe and will fix bugs (mostly for sparc).

#1 lore raw

PATCH v2 1/6 linux-user: update hppa sockbits

updated to match arch/parisc/include/uapi/asm/socket.h from linux 4.14 include in socket.h changed to prefer a local path like all other qemu headers and for consistency and clarity when adding all other arch

---
 linux-user/hppa/sockbits.h | 148 +++++++++++++++++++++++----------------------
 linux-user/socket.h        |   2 +-
 2 files changed, 78 insertions(+), 72 deletions(-)
linux-user/hppa/sockbits.h +77 -71
index 5044619e16..3dab31a76a 100644
@@ -1,71 +1,77 @@
-#define TARGET_SOL_SOCKET      0xffff
+#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
-#define TARGET_SO_REUSEPORT    0x0200
-#define TARGET_SO_SNDBUF       0x1001
-#define TARGET_SO_RCVBUF       0x1002
-#define TARGET_SO_SNDBUFFORCE  0x100a
-#define TARGET_SO_RCVBUFFORCE  0x100b
-#define TARGET_SO_SNDLOWAT     0x1003
-#define TARGET_SO_RCVLOWAT     0x1004
-#define TARGET_SO_SNDTIMEO     0x1005
-#define TARGET_SO_RCVTIMEO     0x1006
-#define TARGET_SO_ERROR        0x1007
-#define TARGET_SO_TYPE         0x1008
-#define TARGET_SO_PROTOCOL     0x1028
-#define TARGET_SO_DOMAIN       0x1029
-#define TARGET_SO_PEERNAME     0x2000
-#define TARGET_SO_NO_CHECK     0x400b
-#define TARGET_SO_PRIORITY     0x400c
-#define TARGET_SO_BSDCOMPAT    0x400e
-#define TARGET_SO_PASSCRED     0x4010
-#define TARGET_SO_PEERCRED     0x4011
-#define TARGET_SO_TIMESTAMP    0x4012
-#define TARGET_SCM_TIMESTAMP   TARGET_SO_TIMESTAMP
-#define TARGET_SO_TIMESTAMPNS  0x4013
-#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS
+#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
+#define TARGET_SO_REUSEPORT                     0x0200
+#define TARGET_SO_SNDBUF                        0x1001
+#define TARGET_SO_RCVBUF                        0x1002
+#define TARGET_SO_SNDBUFFORCE                   0x100a
+#define TARGET_SO_RCVBUFFORCE                   0x100b
+#define TARGET_SO_SNDLOWAT                      0x1003
+#define TARGET_SO_RCVLOWAT                      0x1004
+#define TARGET_SO_SNDTIMEO                      0x1005
+#define TARGET_SO_RCVTIMEO                      0x1006
+#define TARGET_SO_ERROR                         0x1007
+#define TARGET_SO_TYPE                          0x1008
+#define TARGET_SO_PROTOCOL                      0x1028
+#define TARGET_SO_DOMAIN                        0x1029
+#define TARGET_SO_PEERNAME                      0x2000
+#define TARGET_SO_NO_CHECK                      0x400b
+#define TARGET_SO_PRIORITY                      0x400c
+#define TARGET_SO_BSDCOMPAT                     0x400e
+#define TARGET_SO_PASSCRED                      0x4010
+#define TARGET_SO_PEERCRED                      0x4011
+#define TARGET_SO_TIMESTAMP                     0x4012
+#define TARGET_SCM_TIMESTAMP                    TARGET_SO_TIMESTAMP
+#define TARGET_SO_TIMESTAMPNS                   0x4013
+#define TARGET_SCM_TIMESTAMPNS                  TARGET_SO_TIMESTAMPNS
 
-#define TARGET_SO_SECURITY_AUTHENTICATION              0x4016
-#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT        0x4017
-#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK          0x4018
+#define TARGET_SO_SECURITY_AUTHENTICATION       0x4016
+#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 0x4017
+#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK   0x4018
 
-#define TARGET_SO_BINDTODEVICE         0x4019
-#define TARGET_SO_ATTACH_FILTER        0x401a
-#define TARGET_SO_DETACH_FILTER        0x401b
-#define TARGET_SO_GET_FILTER           TARGET_SO_ATTACH_FILTER
-#define TARGET_SO_ACCEPTCONN           0x401c
-#define TARGET_SO_PEERSEC              0x401d
-#define TARGET_SO_PASSSEC              0x401e
-#define TARGET_SO_MARK                 0x401f
-#define TARGET_SO_TIMESTAMPING         0x4020
-#define TARGET_SCM_TIMESTAMPING        TARGET_SO_TIMESTAMPING
-#define TARGET_SO_RXQ_OVFL             0x4021
-#define TARGET_SO_WIFI_STATUS          0x4022
-#define TARGET_SCM_WIFI_STATUS         TARGET_SO_WIFI_STATUS
-#define TARGET_SO_PEEK_OFF             0x4023
-#define TARGET_SO_NOFCS                0x4024
-#define TARGET_SO_LOCK_FILTER          0x4025
-#define TARGET_SO_SELECT_ERR_QUEUE     0x4026
-#define TARGET_SO_BUSY_POLL            0x4027
-#define TARGET_SO_MAX_PACING_RATE      0x4028
-#define TARGET_SO_BPF_EXTENSIONS       0x4029
-#define TARGET_SO_INCOMING_CPU         0x402A
-#define TARGET_SO_ATTACH_BPF           0x402B
-#define TARGET_SO_DETACH_BPF           TARGET_SO_DETACH_FILTER
+#define TARGET_SO_BINDTODEVICE                  0x4019
+#define TARGET_SO_ATTACH_FILTER                 0x401a
+#define TARGET_SO_DETACH_FILTER                 0x401b
+#define TARGET_SO_GET_FILTER                    TARGET_SO_ATTACH_FILTER
+#define TARGET_SO_ACCEPTCONN                    0x401c
+#define TARGET_SO_PEERSEC                       0x401d
+#define TARGET_SO_PASSSEC                       0x401e
+#define TARGET_SO_MARK                          0x401f
+#define TARGET_SO_TIMESTAMPING                  0x4020
+#define TARGET_SCM_TIMESTAMPING                 TARGET_SO_TIMESTAMPING
+#define TARGET_SO_RXQ_OVFL                      0x4021
+#define TARGET_SO_WIFI_STATUS                   0x4022
+#define TARGET_SCM_WIFI_STATUS                  TARGET_SO_WIFI_STATUS
+#define TARGET_SO_PEEK_OFF                      0x4023
+#define TARGET_SO_NOFCS                         0x4024
+#define TARGET_SO_LOCK_FILTER                   0x4025
+#define TARGET_SO_SELECT_ERR_QUEUE              0x4026
+#define TARGET_SO_BUSY_POLL                     0x4027
+#define TARGET_SO_MAX_PACING_RATE               0x4028
+#define TARGET_SO_BPF_EXTENSIONS                0x4029
+#define TARGET_SO_INCOMING_CPU                  0x402A
+#define TARGET_SO_ATTACH_BPF                    0x402B
+#define TARGET_SO_DETACH_BPF                    TARGET_SO_DETACH_FILTER
 
-#define TARGET_SO_ATTACH_REUSEPORT_CBPF        0x402C
-#define TARGET_SO_ATTACH_REUSEPORT_EBPF        0x402D
+#define TARGET_SO_ATTACH_REUSEPORT_CBPF         0x402C
+#define TARGET_SO_ATTACH_REUSEPORT_EBPF         0x402D
 
-#define TARGET_SO_CNX_ADVICE           0x402E
+#define TARGET_SO_CNX_ADVICE                    0x402E
+#define TARGET_SCM_TIMESTAMPING_OPT_STATS       0x402F
+#define TARGET_SO_MEMINFO                       0x4030
+#define TARGET_SO_INCOMING_NAPI_ID              0x4031
+#define TARGET_SO_COOKIE                        0x4032
+#define TARGET_SCM_TIMESTAMPING_PKTINFO         0x4033
+#define TARGET_SO_PEERGROUPS                    0x4034
+#define TARGET_SO_ZEROCOPY                      0x4035
 
 /** sock_type - Socket types - default values
- *
  *
  * @SOCK_STREAM - stream (connection) socket
  * @SOCK_DGRAM - datagram (conn.less) socket
@@ -80,18 +86,18 @@
  * @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     = 010000000,
-   TARGET_SOCK_NONBLOCK    = 0x40000000,
+    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 TARGET_SOCK_TYPE_MASK 0xf  /* Covers up to TARGET_SOCK_MAX - 1. */
 
 #define ARCH_HAS_SOCKET_TYPES 1
linux-user/socket.h +1 -1
index 7051cd2cf4..c7e6cb8ea1 100644
@@ -206,7 +206,7 @@
     #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 <hppa/sockbits.h>
+#include "hppa/sockbits.h"
 #else
 
 #if defined(TARGET_SPARC)
Signature · 1 line
2.14.1
#2 lore raw

PATCH v2 2/6 linux-user: refactor socket.h for alpha

based on fresh bits from linux 4.14 and therefore enabling SO_REUSEPORT as a side effect

to easy on maintenance SO_NONBLOCK updated to match the value from linux headers (in hexadecimal) as seen in arch/alpha/include/asm/socket.h

---
 linux-user/alpha/sockbits.h | 104 ++++++++++++++++++++++++++++++++++++++++++++
 linux-user/socket.h         | 104 +-------------------------------------------
 2 files changed, 105 insertions(+), 103 deletions(-)
 create mode 100644 linux-user/alpha/sockbits.h
linux-user/alpha/sockbits.h new file +104 -0
new file mode 100644
index 0000000000..768579a1f7
@@ -0,0 +1,104 @@
+#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
+#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
+#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
+#define TARGET_SO_ATTACH_FILTER                 26
+#define TARGET_SO_DETACH_FILTER                 27
+#define TARGET_SO_GET_FILTER                    TARGET_SO_ATTACH_FILTER
+#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
+#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
+#define TARGET_SO_NOFCS                         43
+#define TARGET_SO_LOCK_FILTER                   44
+#define TARGET_SO_SELECT_ERR_QUEUE              45
+#define TARGET_SO_BUSY_POLL                     46
+#define TARGET_SO_MAX_PACING_RATE               47
+#define TARGET_SO_BPF_EXTENSIONS                48
+#define TARGET_SO_INCOMING_CPU                  49
+#define TARGET_SO_ATTACH_BPF                    50
+#define TARGET_SO_DETACH_BPF                    TARGET_SO_DETACH_FILTER
+#define TARGET_SO_ATTACH_REUSEPORT_CBPF         51
+#define TARGET_SO_ATTACH_REUSEPORT_EBPF         52
+#define TARGET_SO_CNX_ADVICE                    53
+#define TARGET_SCM_TIMESTAMPING_OPT_STATS       54
+#define TARGET_SO_MEMINFO                       55
+#define TARGET_SO_INCOMING_NAPI_ID              56
+#define TARGET_SO_COOKIE                        57
+#define TARGET_SCM_TIMESTAMPING_PKTINFO         58
+#define TARGET_SO_PEERGROUPS                    59
+#define TARGET_SO_ZEROCOPY                      60
+
+/** 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_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     = 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
linux-user/socket.h +1 -103

110 lines not on this page · raw message

Signature · 1 line
2.14.1
#3 lore raw

PATCH v2 3/6 linux-user: refactor socket.h for mips

fresh bits from linux 4.14, redefine SO_STYLE and {SO,SCM}_TIMESTAMP to the right target values and enables SO_REUSEPORT

to easy on maintenance SOCK_NONBLOCK has been updated to use the same value (in hexadecimal) as defined for O_NONBLOCK from the linux header arch/mips/linux/uapi/asm/fcntl.h

---
 linux-user/mips/sockbits.h | 107 +++++++++++++++++++++++++++++++++++++++++++++
 linux-user/socket.h        | 103 +------------------------------------------
 2 files changed, 108 insertions(+), 102 deletions(-)
 create mode 100644 linux-user/mips/sockbits.h
linux-user/mips/sockbits.h new file +107 -0
new file mode 100644
index 0000000000..6d8ea8aba2
@@ -0,0 +1,107 @@
+#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. */
+#define TARGET_SO_REUSEPORT   0x0200 /* Allow local address and port reuse. */
+#define TARGET_SO_TYPE        0x1008 /* Compatible name for TARGET_SO_STYLE. */
+#define TARGET_SO_STYLE       TARGET_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
+#define TARGET_SO_PROTOCOL    0x1028         /* protocol type */
+#define TARGET_SO_DOMAIN      0x1029         /* domain/socket family */
+#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_SECURITY_AUTHENTICATION       22
+#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
+#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK   24
+#define TARGET_SO_BINDTODEVICE                  25
+#define TARGET_SO_ATTACH_FILTER                 26
+#define TARGET_SO_DETACH_FILTER                 27
+#define TARGET_SO_GET_FILTER                    TARGET_SO_ATTACH_FILTER
+#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_SNDBUFFORCE                   31
+#define TARGET_SO_RCVBUFFORCE                   33
+#define TARGET_SO_PASSSEC                       34
+#define TARGET_SO_TIMESTAMPNS                   35
+#define TARGET_SCM_TIMESTAMPNS                  TARGET_SO_TIMESTAMPNS
+#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
+#define TARGET_SO_NOFCS                         43
+#define TARGET_SO_LOCK_FILTER                   44
+#define TARGET_SO_SELECT_ERR_QUEUE              45
+#define TARGET_SO_BUSY_POLL                     46
+#define TARGET_SO_MAX_PACING_RATE               47
+#define TARGET_SO_BPF_EXTENSIONS                48
+#define TARGET_SO_INCOMING_CPU                  49
+#define TARGET_SO_ATTACH_BPF                    50
+#define TARGET_SO_DETACH_BPF                    TARGET_SO_DETACH_FILTER
+#define TARGET_SO_ATTACH_REUSEPORT_CBPF         51
+#define TARGET_SO_ATTACH_REUSEPORT_EBPF         52
+#define TARGET_SO_CNX_ADVICE                    53
+#define TARGET_SCM_TIMESTAMPING_OPT_STATS       54
+#define TARGET_SO_MEMINFO                       55
+#define TARGET_SO_INCOMING_NAPI_ID              56
+#define TARGET_SO_COOKIE                        57
+#define TARGET_SCM_TIMESTAMPING_PKTINFO         58
+#define TARGET_SO_PEERGROUPS                    59
+#define TARGET_SO_ZEROCOPY                      60
+
+/** 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.
+ */
+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    = 0x0080,
+};
+
+#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
linux-user/socket.h +1 -102

107 lines not on this page · raw message

Signature · 1 line
2.14.1
#4 lore raw

PATCH v2 4/6 linux-user: refactor socket.h for sparc

fixes SOL_SOCKET and SO_LINGER and all other values that didn't match the default (SO_PASSSEC being the exception as it only changed base)

TARGET_SOCK_{NONBLOCK,CLOEXEC} updated to match the values for the header:
arch/sparc/include/uapi/asm/fcntl.h

---
 linux-user/socket.h         |  46 ++------------------
 linux-user/sparc/sockbits.h | 104 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+), 43 deletions(-)
 create mode 100644 linux-user/sparc/sockbits.h
linux-user/socket.h +3 -43
index 036270a6e4..dfa692286b 100644
@@ -4,50 +4,10 @@
 #include "alpha/sockbits.h"
 #elif defined(TARGET_HPPA)
 #include "hppa/sockbits.h"
+#elif defined(TARGET_SPARC)
+#include "sparc/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
 
@@ -103,11 +63,11 @@
 
     #define TARGET_SO_PEERSEC              31
 
+    #define TARGET_SO_PASSSEC              34
 #endif
 
 #ifndef ARCH_HAS_SOCKET_TYPES
     /** sock_type - Socket types - default values
-     *
      *
      * @SOCK_STREAM - stream (connection) socket
      * @SOCK_DGRAM - datagram (conn.less) socket
linux-user/sparc/sockbits.h new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
2.14.1
#5 lore raw

PATCH v2 5/6 linux-user: update default socket.h

enable SO_REUSEPORT as a sideeffect and add SO_GET_FILTER alias

---
 linux-user/socket.h | 59 +++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 48 insertions(+), 11 deletions(-)
linux-user/socket.h +48 -11
index dfa692286b..6f49255b5f 100644
@@ -27,7 +27,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
 #if defined(TARGET_PPC)
     #define TARGET_SO_RCVLOWAT     16
     #define TARGET_SO_SNDLOWAT     17
@@ -49,21 +49,58 @@
     #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT        23
     #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK          24
 
-    #define TARGET_SO_BINDTODEVICE 25
+    #define TARGET_SO_BINDTODEVICE            25
 
     /* Socket filtering */
-    #define TARGET_SO_ATTACH_FILTER        26
-    #define TARGET_SO_DETACH_FILTER        27
+    #define TARGET_SO_ATTACH_FILTER           26
+    #define TARGET_SO_DETACH_FILTER           27
+    #define TARGET_SO_GET_FILTER              TARGET_SO_ATTACH_FILTER
 
-    #define TARGET_SO_PEERNAME             28
-    #define TARGET_SO_TIMESTAMP            29
-    #define TARGET_SCM_TIMESTAMP           TARGET_SO_TIMESTAMP
+    #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_ACCEPTCONN              30
 
-    #define TARGET_SO_PEERSEC              31
+    #define TARGET_SO_PEERSEC                 31
+    #define TARGET_SO_PASSSEC                 34
+    #define TARGET_SO_TIMESTAMPNS             35
+    #define TARGET_SCM_TIMESTAMPNS            TARGET_SO_TIMESTAMPNS
+
+    #define TARGET_SO_MARK                    36
+
+    #define TARGET_SO_TIMESTAMPING            37
+    #define TARGET_SCM_TIMESTAMPING           TARGET_SO_TIMESTAMPING
+
+    #define TARGET_SO_PROTOCOL                38
+    #define TARGET_SO_DOMAIN                  39
+
+    #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
+
+    #define TARGET_SO_NOFCS                   43
+    #define TARGET_SO_LOCK_FILTER             44
+    #define TARGET_SO_SELECT_ERR_QUEUE        45
+    #define TARGET_SO_BUSY_POLL               46
+    #define TARGET_SO_MAX_PACING_RATE         47
+    #define TARGET_SO_BPF_EXTENSIONS          48
+    #define TARGET_SO_INCOMING_CPU            49
+    #define TARGET_SO_ATTACH_BPF              50
+    #define TARGET_SO_DETACH_BPF              TARGET_SO_DETACH_FILTER
+    #define TARGET_SO_ATTACH_REUSEPORT_CBPF   51
+    #define TARGET_SO_ATTACH_REUSEPORT_EBPF   52
+    #define TARGET_SO_CNX_ADVICE              53
+    #define TARGET_SCM_TIMESTAMPING_OPT_STATS 54
+    #define TARGET_SO_MEMINFO                 55
+    #define TARGET_SO_INCOMING_NAPI_ID        56
+    #define TARGET_SO_COOKIE                  57
+    #define TARGET_SCM_TIMESTAMPING_PKTINFO   58
+    #define TARGET_SO_PEERGROUPS              59
+    #define TARGET_SO_ZEROCOPY                60
 
-    #define TARGET_SO_PASSSEC              34
 #endif
 
 #ifndef ARCH_HAS_SOCKET_TYPES
@@ -94,6 +131,6 @@
     };
 
     #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-    #define TARGET_SOCK_TYPE_MASK    0xf  /* Covers up to TARGET_SOCK_MAX-1. */
+    #define TARGET_SOCK_TYPE_MASK  0xf  /* Covers up to TARGET_SOCK_MAX - 1. */
 
 #endif
Signature · 1 line
2.14.1
#6 lore raw

PATCH v2 6/6 linux_user: consolidate sock_type

remove unnecessary sock_type enum and other unused surrounding code to allow for per arch sockbits to mirror better linux headers for maintenance

---
 linux-user/alpha/sockbits.h | 36 ----------------------------
 linux-user/hppa/sockbits.h  | 30 -----------------------
 linux-user/mips/sockbits.h  | 35 ---------------------------
 linux-user/socket.h         | 58 ++++++++++++++++++++++-----------------------
 linux-user/sparc/sockbits.h | 35 ---------------------------
 5 files changed, 29 insertions(+), 165 deletions(-)
linux-user/alpha/sockbits.h +0 -36
index 768579a1f7..defdb806ea 100644
@@ -66,39 +66,3 @@
 #define TARGET_SCM_TIMESTAMPING_PKTINFO         58
 #define TARGET_SO_PEERGROUPS                    59
 #define TARGET_SO_ZEROCOPY                      60
-
-/** 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_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     = 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
linux-user/hppa/sockbits.h +0 -30
index 3dab31a76a..32f81357d6 100644
@@ -71,33 +71,3 @@
 #define TARGET_SO_PEERGROUPS                    0x4034
 #define TARGET_SO_ZEROCOPY                      0x4035
 
-/** 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   = 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
linux-user/mips/sockbits.h +0 -35
index 6d8ea8aba2..fa8062391d 100644
@@ -70,38 +70,3 @@
 #define TARGET_SCM_TIMESTAMPING_PKTINFO         58
 #define TARGET_SO_PEERGROUPS                    59
 #define TARGET_SO_ZEROCOPY                      60
-
-/** 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.
- */
-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    = 0x0080,
-};
-
-#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
linux-user/socket.h +29 -29

63 lines not on this page · raw message

linux-user/sparc/sockbits.h +0 -35
index d51ae5f84f..70bee083bb 100644
@@ -67,38 +67,3 @@
 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT  0x5002
 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK    0x5004
 
-/** 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_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     = 0x400000,
-    TARGET_SOCK_NONBLOCK    = 0x4000,
-};
-
-#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
Signature · 1 line
2.14.1
#7 lore raw

Re: [Qemu-devel] [PATCH v2 6/6] linux_user: consolidate sock_type

Le 26/09/2017 à 01:19, Carlo Marcelo Arenas Belón a écrit :

Quoted 11 lines

remove unnecessary sock_type enum and other unused surrounding code to allow for per arch sockbits to mirror better linux headers for maintenance

---
 linux-user/alpha/sockbits.h | 36 ----------------------------
 linux-user/hppa/sockbits.h  | 30 -----------------------
 linux-user/mips/sockbits.h  | 35 ---------------------------
 linux-user/socket.h         | 58 ++++++++++++++++++++++-----------------------
 linux-user/sparc/sockbits.h | 35 ---------------------------
 5 files changed, 29 insertions(+), 165 deletions(-)

I think it's not a good idea to mix again what we have just unmixed.

Thanks,
Laurent

#8 lore raw

Re: [Qemu-devel] [PATCH v2 6/6] linux_user: consolidate sock_type

Quoted 13 lines · Laurent Vivier
Quoted 11 lines · Carlo Marcelo Arenas Belón

remove unnecessary sock_type enum and other unused surrounding code to allow for per arch sockbits to mirror better linux headers for maintenance

---
 linux-user/alpha/sockbits.h | 36 ----------------------------
 linux-user/hppa/sockbits.h  | 30 -----------------------
 linux-user/mips/sockbits.h  | 35 ---------------------------
 linux-user/socket.h         | 58 ++++++++++++++++++++++-----------------------
 linux-user/sparc/sockbits.h | 35 ---------------------------
 5 files changed, 29 insertions(+), 165 deletions(-)
Quoted 1 line

I think it's not a good idea to mix again what we have just unmixed.

do you object to the fact it was done in 2 steps (first moving out from socket.h and then added it back as a single block)? it was done that way to reuse as much as possible the code that was already reviewed.

the end result is the important part, though; and it is a sockbits.h for those 4 architectures (and a socket.h for the rest) that could be automatically generated or compared with the corresponding linux headers and therefore hopefully be easier to maintain going forward.

since we are going to redo the series anyway, could we get some discussion/agreement on the design of it?, have to admit I am a little surprised by all the patches flying by the list but not many conversations, and being new to qemu linux-user I think I could have benefited from it to avoid some of the mistakes made.

Carlo

#9 lore raw

Re: [Qemu-devel] [PATCH v2 5/6] linux-user: update default socket.h

In reply to Carlo Marcelo Arenas Belón

Le 26/09/2017 à 01:19, Carlo Marcelo Arenas Belón a écrit :

Quoted 90 lines

enable SO_REUSEPORT as a sideeffect and add SO_GET_FILTER alias

---
 linux-user/socket.h | 59 +++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 48 insertions(+), 11 deletions(-)
linux-user/socket.h +47 -10
index dfa692286b..6f49255b5f 100644
@@ -27,7 +27,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
 #if defined(TARGET_PPC)
     #define TARGET_SO_RCVLOWAT     16
     #define TARGET_SO_SNDLOWAT     17
@@ -49,21 +49,58 @@
     #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT        23
     #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK          24
 
-    #define TARGET_SO_BINDTODEVICE 25
+    #define TARGET_SO_BINDTODEVICE            25
 
     /* Socket filtering */
-    #define TARGET_SO_ATTACH_FILTER        26
-    #define TARGET_SO_DETACH_FILTER        27
+    #define TARGET_SO_ATTACH_FILTER           26
+    #define TARGET_SO_DETACH_FILTER           27
+    #define TARGET_SO_GET_FILTER              TARGET_SO_ATTACH_FILTER
 
-    #define TARGET_SO_PEERNAME             28
-    #define TARGET_SO_TIMESTAMP            29
-    #define TARGET_SCM_TIMESTAMP           TARGET_SO_TIMESTAMP
+    #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_ACCEPTCONN              30
 
-    #define TARGET_SO_PEERSEC              31
+    #define TARGET_SO_PEERSEC                 31
+    #define TARGET_SO_PASSSEC                 34
+    #define TARGET_SO_TIMESTAMPNS             35
+    #define TARGET_SCM_TIMESTAMPNS            TARGET_SO_TIMESTAMPNS
+
+    #define TARGET_SO_MARK                    36
+
+    #define TARGET_SO_TIMESTAMPING            37
+    #define TARGET_SCM_TIMESTAMPING           TARGET_SO_TIMESTAMPING
+
+    #define TARGET_SO_PROTOCOL                38
+    #define TARGET_SO_DOMAIN                  39
+
+    #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
+
+    #define TARGET_SO_NOFCS                   43
+    #define TARGET_SO_LOCK_FILTER             44
+    #define TARGET_SO_SELECT_ERR_QUEUE        45
+    #define TARGET_SO_BUSY_POLL               46
+    #define TARGET_SO_MAX_PACING_RATE         47
+    #define TARGET_SO_BPF_EXTENSIONS          48
+    #define TARGET_SO_INCOMING_CPU            49
+    #define TARGET_SO_ATTACH_BPF              50
+    #define TARGET_SO_DETACH_BPF              TARGET_SO_DETACH_FILTER
+    #define TARGET_SO_ATTACH_REUSEPORT_CBPF   51
+    #define TARGET_SO_ATTACH_REUSEPORT_EBPF   52
+    #define TARGET_SO_CNX_ADVICE              53
+    #define TARGET_SCM_TIMESTAMPING_OPT_STATS 54
+    #define TARGET_SO_MEMINFO                 55
+    #define TARGET_SO_INCOMING_NAPI_ID        56
+    #define TARGET_SO_COOKIE                  57
+    #define TARGET_SCM_TIMESTAMPING_PKTINFO   58
+    #define TARGET_SO_PEERGROUPS              59
+    #define TARGET_SO_ZEROCOPY                60
 
-    #define TARGET_SO_PASSSEC              34
 #endif
 
 #ifndef ARCH_HAS_SOCKET_TYPES

linux-user/socket.h line 136

Quoted 7 lines
linux-user/socket.h +1 -1
@@ -94,6 +131,6 @@
     };
 
     #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
-    #define TARGET_SOCK_TYPE_MASK    0xf  /* Covers up to TARGET_SOCK_MAX-1. */
+    #define TARGET_SOCK_TYPE_MASK  0xf  /* Covers up to TARGET_SOCK_MAX - 1. */
 
 #endif

As for patch 1/6 don't change indentation, only add the missing lines.

Thanks,
Laurent

#10 lore raw

Re: [Qemu-devel] [PATCH v2 1/6] linux-user: update hppa sockbits

In reply to Carlo Marcelo Arenas Belón

Le 26/09/2017 à 01:19, Carlo Marcelo Arenas Belón a écrit :

Quoted 9 lines

updated to match arch/parisc/include/uapi/asm/socket.h from linux 4.14 include in socket.h changed to prefer a local path like all other qemu headers and for consistency and clarity when adding all other arch

---
 linux-user/hppa/sockbits.h | 148 +++++++++++++++++++++++----------------------
 linux-user/socket.h        |   2 +-
 2 files changed, 78 insertions(+), 72 deletions(-)

As I said for the RFC, I think it's better not to change indentation.

Thanks,
Laurent

#11 lore raw
In reply to Carlo Marcelo Arenas Belón

ping

some of the patches already have a Reviewed-by as shown by :

http://patchwork.ozlabs.org/patch/818378/

Quoted 16 lines · Carlo Marcelo Arenas Belón

the definitions in socket.h are meant to reflect the ones in linux for each respective target, but are sometimes difficult to maintain.

hppa (AKA parisc) was initially merged with an independent file that mirrors more closely the corresponding one in linux but hasn't been updated since.

this series updates hppa with the latest bits from linux 4.14 and makes sure all relevant architectures had a sockbits file that would be easy to maintain going forward.

most of the changes are pretty mechanical and I had made (thanks to Laurent's tough review) every effort to ensure no value gets changed accidentaly and all changes (even the ones where the value remains but is now in a different base to better match what was used in the linux headers) are documented, so it should be fairly safe and will fix bugs (mostly for sparc).

#12 lore raw
Quoted 1 line · Carlo Arenas

ping

Thanks for your patience

Quoted 3 lines

some of the patches already have a Reviewed-by as shown by :

http://patchwork.ozlabs.org/patch/818378/

Can you send the series without the whitespace-only changes?

Quoted 18 lines
Quoted 16 lines · Carlo Marcelo Arenas Belón

the definitions in socket.h are meant to reflect the ones in linux for each respective target, but are sometimes difficult to maintain.

hppa (AKA parisc) was initially merged with an independent file that mirrors more closely the corresponding one in linux but hasn't been updated since.

this series updates hppa with the latest bits from linux 4.14 and makes sure all relevant architectures had a sockbits file that would be easy to maintain going forward.

most of the changes are pretty mechanical and I had made (thanks to Laurent's tough review) every effort to ensure no value gets changed accidentaly and all changes (even the ones where the value remains but is now in a different base to better match what was used in the linux headers) are documented, so it should be fairly safe and will fix bugs (mostly for sparc).

#13 lore raw
Quoted 6 lines · Riku Voipio
Quoted 3 lines · Carlo Arenas

some of the patches already have a Reviewed-by as shown by :

http://patchwork.ozlabs.org/patch/818378/

Can you send the series without the whitespace-only changes?

sure, but how would you suggest then to do the other changes which are the overall objective for this?

* fix any incorrect values (mostly sparc, but there are also in all other archs incorrect names)
* make sure that the arch specific file mirrors as much as possible linux headers, so it will be straightforward to update them (even possible through a script)
* update the arch specific files with latest bits from 4.14

should I send those as independent series?, or just as additional patches in the series, so it is obvious what the dependency is.

there is also the problem with the enum and related defines which was custom made and probably copy & pasted around

Carlo

#14 lore raw

Le 17/10/2017 à 16:35, Carlo Arenas a écrit :

Quoted 18 lines · Riku Voipio
Quoted 6 lines · Carlo Arenas
Quoted 3 lines

some of the patches already have a Reviewed-by as shown by :

http://patchwork.ozlabs.org/patch/818378/

Can you send the series without the whitespace-only changes?

sure, but how would you suggest then to do the other changes which are the overall objective for this?

* fix any incorrect values (mostly sparc, but there are also in all other archs incorrect names)
* make sure that the arch specific file mirrors as much as possible linux headers, so it will be straightforward to update them (even possible through a script)
* update the arch specific files with latest bits from 4.14

Quoted 5 lines

should I send those as independent series?, or just as additional patches in the series, so it is obvious what the dependency is.

there is also the problem with the enum and related defines which was custom made and probably copy & pasted around

I think you should re-send your series without changing any indentation and without "[PATCH v2 6/6]". So, I think they'll be applied.

Then, if you think the remaining changes are important, you could try to submit a new patch series to do that.

Thanks,
Laurent