From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6681 invoked from network); 17 Mar 2021 20:12:36 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 17 Mar 2021 20:12:36 -0000 Received: (qmail 13783 invoked by uid 550); 17 Mar 2021 20:12:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13753 invoked from network); 17 Mar 2021 20:12:28 -0000 Date: Wed, 17 Mar 2021 21:12:16 +0100 From: Szabolcs Nagy To: musl@lists.openwall.com Message-ID: <20210317201216.GA2799122@port70.net> Mail-Followup-To: musl@lists.openwall.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline Subject: [musl] [PATCH 0/7] updates for linux v5.11 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline patches attached. in signal.h there are existing SA_ macros under _GNU_SOURCE, the new SA_ macros in the last patch are added for posix|bsd|gnu. Szabolcs Nagy (7): sys/prctl.h: add PR_SET_SYSCALL_USER_DISPATCH from linux v5.11 sys/socket.h: add new SO_ socket options from linux v5.11 netinet/if_ether.h: add ETH_P_CFM from linux v5.11 netinet/tcp.h: add tcp zerocopy related changes from linux v5.11 signal.h: add si_code values for SIGSYS signal.h: add SYS_USER_DISPATCH si_code value from linux v5.11 signal.h: add new sa_flags from linux v5.11 include/netinet/if_ether.h | 1 + include/netinet/tcp.h | 5 +++++ include/signal.h | 6 ++++++ include/sys/prctl.h | 6 ++++++ include/sys/socket.h | 2 ++ 5 files changed, 20 insertions(+) -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-sys-prctl.h-add-PR_SET_SYSCALL_USER_DISPATCH-from-li.patch" >From 0fe91d0b1c6a457ca92c5cf3bb17ee6450a3d6b2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 20:50:17 +0000 Subject: [PATCH 1/7] sys/prctl.h: add PR_SET_SYSCALL_USER_DISPATCH from linux v5.11 see linux commit 1446e1df9eb183fdf81c3f0715402f1d7595d4cb kernel: Implement selective syscall userspace redirection linux commit 36a6c843fd0d8e02506681577e96dabd203dd8e8 entry: Use different define for selector variable in SUD redirect syscalls to a userspace handler via SIGSYS, except for a specific range of code. can be toggled via a memory write to a selector variable. mainly for wine. --- include/sys/prctl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/sys/prctl.h b/include/sys/prctl.h index 4ba73f42..3f0254c7 100644 --- a/include/sys/prctl.h +++ b/include/sys/prctl.h @@ -168,6 +168,12 @@ struct prctl_mm_map { #define PR_SET_IO_FLUSHER 57 #define PR_GET_IO_FLUSHER 58 +#define PR_SET_SYSCALL_USER_DISPATCH 59 +#define PR_SYS_DISPATCH_OFF 0 +#define PR_SYS_DISPATCH_ON 1 +#define SYSCALL_DISPATCH_FILTER_ALLOW 0 +#define SYSCALL_DISPATCH_FILTER_BLOCK 1 + int prctl (int, ...); #ifdef __cplusplus -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-sys-socket.h-add-new-SO_-socket-options-from-linux-v.patch" >From 849e78b97bdf030369f6e8aab0a19fecb2dd43f4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 21:19:36 +0000 Subject: [PATCH 2/7] sys/socket.h: add new SO_ socket options from linux v5.11 see linux commit 7fd3253a7de6a317a0683f83739479fb880bffc8 net: Introduce preferred busy-polling linux commit 7c951cafc0cb2e575f1d58677b95ac387ac0a5bd net: Add SO_BUSY_POLL_BUDGET socket option --- include/sys/socket.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index 38f5bb17..6dc1e40a 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -289,6 +289,8 @@ struct linger { #define SCM_TXTIME SO_TXTIME #define SO_BINDTOIFINDEX 62 #define SO_DETACH_REUSEPORT_BPF 68 +#define SO_PREFER_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70 #ifndef SOL_SOCKET #define SOL_SOCKET 1 -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-netinet-if_ether.h-add-ETH_P_CFM-from-linux-v5.11.patch" >From a99ab78fa093c01a8e27ea7d076bb74127747726 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 21:33:25 +0000 Subject: [PATCH 3/7] netinet/if_ether.h: add ETH_P_CFM from linux v5.11 see linux commit fbaedb4129838252570410c65abb2036b5505cbd bridge: uapi: cfm: Added EtherType used by the CFM protocol. --- include/netinet/if_ether.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 55a2ff1b..3479f511 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -66,6 +66,7 @@ #define ETH_P_1588 0x88F7 #define ETH_P_NCSI 0x88F8 #define ETH_P_PRP 0x88FB +#define ETH_P_CFM 0x8902 #define ETH_P_FCOE 0x8906 #define ETH_P_TDLS 0x890D #define ETH_P_FIP 0x8914 -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0004-netinet-tcp.h-add-tcp-zerocopy-related-changes-from-.patch" >From 7fc1d2b6866ddcefd5896a9ba5741cf4c7203308 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 21:39:24 +0000 Subject: [PATCH 4/7] netinet/tcp.h: add tcp zerocopy related changes from linux v5.11 see linux commit 18fb76ed53865c1b5d5f0157b1b825704590beb5 net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy. linux commit 94ab9eb9b234ddf23af04a4bc7e8db68e67b8778 net-zerocopy: Defer vm zap unless actually needed. --- include/netinet/tcp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index b7b997f5..30f20239 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -281,12 +281,17 @@ struct tcp_repair_window { uint32_t rcv_wup; }; +#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1 + struct tcp_zerocopy_receive { uint64_t address; uint32_t length; uint32_t recv_skip_hint; uint32_t inq; int32_t err; + uint64_t copybuf_address; + int32_t copybuf_len; + uint32_t flags; }; #endif -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0005-signal.h-add-si_code-values-for-SIGSYS.patch" >From c4310483c604522cdfe99da5c41f887a58dc6dfe Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 22:15:11 +0000 Subject: [PATCH 5/7] signal.h: add si_code values for SIGSYS unlike other si_code defines, SYS_ is not in the posix reserved namespace which is likely the reason why SYS_SECCOMP was previously missing (was new in linux v3.5). --- include/signal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/signal.h b/include/signal.h index f270a594..4dd46142 100644 --- a/include/signal.h +++ b/include/signal.h @@ -261,6 +261,8 @@ void (*sigset(int, void (*)(int)))(int); #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define NSIG _NSIG typedef void (*sig_t)(int); + +#define SYS_SECCOMP 1 #endif #ifdef _GNU_SOURCE -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0006-signal.h-add-SYS_USER_DISPATCH-si_code-value-from-li.patch" >From 2af4cdb1452ddbba5119ddf031a00d2f5bb04cd4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 22:20:54 +0000 Subject: [PATCH 6/7] signal.h: add SYS_USER_DISPATCH si_code value from linux v5.11 see linux commit 1d7637d89cfce54a4f4a41c2325288c2f47470e8 signal: Expose SYS_USER_DISPATCH si_code type --- include/signal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/signal.h b/include/signal.h index 4dd46142..af940ccb 100644 --- a/include/signal.h +++ b/include/signal.h @@ -263,6 +263,7 @@ void (*sigset(int, void (*)(int)))(int); typedef void (*sig_t)(int); #define SYS_SECCOMP 1 +#define SYS_USER_DISPATCH 2 #endif #ifdef _GNU_SOURCE -- 2.29.2 --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0007-signal.h-add-new-sa_flags-from-linux-v5.11.patch" >From 87d7dcfe395174e2f6e76de1a20c3014c7e984d1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 17 Mar 2021 19:19:27 +0000 Subject: [PATCH 7/7] signal.h: add new sa_flags from linux v5.11 see linux commit a54f0dfda754c5cecc89a14dab68a3edc1e497b5 signal: define the SA_UNSUPPORTED bit in sa_flags linux commit 6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa signal: define the SA_EXPOSE_TAGBITS bit in sa_flags Note: SA_ is in the posix reserved namespace so these linux specific flags can be exposed when compiling for posix. --- include/signal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/signal.h b/include/signal.h index af940ccb..c347f861 100644 --- a/include/signal.h +++ b/include/signal.h @@ -178,6 +178,9 @@ struct sigaction { #define sa_handler __sa_handler.sa_handler #define sa_sigaction __sa_handler.sa_sigaction +#define SA_UNSUPPORTED 0x00000400 +#define SA_EXPOSE_TAGBITS 0x00000800 + struct sigevent { union sigval sigev_value; int sigev_signo; -- 2.29.2 --yrj/dFKFPuw6o+aM--