[PATCH v13] exec: Fix dead-lock in de_thread with ptrace_attach

2023-11-05 Thread Bernd Edlinger
This introduces signal->exec_bprm, which is used to fix the case when at least one of the sibling threads is traced, and therefore the trace process may dead-lock in ptrace_attach, but de_thread will need to wait for the tracer to continue execution. The solution is to detect this situation and

[RFC PATCH v3 12/12] selftests: add ncdevmem, netcat for devmem TCP

2023-11-05 Thread Mina Almasry
ncdevmem is a devmem TCP netcat. It works similarly to netcat, but it sends and receives data using the devmem TCP APIs. It uses udmabuf as the dmabuf provider. It is compatible with a regular netcat running on a peer, or a ncdevmem running on a peer. In addition to normal netcat support,

[RFC PATCH v3 11/12] net: add SO_DEVMEM_DONTNEED setsockopt to release RX pages

2023-11-05 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the NET_RX dmabuf pages returned as cmsg. The kernel will drop the reference on the NET_RX pages to make them available for re-use. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry

[RFC PATCH v3 10/12] tcp: RX path for devmem TCP

2023-11-05 Thread Mina Almasry
In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header to the linear buffer, and returns a

[RFC PATCH v3 08/12] net: support non paged skb frags

2023-11-05 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevent callers to handle this case. Correctly handle skb_frag refcounting in the page_pool_iovs case. Signed-off-by: Mina Almasry --- include/linux/skbuff.h | 42

[RFC PATCH v3 09/12] net: add support for skbs with unreadable frags

2023-11-05 Thread Mina Almasry
For device memory TCP, we expect the skb headers to be available in host memory for access, and we expect the skb frags to be in device memory and unaccessible to the host. We expect there to be no mixing and matching of device memory frags (unaccessible) with host memory frags (accessible) in the

[RFC PATCH v3 06/12] memory-provider: dmabuf devmem memory provider

2023-11-05 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem page_pool_iovs. Support of PP_FLAG_DMA_MAP and PP_FLAG_DMA_SYNC_DEV is omitted for simplicity. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for

[RFC PATCH v3 07/12] page-pool: device memory support

2023-11-05 Thread Mina Almasry
Overload the LSB of struct page* to indicate that it's a page_pool_iov. Refactor mm calls on struct page* into helpers, and add page_pool_iov handling on those helpers. Modify callers of these mm APIs with calls to these helpers instead. In areas where struct page* is dereferenced, add a check

[RFC PATCH v3 05/12] netdev: netdevice devmem allocator

2023-11-05 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates page_pool_iov from that binding. The allocation simply delegates to the binding's genpool for the allocation logic and wraps the returned memory region in a page_pool_iov struct.

[RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-05 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a

[RFC PATCH v3 03/12] net: netdev netlink api to bind dma-buf to a net device

2023-11-05 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- Changes in v3: - Support binding multiple rx rx-queues --- Documentation/netlink/specs/netdev.yaml |

[RFC PATCH v3 02/12] net: page_pool: create hooks for custom page providers

2023-11-05 Thread Mina Almasry
From: Jakub Kicinski The page providers which try to reuse the same pages will need to hold onto the ref, even if page gets released from the pool - as in releasing the page from the pp just transfers the "ownership" reference from pp to the provider, and provider will wait for other references

[RFC PATCH v3 01/12] net: page_pool: factor out releasing DMA from releasing the page

2023-11-05 Thread Mina Almasry
From: Jakub Kicinski Releasing the DMA mapping will be useful for other types of pages, so factor it out. Make sure compiler inlines it, to avoid any regressions. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- This is implemented by Jakub in his RFC:

[RFC PATCH v3 00/12] Device Memory TCP

2023-11-05 Thread Mina Almasry
Changes in RFC v3: -- 1. Pulled in the memory-provider dependency from Jakub's RFC[1] to make the series reviewable and mergable. 2. Implemented multi-rx-queue binding which was a todo in v2. 3. Fix to cmsg handling. The sticking point in RFC v2[2] was the device reset

Re: [PATCH] Kunit to check the longest symbol length

2023-11-05 Thread Benno Lossin
On 05.11.23 21:33, Benno Lossin wrote: > On 05.11.23 19:40, Sergio González Collado wrote: >> The longest length of a symbol (KSYM_NAME_LEN) was increased to 512 >> in the reference [1]. This patch adds a kunit test to check the longest >> symbol length. >> >> [1]

Re: [PATCH] Kunit to check the longest symbol length

2023-11-05 Thread Benno Lossin
On 05.11.23 19:40, Sergio González Collado wrote: > The longest length of a symbol (KSYM_NAME_LEN) was increased to 512 > in the reference [1]. This patch adds a kunit test to check the longest > symbol length. > > [1] https://lore.kernel.org/lkml/20220802015052.10452-6-oj...@kernel.org/ > >

Re: [PATCH] Kunit to check the longest symbol length

2023-11-05 Thread Martin Rodriguez Reboredo
On 11/5/23 15:40, Sergio González Collado wrote: The longest length of a symbol (KSYM_NAME_LEN) was increased to 512 in the reference [1]. This patch adds a kunit test to check the longest symbol length. [1] https://lore.kernel.org/lkml/20220802015052.10452-6-oj...@kernel.org/ Signed-off-by:

[PATCH] Kunit to check the longest symbol length

2023-11-05 Thread Sergio González Collado
The longest length of a symbol (KSYM_NAME_LEN) was increased to 512 in the reference [1]. This patch adds a kunit test to check the longest symbol length. [1] https://lore.kernel.org/lkml/20220802015052.10452-6-oj...@kernel.org/ Signed-off-by: Sergio González Collado --- lib/Kconfig.debug

Re: [PATCH] selftests/nolibc: fix testcase status alignment

2023-11-05 Thread Thomas Weißschuh
On 2023-11-05 15:27:00+0100, Willy Tarreau wrote: > On Sun, Nov 05, 2023 at 03:22:30PM +0100, Thomas Weißschuh wrote: > > Center-align all possible status reports. > > Before OK and FAIL were center-aligned in relation to each other but > > SKIPPED and FAILED would be left-aligned. > > > >

Re: [PATCH] selftests/nolibc: fix testcase status alignment

2023-11-05 Thread Willy Tarreau
On Sun, Nov 05, 2023 at 03:22:30PM +0100, Thomas Weißschuh wrote: > Center-align all possible status reports. > Before OK and FAIL were center-aligned in relation to each other but > SKIPPED and FAILED would be left-aligned. > > Before: > > 7 environ_addr = <0x7fffef3e7c50>

[PATCH] selftests/nolibc: fix testcase status alignment

2023-11-05 Thread Thomas Weißschuh
msg = " [OK]"; else if (r == SKIPPED) msg = "[SKIPPED]"; else - msg = "[FAIL]"; + msg = " [FAIL]"; if (llen < 64) putcharn(' ', 64 - llen); --- base-commit: 6de6466e41182875252fe09

[PATCH v2 6/6] selftests/nolibc: add configuration for mipso32be

2023-11-05 Thread Thomas Weißschuh
Allow testing MIPS O32 big endian. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 7 +++ tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git

[PATCH v2 3/6] selftests/nolibc: use XARCH for MIPS

2023-11-05 Thread Thomas Weißschuh
MIPS has many different configurations prepare the support of additional ones by moving the build of MIPS to the generic XARCH infrastructure. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 12 +++-

[PATCH v2 1/6] tools/nolibc: error out on unsupported architecture

2023-11-05 Thread Thomas Weißschuh
When an architecture is unsupported arch.h would silently continue. This leads to a lot of followup errors because my_syscallX() is not defined and the startup code is missing. Avoid these confusing errors and fail the build early with a clear error message and location. Signed-off-by: Thomas

[PATCH v2 0/6] tools/nolibc: MIPS bugfixes and refactoring

2023-11-05 Thread Thomas Weißschuh
Two bugfixes and some minor refactorings of the MIPS support. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Use olddefconfig instead of oldconfig - mipso32{le,be} -> mips32{le,be} - Link to v1: https://lore.kernel.org/r/20231105-nolibc-mips-be-v1-0-6c2ad3e50...@weissschuh.net --- Tho

[PATCH v2 4/6] selftests/nolibc: explicitly specify ABI for MIPS

2023-11-05 Thread Thomas Weißschuh
More ABIs exist, for better clarity specify it explicitly everywhere. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile

[PATCH v2 5/6] selftests/nolibc: extraconfig support

2023-11-05 Thread Thomas Weißschuh
Allow some postprocessing of defconfig files. Suggested-by: Zhangjin Wu Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile

[PATCH v2 2/6] tools/nolibc: move MIPS ABI validation into arch-mips.h

2023-11-05 Thread Thomas Weißschuh
When installing nolibc to a sysroot arch.h is not used so its ABI check is bypassed. This makes is possible to compile nolibc with a non O32 ABI which may build but can not run. Move the check into arch-mips.h so it will always be evaluated. Signed-off-by: Thomas Weißschuh Acked-by: Willy

Re: [PATCH 3/6] selftests/nolibc: use XARCH for MIPS

2023-11-05 Thread Thomas Weißschuh
On 2023-11-05 11:32:27+0100, Willy Tarreau wrote: > On Sun, Nov 05, 2023 at 11:09:57AM +0100, Thomas Weißschuh wrote: > > MIPS has many different configurations prepare the support of additional > > ones by moving the build of MIPS to the generic XARCH infrastructure. > > > > Signed-off-by:

Re: [PATCH 0/6] tools/nolibc: MIPS bugfixes and refactoring

2023-11-05 Thread Willy Tarreau
Hi Thomas, On Sun, Nov 05, 2023 at 11:09:54AM +0100, Thomas Weißschuh wrote: > Two bugfixes and some minor refactorings of the MIPS support. > > Signed-off-by: Thomas Weißschuh besides the small comments about o32 and olddefconfig, consider this series as: Acked-by: Willy Tarreau Thanks!

Re: [PATCH 1/6] tools/nolibc: error out on unsupported architecture

2023-11-05 Thread Willy Tarreau
On Sun, Nov 05, 2023 at 11:09:55AM +0100, Thomas Weißschuh wrote: > When an architecture is unsupported arch.h would silently continue. > This leads to a lot of followup errors because my_syscallX() is not > defined and the startup code is missing. > > Avoid these confusing errors and fail the

Re: [PATCH 5/6] selftests/nolibc: extraconfig support

2023-11-05 Thread Willy Tarreau
On Sun, Nov 05, 2023 at 11:09:59AM +0100, Thomas Weißschuh wrote: > Allow some postprocessing of defconfig files. > > Suggested-by: Zhangjin Wu > Signed-off-by: Thomas Weißschuh > --- > tools/testing/selftests/nolibc/Makefile | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git

Re: [PATCH 3/6] selftests/nolibc: use XARCH for MIPS

2023-11-05 Thread Willy Tarreau
Hi Thomas, On Sun, Nov 05, 2023 at 11:09:57AM +0100, Thomas Weißschuh wrote: > MIPS has many different configurations prepare the support of additional > ones by moving the build of MIPS to the generic XARCH infrastructure. > > Signed-off-by: Thomas Weißschuh > --- >

[PATCH 5/6] selftests/nolibc: extraconfig support

2023-11-05 Thread Thomas Weißschuh
Allow some postprocessing of defconfig files. Suggested-by: Zhangjin Wu Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index

[PATCH 6/6] selftests/nolibc: add configuration for mipso32be

2023-11-05 Thread Thomas Weißschuh
Allow testing MIPS O32 big endian. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 7 +++ tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile

[PATCH 3/6] selftests/nolibc: use XARCH for MIPS

2023-11-05 Thread Thomas Weißschuh
MIPS has many different configurations prepare the support of additional ones by moving the build of MIPS to the generic XARCH infrastructure. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 12 +++- tools/testing/selftests/nolibc/run-tests.sh | 2 +-

[PATCH 1/6] tools/nolibc: error out on unsupported architecture

2023-11-05 Thread Thomas Weißschuh
When an architecture is unsupported arch.h would silently continue. This leads to a lot of followup errors because my_syscallX() is not defined and the startup code is missing. Avoid these confusing errors and fail the build early with a clear error message and location. Signed-off-by: Thomas

[PATCH 0/6] tools/nolibc: MIPS bugfixes and refactoring

2023-11-05 Thread Thomas Weißschuh
| 25 - tools/testing/selftests/nolibc/run-tests.sh | 2 +- 4 files changed, 28 insertions(+), 7 deletions(-) --- base-commit: 6de6466e41182875252fe09658f9b7d74c4fa43c change-id: 20231105-nolibc-mips-be-892785dd3eaa Best regards, -- Thomas Weißschuh

[PATCH 4/6] selftests/nolibc: explicitly specify ABI for MIPS

2023-11-05 Thread Thomas Weißschuh
More ABIs exist, for better clarity specify it explicitly everywhere. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile

[PATCH 2/6] tools/nolibc: move MIPS ABI validation into arch-mips.h

2023-11-05 Thread Thomas Weißschuh
When installing nolibc to a sysroot arch.h is not used so its ABI check is bypassed. This makes is possible to compile nolibc with a non O32 ABI which may build but can not run. Move the check into arch-mips.h so it will always be evaluated. Signed-off-by: Thomas Weißschuh ---

Re: [PATCH] selftests/nolibc: add script to run testsuite

2023-11-05 Thread Willy Tarreau
On Sun, Nov 05, 2023 at 10:23:05AM +0100, Thomas Weißschuh wrote: > The script can run the testsuite for multiple architectures and provides > an overall test report. > > Furthermore it can automatically download crosstools from > mirrors.kernel.org if requested by the user. > > Example

[PATCH] selftests/nolibc: add script to run testsuite

2023-11-05 Thread Thomas Weißschuh
The script can run the testsuite for multiple architectures and provides an overall test report. Furthermore it can automatically download crosstools from mirrors.kernel.org if requested by the user. Example execution: $ ./run-tests.sh i386: 162 test(s): 162 passed, 0 skipped, 0