mailing list of musl libc
 help / color / Atom feed
* [PATCH 0/6] updates for linux v5.4
@ 2019-12-24 22:28 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2019-12-24 22:28 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

attached the v5.4 patches,
the v5.3 patches are still pending:
https://www.openwall.com/lists/musl/2019/11/10/1

i did not include the SOMAXCONN change since it's configurable
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19f92a030ca6d772ab44b22ee6a01378a8cb32d4

Szabolcs Nagy (6):
  sys/mman.h: add MADV_COLD and MADV_PAGEOUT from linux v5.4
  sys/prctl.h: add PR_*_TAGGED_ADDR_* from linux v5.4
  netinet/tcp.h: add new tcp_info fields from linux v5.4
  sys/wait.h: add P_PIDFD from linux v5.4
  mips: add hwcap bits from linux v5.4
  mips: add clone3 syscall numbers from linux v5.4

 arch/mips/bits/hwcap.h         | 11 +++++++++++
 arch/mips/bits/syscall.h.in    |  1 +
 arch/mips64/bits/syscall.h.in  |  1 +
 arch/mipsn32/bits/syscall.h.in |  1 +
 include/netinet/tcp.h          |  2 ++
 include/sys/mman.h             |  2 ++
 include/sys/prctl.h            |  4 ++++
 include/sys/wait.h             |  3 ++-
 8 files changed, 24 insertions(+), 1 deletion(-)

-- 
2.23.0


[-- Attachment #2: 0001-sys-mman.h-add-MADV_COLD-and-MADV_PAGEOUT-from-linux.patch --]
[-- Type: text/x-diff, Size: 1275 bytes --]

From 2dc8c67fdcf54fccb83b6b4f3d9ac6ea0c3f0eea Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 22 Dec 2019 10:26:20 +0000
Subject: [PATCH 1/6] sys/mman.h: add MADV_COLD and MADV_PAGEOUT from linux
 v5.4

These were mainly introduced so android can optimize the memory usage
of unused apps.

MADV_COLD hints that the memory range is currently not needed (unlike
with MADV_FREE the content is not garbage, it needs to be swapped):

  linux commit 9c276cc65a58faf98be8e56962745ec99ab87636
  mm: introduce MADV_COLD

MADV_PAGEOUT hints that the memory range is not needed for a long time
so it can be reclaimed immediately independently of memory pressure
(unlike with MADV_DONTNEED the content is not garbage):

  linux commit 1a4e58cce84ee88129d5d49c064bd2852b481357
  mm: introduce MADV_PAGEOUT
---
 include/sys/mman.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/sys/mman.h b/include/sys/mman.h
index d0761b18..3bade727 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -92,6 +92,8 @@ extern "C" {
 #define MADV_DODUMP      17
 #define MADV_WIPEONFORK  18
 #define MADV_KEEPONFORK  19
+#define MADV_COLD        20
+#define MADV_PAGEOUT     21
 #define MADV_HWPOISON    100
 #define MADV_SOFT_OFFLINE 101
 #endif
-- 
2.23.0


[-- Attachment #3: 0002-sys-prctl.h-add-PR_-_TAGGED_ADDR_-from-linux-v5.4.patch --]
[-- Type: text/x-diff, Size: 1057 bytes --]

From 10093156dea4434cc29622ace64a77a91885338c Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 22 Dec 2019 10:51:37 +0000
Subject: [PATCH 2/6] sys/prctl.h: add PR_*_TAGGED_ADDR_* from linux v5.4

per thread prctl commands to relax the syscall abi such that top bits
of user pointers are ignored in the kernel. this allows the use of
those bits by hwasan or by mte to color pointers and memory on aarch64:

  linux commit 63f0c60379650d82250f22e4cf4137ef3dc4f43d
  arm64: Introduce prctl() options to control the tagged user addresses ABI
---
 include/sys/prctl.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/sys/prctl.h b/include/sys/prctl.h
index 07f0d73d..d9c846e9 100644
--- a/include/sys/prctl.h
+++ b/include/sys/prctl.h
@@ -154,6 +154,10 @@ struct prctl_mm_map {
 #define PR_PAC_APDBKEY (1UL << 3)
 #define PR_PAC_APGAKEY (1UL << 4)
 
+#define PR_SET_TAGGED_ADDR_CTRL 55
+#define PR_GET_TAGGED_ADDR_CTRL 56
+#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
+
 int prctl (int, ...);
 
 #ifdef __cplusplus
-- 
2.23.0


[-- Attachment #4: 0003-netinet-tcp.h-add-new-tcp_info-fields-from-linux-v5..patch --]
[-- Type: text/x-diff, Size: 1000 bytes --]

From ac4f0aba9f1606426e7e838d958e964ffd3d4498 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 22 Dec 2019 12:02:52 +0000
Subject: [PATCH 3/6] netinet/tcp.h: add new tcp_info fields from linux v5.4

tcpi_rcv_ooopack for tracking connection quality:

  linux commit f9af2dbbfe01def62765a58af7fbc488351893c3
  tcp: Add TCP_INFO counter for packets received out-of-order

tcpi_snd_wnd peer window size for diagnosing tcp performance problems:

  linux commit 8f7baad7f03543451af27f5380fc816b008aa1f2
  tcp: Add snd_wnd to TCP_INFO
---
 include/netinet/tcp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
index 69de9d5a..44a007aa 100644
--- a/include/netinet/tcp.h
+++ b/include/netinet/tcp.h
@@ -234,6 +234,8 @@ struct tcp_info {
 	uint64_t tcpi_bytes_retrans;
 	uint32_t tcpi_dsack_dups;
 	uint32_t tcpi_reord_seen;
+	uint32_t tcpi_rcv_ooopack;
+	uint32_t tcpi_snd_wnd;
 };
 
 #define TCP_MD5SIG_MAXKEYLEN    80
-- 
2.23.0


[-- Attachment #5: 0004-sys-wait.h-add-P_PIDFD-from-linux-v5.4.patch --]
[-- Type: text/x-diff, Size: 788 bytes --]

From 51d39900589664c718520f34de23462c7d164c9e Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 22 Dec 2019 12:11:30 +0000
Subject: [PATCH 4/6] sys/wait.h: add P_PIDFD from linux v5.4

allows waiting on a pidfd, in the future it might allow retrieving the
exit status by a non-parent process, see

  linux commit 3695eae5fee0605f316fbaad0b9e3de791d7dfaf
  pidfd: add P_PIDFD to waitid()
---
 include/sys/wait.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/sys/wait.h b/include/sys/wait.h
index d9adbdec..d4b1f2e1 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -13,7 +13,8 @@ extern "C" {
 typedef enum {
 	P_ALL = 0,
 	P_PID = 1,
-	P_PGID = 2
+	P_PGID = 2,
+	P_PIDFD = 3
 } idtype_t;
 
 pid_t wait (int *);
-- 
2.23.0


[-- Attachment #6: 0005-mips-add-hwcap-bits-from-linux-v5.4.patch --]
[-- Type: text/x-diff, Size: 1205 bytes --]

From 682db971ab61a8d326d81539b6318ef07bf56a5f Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 22 Dec 2019 12:19:16 +0000
Subject: [PATCH 5/6] mips: add hwcap bits from linux v5.4

mips application specific isa extensions were previously not exported
in hwcaps so userspace could not apply optimized code at runtime.

  linux commit 38dffe1e4dde1d3174fdce09d67370412843ebb5
  MIPS: elf_hwcap: Export userspace ASEs
---
 arch/mips/bits/hwcap.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/mips/bits/hwcap.h b/arch/mips/bits/hwcap.h
index 13e86fe7..7986deb7 100644
--- a/arch/mips/bits/hwcap.h
+++ b/arch/mips/bits/hwcap.h
@@ -1,3 +1,14 @@
 #define HWCAP_MIPS_R6		(1 << 0)
 #define HWCAP_MIPS_MSA		(1 << 1)
 #define HWCAP_MIPS_CRC32	(1 << 2)
+#define HWCAP_MIPS_MIPS16	(1 << 3)
+#define HWCAP_MIPS_MDMX		(1 << 4)
+#define HWCAP_MIPS_MIPS3D	(1 << 5)
+#define HWCAP_MIPS_SMARTMIPS	(1 << 6)
+#define HWCAP_MIPS_DSP		(1 << 7)
+#define HWCAP_MIPS_DSP2		(1 << 8)
+#define HWCAP_MIPS_DSP3		(1 << 9)
+#define HWCAP_MIPS_MIPS16E2	(1 << 10)
+#define HWCAP_LOONGSON_MMI	(1 << 11)
+#define HWCAP_LOONGSON_EXT	(1 << 12)
+#define HWCAP_LOONGSON_EXT2	(1 << 13)
-- 
2.23.0


[-- Attachment #7: 0006-mips-add-clone3-syscall-numbers-from-linux-v5.4.patch --]
[-- Type: text/x-diff, Size: 1480 bytes --]

From 77e487b0a324a9cc04e7f44b4f305eb12e3b219b Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 22 Dec 2019 12:31:44 +0000
Subject: [PATCH 6/6] mips: add clone3 syscall numbers from linux v5.4

the syscall numbers were reserved in v5.3 but not wired up on mips, see

  linux commit 0671c5b84e9e0a6d42d22da9b5d093787ac1c5f3
  MIPS: Wire up clone3 syscall
---
 arch/mips/bits/syscall.h.in    | 1 +
 arch/mips64/bits/syscall.h.in  | 1 +
 arch/mipsn32/bits/syscall.h.in | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index 7f6f5a4d..7f9afaab 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -407,4 +407,5 @@
 #define __NR_fsmount		4432
 #define __NR_fspick		4433
 #define __NR_pidfd_open		4434
+#define __NR_clone3		4435
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index 1a1ba7c8..9b406e9a 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -337,4 +337,5 @@
 #define __NR_fsmount		5432
 #define __NR_fspick		5433
 #define __NR_pidfd_open		5434
+#define __NR_clone3		5435
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index fcd5cbf7..134a4f81 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -361,4 +361,5 @@
 #define __NR_fsmount		6432
 #define __NR_fspick		6433
 #define __NR_pidfd_open		6434
+#define __NR_clone3		6435
 
-- 
2.23.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24 22:28 [PATCH 0/6] updates for linux v5.4 Szabolcs Nagy

mailing list of musl libc

Archives are clonable: git clone --mirror http://inbox.vuxu.org/musl

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git