[PATCH v2 5/5] KVM: s390: selftests: Add regression tests for PLO subfunctions

2024-08-19 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the Perform Locked Operation (PLO) subfunction functions. PLO was introduced in the very first 64-bit machine generation. Hence it is assumed PLO is always installed in the Z Arch. The test procedure foll

[PATCH v2 4/5] KVM: s390: selftests: Add regression tests for KMAC, KMC, KM, KIMD and KLMD crypto subfunctions

2024-08-19 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the KMAC (Compute Message Authentication Code), KMC (Cipher Message with Chaining), KM (Cipher Message) KIMD (Compute Intermediate Message Digest) and KLMD (Compute Last Message Digest) crypto functions.

[PATCH v2 3/5] KVM: s390: selftests: Add regression tests for KMCTR, KMF, KMO and PCC crypto subfunctions

2024-08-19 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the KMCTR (Cipher Message with Counter) KMO (Cipher Message with Output Feedback), KMF (Cipher Message with Cipher Feedback) and PCC (Perform Cryptographic Computation) crypto functions. The test procedur

[PATCH v2 2/5] KVM: s390: selftests: Add regression tests for PRNO, KDSA and KMA crypto subfunctions

2024-08-19 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the PRNO (Perform Random Number Operation), KDSA (Compute Digital Signature Authentication) and KMA (Cipher Message with Authentication) crypto functions. The test procedure follows the established patter

[PATCH v2 1/5] KVM: s390: selftests: Add regression tests for SORTL and DFLTCC CPU subfunctions

2024-08-19 Thread Hariharan Mari
Introduce new regression tests to verify the ASM inline block in the SORTL and DFLTCC CPU subfunctions for the s390x architecture. These tests ensure that future changes to the ASM code are properly validated. The test procedure: 1. Create a VM and request the KVM_S390_VM_CPU_MACHINE_SUBFUNC attr

[PATCH v2 0/5] KVM: s390: selftests: Add regression tests for CPU subfunctions

2024-08-19 Thread Hariharan Mari
This patch series introduces a set of regression tests for various s390x CPU subfunctions in KVM. The tests ensure that the KVM implementation accurately reflects the behavior of actual CPU instructions for these subfunctions. The series adds tests for a total of 15 instructions across five patche

Re: [PATCH v2] selftests: kvm: fix mkdir error when building for unsupported arch

2024-08-19 Thread Marc Zyngier
On Mon, 19 Aug 2024 23:15:44 +0100, Oliver Upton wrote: > > On Mon, Aug 19, 2024 at 09:33:17AM -0700, Sean Christopherson wrote: > > And other KVM maintainers, the big question is: if we do the above, would > > now be > > a decent time to bite the bullet and switch to the kernel's canonical arch

Re: [PATCH bpf-next] bpf: use kfunc hooks instead of program types

2024-08-19 Thread Alexei Starovoitov
On Tue, Aug 20, 2024 at 2:03 AM Matteo Croce wrote: > > From: Matteo Croce > > Pass to register_btf_kfunc_id_set() a btf_kfunc_hook directly, instead > of a bpf_prog_type. > Many program types share the same kfunc hook, so some calls to > register_btf_kfunc_id_set() can be removed. > > Tested com

Re: [PATCH v2 8/9] KVM: selftests: Add a CoCo-specific test for KVM_PRE_FAULT_MEMORY

2024-08-19 Thread Aithal, Srikanth
On 8/17/2024 12:53 AM, Pratik R. Sampat wrote: From: Michael Roth SEV, SEV-ES, and SNP have a few corner cases where there is potential for KVM_PRE_FAULT_MEMORY to behave differently depending on when it is issued during initial guest setup. Exercising these various paths requires a bit more fi

[PATCH net-next v21 13/13] netdev: add dmabuf introspection

2024-08-19 Thread Mina Almasry
Add dmabuf information to page_pool stats: $ ./cli.py --spec ../netlink/specs/netdev.yaml --dump page-pool-get ... {'dmabuf': 10, 'id': 456, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208}, {'dmabuf': 10, 'id': 455, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208

[PATCH net-next v21 12/13] selftests: add ncdevmem, netcat for devmem TCP

2024-08-19 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, ncdevmem

[PATCH net-next v21 11/13] net: add devmem TCP documentation

2024-08-19 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya Reviewed-by: Donald Hunter --- v16: - Add documentation on unbinding the NIC from dmabuf (Donald). - Add note that any dmabuf should work (Donald). v9: https://lore.kernel

[PATCH net-next v21 10/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-08-19 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewe

[PATCH net-next v21 09/13] tcp: RX path for devmem TCP

2024-08-19 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 cmsg

[PATCH net-next v21 08/13] net: add support for skbs with unreadable frags

2024-08-19 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

[PATCH net-next v21 07/13] net: support non paged skb frags

2024-08-19 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry Reviewed-by: Eric Dumazet --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section

[PATCH net-next v21 06/13] memory-provider: dmabuf devmem memory provider

2024-08-19 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. 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 the provider in the net_iov. The provider obtains a reference on the netde

[PATCH net-next v21 05/13] page_pool: devmem support

2024-08-19 Thread Mina Almasry
Convert netmem to be a union of struct page and struct netmem. Overload the LSB of struct netmem* to indicate that it's a net_iov, otherwise it's a page. Currently these entries in struct page are rented by the page_pool and used exclusively by the net stack: struct { unsigned long pp_mag

[PATCH net-next v21 04/13] netdev: netdevice devmem allocator

2024-08-19 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates net_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 net_iov struct. Signed-off-by:

[PATCH net-next v21 03/13] netdev: support binding dma-buf to netdevice

2024-08-19 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 genpool

[PATCH net-next v21 02/13] net: netdev netlink api to bind dma-buf to a net device

2024-08-19 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 Reviewed-by: Donald Hunter Reviewed-by: Jakub Kicinski --- v16: - Use subset-of: queue queue-id instead of

[PATCH net-next v21 01/13] netdev: add netdev_rx_queue_restart()

2024-08-19 Thread Mina Almasry
Add netdev_rx_queue_restart(), which resets an rx queue using the queue API recently merged[1]. The queue API was merged to enable the core net stack to reset individual rx queues to actuate changes in the rx queue's configuration. In later patches in this series, we will use netdev_rx_queue_resta

[PATCH net-next v21 00/13] Device Memory TCP

2024-08-19 Thread Mina Almasry
v21: https://patchwork.kernel.org/project/netdevbpf/list/?series=880735&state=* v20 addressed some comments and resolved a test failure, but introduced an unfortunate build error with a config edge case I wasn't testing. v21 simply resolves that error. Major Changes: - Resolve build error wi

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-19 Thread Mina Almasry
On Mon, Aug 19, 2024 at 6:53 PM Jakub Kicinski wrote: > > On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(struct net_device *dev, > > > struct netlink_ext_ack *extack > > > NL_SET_ERR_MSG(extack, "Native and gener

Re: [PATCH net-next] selftests: net/forwarding: spawn sh inside vrf to speed up ping loop

2024-08-19 Thread Hangbin Liu
On Sat, Aug 17, 2024 at 01:36:59PM -0700, Jakub Kicinski wrote: > Looking at timestamped output of netdev CI reveals that > most of the time in forwarding tests for custom route > hashing is spent on a single case, namely the test which > uses ping (mausezahn does not support flow labels). > > On

Re: [PATCH net-next v2] selftests: net: add helper for checking if nettest is available

2024-08-19 Thread Hangbin Liu
On Mon, Aug 19, 2024 at 05:42:17PM -0700, Jakub Kicinski wrote: > diff --git a/tools/testing/selftests/net/settings > b/tools/testing/selftests/net/settings > index ed8418e8217a..a38764182822 100644 > --- a/tools/testing/selftests/net/settings > +++ b/tools/testing/selftests/net/settings > @@ -1 +

Re: [PATCH] selftests/bpf: Fix incorrect parameters in NULL pointer checking

2024-08-19 Thread Hao Ge
Hi I apologize for the confusion.  I mistakenly thought that my previous email (https://lore.kernel.org/all/20240820023447.29002-1-hao...@linux.dev/) didn't send due to network issues on my computer, so I resent it. However, it seems that was not the case. Please kindly disregard this patch

Re: [PATCH v3 1/3] riscv: mm: Use hint address in mmap if available

2024-08-19 Thread Charlie Jenkins
On Tue, Aug 20, 2024 at 09:48:50AM +0800, Levi Zim wrote: > On 2024-08-20 01:00, Charlie Jenkins wrote: > > On Mon, Aug 19, 2024 at 01:55:57PM +0800, Levi Zim wrote: > > > On 2024-03-22 22:06, Palmer Dabbelt wrote: > > > > On Thu, 01 Feb 2024 18:28:06 PST (-0800), Charlie Jenkins wrote: > > > > > O

[PATCH] selftests/bpf: Fix incorrect parameters in NULL pointer checking

2024-08-19 Thread Hao Ge
From: Hao Ge Smatch reported the following warning: ./tools/testing/selftests/bpf/testing_helpers.c:455 get_xlated_program() warn: variable dereferenced before check 'buf' (see line 454) It seems correct,so let's modify it based on it's suggestion. Actually,commit b23ed4d74c4d ("selftes

[PATCH] selftests/bpf: Fix incorrect parameters in NULL pointer checking

2024-08-19 Thread Hao Ge
From: Hao Ge Smatch reported the following warning: ./tools/testing/selftests/bpf/testing_helpers.c:455 get_xlated_program() warn: variable dereferenced before check 'buf' (see line 454) It seems correct,so let's modify it based on it's suggestion. Actually,commit b23ed4d74c4d ("selftes

Re: [PATCH v3 1/3] riscv: mm: Use hint address in mmap if available

2024-08-19 Thread Levi Zim
On 2024-08-20 01:00, Charlie Jenkins wrote: On Mon, Aug 19, 2024 at 01:55:57PM +0800, Levi Zim wrote: On 2024-03-22 22:06, Palmer Dabbelt wrote: On Thu, 01 Feb 2024 18:28:06 PST (-0800), Charlie Jenkins wrote: On Wed, Jan 31, 2024 at 11:59:43PM +0800, Yangyu Chen wrote: On Wed, 2024-01-31 at

[PATCH v3] lib/math: Add int_pow test suite

2024-08-19 Thread Luis Felipe Hernandez
Adds test suite for integer based power function. Signed-off-by: Luis Felipe Hernandez --- Changes in v3: - Fix compiler warning: explicitly define constant as unsigned int - Add changes in patch revisions Changes in v2: - Address review feedback - Add kconfig entry - Use correct dir and file

[PATCH net-next v2] selftests: net: add helper for checking if nettest is available

2024-08-19 Thread Jakub Kicinski
A few tests check if nettest exists in the $PATH before adding $PWD to $PATH and re-checking. They don't discard stderr on the first check (and nettest is built as part of selftests, so it's pretty normal for it to not be available in system $PATH). This leads to output noise: which: no nettest

Re: [PATCH net-next] selftests: net: add helper for checking if nettest is available

2024-08-19 Thread Jakub Kicinski
On Sun, 18 Aug 2024 19:05:46 +0300 Ido Schimmel wrote: > Nice improvement. fib_rule_tests.sh can also benefit from this helper > and so does vrf_route_leaking.sh which assumes 'nettest' is available > in the working directory. > > Do you want to fold the diff below into v2 (I tested it)? Perfect!

Re: [PATCH bpf-next v2 0/6] selftests/bpf: Various sockmap-related fixes

2024-08-19 Thread Martin KaFai Lau
On 7/31/24 3:01 AM, Michal Luczaj wrote: Series takes care of few bugs and missing features with the aim to improve the test coverage of sockmap/sockhash. Last patch is a create_pair() rewrite making use of __attribute__((cleanup)) to handle socket fd lifetime. Applied to bpf-next/net. Thanks.

[PATCH bpf-next] bpf: use kfunc hooks instead of program types

2024-08-19 Thread Matteo Croce
From: Matteo Croce Pass to register_btf_kfunc_id_set() a btf_kfunc_hook directly, instead of a bpf_prog_type. Many program types share the same kfunc hook, so some calls to register_btf_kfunc_id_set() can be removed. Tested compiling the kernel with -Werror=enum-conversion to catch all the occou

Re: [PATCH bpf-next v4 2/2] selftests/bpf: Add mptcp subflow subtest

2024-08-19 Thread Martin KaFai Lau
On 8/17/24 7:13 PM, Geliang Tang wrote: Take a look at a recent example [0]. The mptcp test is under a cgroup already and has the cgroup setup. An extra "cgroup/getsockopt" prog should be enough. That prog can walk the msk->conn_list and use bpf_rdonly_cast (or the >> bpf_core_cast macro in libb

Re: [PATCH v9 00/13] riscv: Add support for xtheadvector

2024-08-19 Thread Charlie Jenkins
On Tue, Aug 13, 2024 at 04:55:27PM +0100, Conor Dooley wrote: > On Mon, Aug 12, 2024 at 05:45:30PM -0700, Charlie Jenkins wrote: > > On Fri, Aug 09, 2024 at 11:31:15PM +0100, Conor Dooley wrote: > > > On Tue, Aug 06, 2024 at 05:31:36PM -0700, Charlie Jenkins wrote: > > > > xtheadvector is a custom

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-19 Thread Jakub Kicinski
On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(struct net_device *dev, > > struct netlink_ext_ack *extack > > NL_SET_ERR_MSG(extack, "Native and generic XDP > > can't be active at the same time"); > >

Re: [PATCH bpf-next v2 0/6] selftests/bpf: Various sockmap-related fixes

2024-08-19 Thread Martin KaFai Lau
On 8/16/24 12:03 PM, Jakub Sitnicki wrote: On Wed, Aug 14, 2024 at 06:14 PM +02, Michal Luczaj wrote: On 8/6/24 19:45, Jakub Sitnicki wrote: On Tue, Aug 06, 2024 at 07:18 PM +02, Michal Luczaj wrote: Great, thanks for the review. With this completed, I guess we can unwind the (mail) stack to [

Re: [PATCH net-next v20 00/13] Device Memory TCP

2024-08-19 Thread Jakub Kicinski
On Mon, 19 Aug 2024 16:38:32 -0400 Mina Almasry wrote: > Looks like in this iteration I resolved the previous test failure, but > introduced a build regression with certain configs: > > ld: vmlinux.o: in function `netdev_rx_queue_restart': > (.text+0x6a4133): undefined reference to `page_pool_chec

Re: [PATCH v2] selftests: kvm: fix mkdir error when building for unsupported arch

2024-08-19 Thread Oliver Upton
On Mon, Aug 19, 2024 at 09:33:17AM -0700, Sean Christopherson wrote: > And other KVM maintainers, the big question is: if we do the above, would now > be > a decent time to bite the bullet and switch to the kernel's canonical arch > paths, > i.e. arm64, s390, and x86? I feel like if we're ever g

Re: [PATCH v3 1/7] mm: Move can_modify_vma to mm/vma.h

2024-08-19 Thread Pedro Falcato
On Mon, Aug 19, 2024 at 9:15 PM Liam R. Howlett wrote: > > * Pedro Falcato [240816 20:18]: > > Move can_modify_vma to vma.h so it can be inlined properly (with > > the intent to remove can_modify_mm callsites). > > > > Signed-off-by: Pedro Falcato > > --- > > mm/mseal.c | 17 - >

Re: [PATCH net-next v20 00/13] Device Memory TCP

2024-08-19 Thread Mina Almasry
On Sun, Aug 18, 2024 at 11:54 PM Mina Almasry wrote: > > v20: > https://patchwork.kernel.org/project/netdevbpf/list/?series=879373&state=* > > > v20 aims to resolve a couple of bug reports against v19, and addresses > some review comments around the page_pool_check_memory_provider > mechanis

Re: [PATCH v3 4/7] mm/mremap: Replace can_modify_mm with can_modify_vma

2024-08-19 Thread Liam R. Howlett
* Pedro Falcato [240816 20:19]: > Delegate all can_modify checks to the proper places. Unmap checks are > done in do_unmap (et al). The source VMA check is done purposefully > before unmapping, to keep the original mseal semantics. > > Signed-off-by: Pedro Falcato Reviewed-by: Liam R. Howlett

Re: [PATCH v3 3/7] mm/mprotect: Replace can_modify_mm with can_modify_vma

2024-08-19 Thread Liam R. Howlett
* Pedro Falcato [240816 20:19]: > Avoid taking an extra trip down the mmap tree by checking the vmas > directly. mprotect (per POSIX) tolerates partial failure. > > Signed-off-by: Pedro Falcato Reviewed-by: Liam R. Howlett > --- > mm/mprotect.c | 12 +++- > 1 file changed, 3 insertio

Re: [PATCH v3 6/7] mm: Remove can_modify_mm()

2024-08-19 Thread Liam R. Howlett
* Pedro Falcato [240816 20:18]: > With no more users in the tree, we can finally remove can_modify_mm(). > > Signed-off-by: Pedro Falcato Reviewed-by: Liam R. Howlett > --- > mm/internal.h | 14 -- > mm/mseal.c| 21 - > 2 files changed, 35 deletions(-) >

Re: [PATCH v3 5/7] mseal: Replace can_modify_mm_madv with a vma variant

2024-08-19 Thread Liam R. Howlett
* Pedro Falcato [240816 20:18]: > Replace can_modify_mm_madv() with a single vma variant, and associated > checks in madvise. > > While we're at it, also invert the order of checks in: > if (unlikely(is_ro_anon(vma) && !can_modify_vma(vma)) > > Checking if we can modify the vma itself (through

Re: [PATCH v3 2/7] mm/munmap: Replace can_modify_mm with can_modify_vma

2024-08-19 Thread Liam R. Howlett
* Pedro Falcato [240816 20:18]: > We were doing an extra mmap tree traversal just to check if the entire > range is modifiable. This can be done when we iterate through the VMAs > instead. > > Signed-off-by: Pedro Falcato Although this has the side effect of potentially splitting the first vma

Re: [PATCH v3 1/7] mm: Move can_modify_vma to mm/vma.h

2024-08-19 Thread Liam R. Howlett
* Pedro Falcato [240816 20:18]: > Move can_modify_vma to vma.h so it can be inlined properly (with > the intent to remove can_modify_mm callsites). > > Signed-off-by: Pedro Falcato > --- > mm/mseal.c | 17 - > mm/vma.h | 28 > 2 files changed, 28 i

Re: [PATCH bpf-next v2 0/6] selftests/bpf: Various sockmap-related fixes

2024-08-19 Thread Jakub Sitnicki
On Wed, Aug 14, 2024 at 06:14 PM +02, Michal Luczaj wrote: > On 8/6/24 19:45, Jakub Sitnicki wrote: >> On Tue, Aug 06, 2024 at 07:18 PM +02, Michal Luczaj wrote: >>> Great, thanks for the review. With this completed, I guess we can unwind >>> the (mail) stack to [1]. Is that ingress-to-local et al.

Re: [PATCH 1/3] selftests/exec: Build both static and non-static load_address tests

2024-08-19 Thread John Hubbard
On 8/19/24 12:41 PM, John Hubbard wrote: On 8/18/24 8:55 PM, Muhammad Usama Anjum wrote: On 8/7/24 3:22 PM, Muhammad Usama Anjum wrote: On 5/9/24 11:16 AM, Kees Cook wrote: ... make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- arm-linux-gnueabihf-gcc -Wall -Wno-nonnull -D_GNU_SOURCE= -Wl,-z,ma

[PATCH net 14/14] mptcp: pm: avoid possible UaF when selecting endp

2024-08-19 Thread Matthieu Baerts (NGI0)
select_local_address() and select_signal_address() both select an endpoint entry from the list inside an RCU protected section, but return a reference to it, to be read later on. If the entry is dereferenced after the RCU unlock, reading info could cause a Use-after-Free. A simple solution is to c

[PATCH net 13/14] selftests: mptcp: join: validate fullmesh endp on 1st sf

2024-08-19 Thread Matthieu Baerts (NGI0)
This case was not covered, and the wrong ID was set before the previous commit. The rest is not modified, it is just that it will increase the code coverage. The right address ID can be verified by looking at the packet traces. We could automate that using Netfilter with some cBPF code for exampl

[PATCH net 12/14] mptcp: pm: fullmesh: select the right ID later

2024-08-19 Thread Matthieu Baerts (NGI0)
When reacting upon the reception of an ADD_ADDR, the in-kernel PM first looks for fullmesh endpoints. If there are some, it will pick them, using their entry ID. It should set the ID 0 when using the endpoint corresponding to the initial subflow, it is a special case imposed by the MPTCP specs. N

[PATCH net 11/14] mptcp: pm: only in-kernel cannot have entries with ID 0

2024-08-19 Thread Matthieu Baerts (NGI0)
The ID 0 is specific per MPTCP connections. The per netns entries cannot have this special ID 0 then. But that's different for the userspace PM where the entries are per connection, they can then use this special ID 0. Fixes: f40be0db0b76 ("mptcp: unify pm get_flags_and_ifindex_by_id") Cc: sta...

[PATCH net 10/14] mptcp: pm: check add_addr_accept_max before accepting new ADD_ADDR

2024-08-19 Thread Matthieu Baerts (NGI0)
The limits might have changed in between, it is best to check them before accepting new ADD_ADDR. Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support") Cc: sta...@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 4 ++-- 1 fi

[PATCH net 09/14] mptcp: pm: only decrement add_addr_accepted for MPJ req

2024-08-19 Thread Matthieu Baerts (NGI0)
Adding the following warning ... WARN_ON_ONCE(msk->pm.add_addr_accepted == 0) ... before decrementing the add_addr_accepted counter helped to find a bug when running the "remove single subflow" subtest from the mptcp_join.sh selftest. Removing a 'subflow' endpoint will first trigger a RM_ADDR,

[PATCH net 08/14] mptcp: pm: only mark 'subflow' endp as available

2024-08-19 Thread Matthieu Baerts (NGI0)
Adding the following warning ... WARN_ON_ONCE(msk->pm.local_addr_used == 0) ... before decrementing the local_addr_used counter helped to find a bug when running the "remove single address" subtest from the mptcp_join.sh selftests. Removing a 'signal' endpoint will trigger the removal of all s

[PATCH net 07/14] mptcp: pm: remove mptcp_pm_remove_subflow()

2024-08-19 Thread Matthieu Baerts (NGI0)
This helper is confusing. It is in pm.c, but it is specific to the in-kernel PM and it cannot be used by the userspace one. Also, it simply calls one in-kernel specific function with the PM lock, while the similar mptcp_pm_remove_addr() helper requires the PM lock. What's left is the pr_debug(), w

[PATCH net 06/14] selftests: mptcp: join: test for flush/re-add endpoints

2024-08-19 Thread Matthieu Baerts (NGI0)
After having flushed endpoints that didn't cause the creation of new subflows, it is important to check endpoints can be re-created, re-using previously used IDs. Before the previous commit, the client would not have been able to re-create the subflow that was previously rejected. The 'Fixes' tag

[PATCH net 05/14] mptcp: pm: re-using ID of unused flushed subflows

2024-08-19 Thread Matthieu Baerts (NGI0)
If no subflows are attached to the 'subflow' endpoints that are being flushed, the corresponding addr IDs will not be marked as available again. Mark all ID as being available when flushing all the 'subflow' endpoints, and reset local_addr_used counter to cover these cases. Note that mptcp_pm_rem

[PATCH net 04/14] selftests: mptcp: join: check re-using ID of closed subflow

2024-08-19 Thread Matthieu Baerts (NGI0)
This test extends "delete and re-add" to validate the previous commit. A new 'subflow' endpoint is added, but the subflow request will be rejected. The result is that no subflow will be established from this address. Later, the endpoint is removed and re-added after having cleared the firewall rul

[PATCH net 03/14] mptcp: pm: re-using ID of unused removed subflows

2024-08-19 Thread Matthieu Baerts (NGI0)
If no subflow is attached to the 'subflow' endpoint that is being removed, the addr ID will not be marked as available again. Mark the linked ID as available when removing the 'subflow' endpoint if no subflow is attached to it. While at it, the local_addr_used counter is decremented if the ID was

[PATCH net 02/14] selftests: mptcp: join: check re-using ID of unused ADD_ADDR

2024-08-19 Thread Matthieu Baerts (NGI0)
This test extends "delete re-add signal" to validate the previous commit. An extra address is announced by the server, but this address cannot be used by the client. The result is that no subflow will be established to this address. Later, the server will delete this extra endpoint, and set a new

[PATCH net 01/14] mptcp: pm: re-using ID of unused removed ADD_ADDR

2024-08-19 Thread Matthieu Baerts (NGI0)
If no subflow is attached to the 'signal' endpoint that is being removed, the addr ID will not be marked as available again. Mark the linked ID as available when removing the address entry from the list to cover this case. Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink") Cc: s

[PATCH net 00/14] mptcp: pm: fix IDs not being reusable

2024-08-19 Thread Matthieu Baerts (NGI0)
ions(+), 74 deletions(-) --- base-commit: 565d121b69980637f040eb4d84289869cdaabedf change-id: 20240819-net-mptcp-pm-reusing-id-eb08827b7be6 Best regards, -- Matthieu Baerts (NGI0)

Re: [PATCH v2 0/9] SEV Kernel Selftests

2024-08-19 Thread Peter Gonda
On Fri, Aug 16, 2024 at 1:23 PM Pratik R. Sampat wrote: > > This series primarily introduces SEV-SNP test for the kernel selftest > framework. It tests boot, ioctl, pre fault, and fallocate in various > combinations to exercise both positive and negative launch flow paths. > > Patch 1 - Adds a wra

Re: [PATCH 1/3] selftests/exec: Build both static and non-static load_address tests

2024-08-19 Thread John Hubbard
On 8/18/24 8:55 PM, Muhammad Usama Anjum wrote: On 8/7/24 3:22 PM, Muhammad Usama Anjum wrote: On 5/9/24 11:16 AM, Kees Cook wrote: On Wed, May 08, 2024 at 07:54:13PM -0700, John Hubbard wrote: Didn't we learn recently, though, that -static-pie is gcc 8.1+, while the kernel's minimum gcc versi

Re: [bug report] selftest: bpf: Test bpf_sk_assign_tcp_reqsk().

2024-08-19 Thread Dan Carpenter
On Mon, Aug 19, 2024 at 12:14:13PM -0700, Kuniyuki Iwashima wrote: > From: Kuniyuki Iwashima > Date: Mon, 19 Aug 2024 12:07:04 -0700 > > > > 488 mssind = (cookie & (3 << 6)) >> 6; > > > > 489 if (ctx->ipv4) { > > > > 490 if (mssind > ARRAY_SIZE(msstab4))

[PATCH RFT v9 8/8] selftests/clone3: Test shadow stack support

2024-08-19 Thread Mark Brown
Add basic test coverage for specifying the shadow stack for a newly created thread via clone3(), including coverage of the newly extended argument structure. We check that a user specified shadow stack can be provided, and that invalid combinations of parameters are rejected. In order to facilita

[PATCH RFT v9 7/8] selftests/clone3: Allow tests to flag if -E2BIG is a valid error code

2024-08-19 Thread Mark Brown
The clone_args structure is extensible, with the syscall passing in the length of the structure. Inside the kernel we use copy_struct_from_user() to read the struct but this has the unfortunate side effect of silently accepting some overrun in the structure size providing the extra data is all zero

[PATCH RFT v9 6/8] selftests/clone3: Factor more of main loop into test_clone3()

2024-08-19 Thread Mark Brown
In order to make it easier to add more configuration for the tests and more support for runtime detection of when tests can be run pass the structure describing the tests into test_clone3() rather than picking the arguments out of it and have that function do all the per-test work. No functional c

[PATCH RFT v9 5/8] selftests/clone3: Remove redundant flushes of output streams

2024-08-19 Thread Mark Brown
Since there were widespread issues with output not being flushed the kselftest framework was modified to explicitly set the output streams unbuffered in commit 58e2847ad2e6 ("selftests: line buffer test program's stdout") so there is no need to explicitly flush in the clone3 tests. Reviewed-by: Ke

[PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-08-19 Thread Mark Brown
Unlike with the normal stack there is no API for configuring the the shadow stack for a new thread, instead the kernel will dynamically allocate a new shadow stack with the same size as the normal stack. This appears to be due to the shadow stack series having been in development since before the m

[PATCH RFT v9 3/8] mm: Introduce ARCH_HAS_USER_SHADOW_STACK

2024-08-19 Thread Mark Brown
Since multiple architectures have support for shadow stacks and we need to select support for this feature in several places in the generic code provide a generic config option that the architectures can select. Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Reviewed-by: Deepak Gupt

[PATCH RFT v9 2/8] selftests: Provide helper header for shadow stack testing

2024-08-19 Thread Mark Brown
While almost all users of shadow stacks should be relying on the dynamic linker and libc to enable the feature there are several low level test programs where it is useful to enable without any libc support, allowing testing without full system enablement. This low level testing is helpful during b

[PATCH RFT v9 1/8] Documentation: userspace-api: Add shadow stack API documentation

2024-08-19 Thread Mark Brown
There are a number of architectures with shadow stack features which we are presenting to userspace with as consistent an API as we can (though there are some architecture specifics). Especially given that there are some important considerations for userspace code interacting directly with the feat

[PATCH RFT v9 0/8] fork: Support shadow stacks in clone3()

2024-08-19 Thread Mark Brown
The kernel has recently added support for shadow stacks, currently x86 only using their CET feature but both arm64 and RISC-V have equivalent features (GCS and Zicfiss respectively), I am actively working on GCS[1]. With shadow stacks the hardware maintains an additional stack containing only the

Re: [PATCH] selftests/ftrace: Fix test to handle both old and new kernels

2024-08-19 Thread Steven Rostedt
On Fri, 14 Jun 2024 12:43:22 -0400 Steven Rostedt wrote: > Shuah, > > Can you take this through your tree? Ping. -- Steve > > Thanks, > > -- Steve > > > On Wed, 15 May 2024 01:36:20 -0400 > Steven Rostedt wrote: > > > From: "Steven Rostedt (Google)" > > > > The function "scheduler_tic

Re: [bug report] selftest: bpf: Test bpf_sk_assign_tcp_reqsk().

2024-08-19 Thread Kuniyuki Iwashima
From: Kuniyuki Iwashima Date: Mon, 19 Aug 2024 12:07:04 -0700 > > > 488 mssind = (cookie & (3 << 6)) >> 6; > > > 489 if (ctx->ipv4) { > > > 490 if (mssind > ARRAY_SIZE(msstab4)) > > >^ > > > Should be >= instead of >.

Re: [bug report] selftest: bpf: Test bpf_sk_assign_tcp_reqsk().

2024-08-19 Thread Kuniyuki Iwashima
From: Dan Carpenter Date: Mon, 19 Aug 2024 21:57:57 +0300 > On Mon, Aug 19, 2024 at 09:54:00PM +0300, Dan Carpenter wrote: > > Hello Kuniyuki Iwashima, > > > > Commit a74712241b46 ("selftest: bpf: Test > > bpf_sk_assign_tcp_reqsk().") from Jan 15, 2024 (linux-next), leads to > > the following Sma

[bug report] selftests/bpf: Factor out get_xlated_program() helper

2024-08-19 Thread Dan Carpenter
Hello Hou Tao, This is a semi-automatic email about new static checker warnings. Commit b4b7a4099b8c ("selftests/bpf: Factor out get_xlated_program() helper") from Jan 5, 2024, leads to the following Smatch complaint: ./tools/testing/selftests/bpf/testing_helpers.c:455 get_xlated_program()

[bug report] selftests/bpf: Add C tests for reference tracking

2024-08-19 Thread Dan Carpenter
Hello Joe Stringer, Commit de375f4e91e3 ("selftests/bpf: Add C tests for reference tracking") from Oct 2, 2018 (linux-next), leads to the following Smatch static checker warning: ./tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c:70 sk_lookup_success() warn: potential poin

Re: [bug report] selftest: bpf: Test bpf_sk_assign_tcp_reqsk().

2024-08-19 Thread Dan Carpenter
On Mon, Aug 19, 2024 at 09:54:00PM +0300, Dan Carpenter wrote: > Hello Kuniyuki Iwashima, > > Commit a74712241b46 ("selftest: bpf: Test > bpf_sk_assign_tcp_reqsk().") from Jan 15, 2024 (linux-next), leads to > the following Smatch static checker warning: > > tools/testing/selftests/bpf/prog

Re: [PATCH v1 15/16] iommu/arm-smmu-v3: Add viommu cache invalidation support

2024-08-19 Thread Nicolin Chen
On Mon, Aug 19, 2024 at 03:47:16PM -0300, Jason Gunthorpe wrote: > On Mon, Aug 19, 2024 at 11:38:22AM -0700, Nicolin Chen wrote: > > On Mon, Aug 19, 2024 at 03:28:11PM -0300, Jason Gunthorpe wrote: > > > On Mon, Aug 19, 2024 at 11:19:39AM -0700, Nicolin Chen wrote: > > > > > > > > But nesting enab

[bug report] selftest: bpf: Test bpf_sk_assign_tcp_reqsk().

2024-08-19 Thread Dan Carpenter
Hello Kuniyuki Iwashima, Commit a74712241b46 ("selftest: bpf: Test bpf_sk_assign_tcp_reqsk().") from Jan 15, 2024 (linux-next), leads to the following Smatch static checker warning: tools/testing/selftests/bpf/progs/test_tcp_custom_syncookie.c:493 tcp_validate_cookie() warn: off

Re: [PATCH v1 15/16] iommu/arm-smmu-v3: Add viommu cache invalidation support

2024-08-19 Thread Jason Gunthorpe
On Mon, Aug 19, 2024 at 11:38:22AM -0700, Nicolin Chen wrote: > On Mon, Aug 19, 2024 at 03:28:11PM -0300, Jason Gunthorpe wrote: > > On Mon, Aug 19, 2024 at 11:19:39AM -0700, Nicolin Chen wrote: > > > > > > But nesting enablment with out viommu is alot less useful than I had > > > > thought :( > >

Re: [PATCH v1 15/16] iommu/arm-smmu-v3: Add viommu cache invalidation support

2024-08-19 Thread Nicolin Chen
On Mon, Aug 19, 2024 at 03:28:11PM -0300, Jason Gunthorpe wrote: > On Mon, Aug 19, 2024 at 11:19:39AM -0700, Nicolin Chen wrote: > > > > But nesting enablment with out viommu is alot less useful than I had > > > thought :( > > > > Actually, without viommu, the hwpt cache invalidate alone could >

Re: [PATCH] kselftest: timers: Fix const correctness

2024-08-19 Thread John Stultz
On Mon, Aug 19, 2024 at 10:58 AM Piotr Zalewski wrote: > > Make timespec pointers, pointers to const in checklist function. As a > consequence, make list parameter in checklist function pointer to const > as well. Const-correctness increases readability. > > Improvement was found by running cppche

Re: [PATCH v1 15/16] iommu/arm-smmu-v3: Add viommu cache invalidation support

2024-08-19 Thread Jason Gunthorpe
On Mon, Aug 19, 2024 at 11:19:39AM -0700, Nicolin Chen wrote: > > But nesting enablment with out viommu is alot less useful than I had > > thought :( > > Actually, without viommu, the hwpt cache invalidate alone could > still support non-SVA case? That is what I thought, but doesn't the guest st

Re: [PATCH v1 05/16] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-08-19 Thread Jason Gunthorpe
On Mon, Aug 19, 2024 at 11:10:03AM -0700, Nicolin Chen wrote: > On Mon, Aug 19, 2024 at 02:33:32PM -0300, Jason Gunthorpe wrote: > > On Thu, Aug 15, 2024 at 05:21:57PM -0700, Nicolin Chen wrote: > > > > > > Why not? The idev becomes linked to the viommu when the dev id is set > > > > > > > Unless

Re: [PATCH v1 08/16] iommufd/viommu: Add IOMMU_VIOMMU_INVALIDATE ioctl

2024-08-19 Thread Nicolin Chen
On Mon, Aug 19, 2024 at 03:20:35PM -0300, Jason Gunthorpe wrote: > On Mon, Aug 19, 2024 at 10:49:56AM -0700, Nicolin Chen wrote: > > On Mon, Aug 19, 2024 at 02:30:56PM -0300, Jason Gunthorpe wrote: > > > On Thu, Aug 15, 2024 at 04:51:39PM -0700, Nicolin Chen wrote: > > > > On Thu, Aug 15, 2024 at 0

Re: [PATCH v1 08/16] iommufd/viommu: Add IOMMU_VIOMMU_INVALIDATE ioctl

2024-08-19 Thread Jason Gunthorpe
On Mon, Aug 19, 2024 at 10:49:56AM -0700, Nicolin Chen wrote: > On Mon, Aug 19, 2024 at 02:30:56PM -0300, Jason Gunthorpe wrote: > > On Thu, Aug 15, 2024 at 04:51:39PM -0700, Nicolin Chen wrote: > > > On Thu, Aug 15, 2024 at 08:24:05PM -0300, Jason Gunthorpe wrote: > > > > On Wed, Aug 07, 2024 at 0

Re: [PATCH v1 15/16] iommu/arm-smmu-v3: Add viommu cache invalidation support

2024-08-19 Thread Nicolin Chen
On Mon, Aug 19, 2024 at 02:36:15PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2024 at 05:50:06PM -0700, Nicolin Chen wrote: > > > Though only driver would know whether it would eventually access > > the vdev_id list, I'd like to keep things in the way of having a > > core-managed VIOMMU objec

Re: [PATCH v1 05/16] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-08-19 Thread Nicolin Chen
On Mon, Aug 19, 2024 at 02:33:32PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2024 at 05:21:57PM -0700, Nicolin Chen wrote: > > > > Why not? The idev becomes linked to the viommu when the dev id is set > > > > > Unless we are also going to enforce the idev is always attached to a > > > neste

[PATCH] kselftest: timers: Fix const correctness

2024-08-19 Thread Piotr Zalewski
Make timespec pointers, pointers to const in checklist function. As a consequence, make list parameter in checklist function pointer to const as well. Const-correctness increases readability. Improvement was found by running cppcheck tool on the patched file as follows: ``` cppcheck --enable=all \

Re: [PATCH v1 08/16] iommufd/viommu: Add IOMMU_VIOMMU_INVALIDATE ioctl

2024-08-19 Thread Nicolin Chen
On Mon, Aug 19, 2024 at 02:30:56PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2024 at 04:51:39PM -0700, Nicolin Chen wrote: > > On Thu, Aug 15, 2024 at 08:24:05PM -0300, Jason Gunthorpe wrote: > > > On Wed, Aug 07, 2024 at 01:10:49PM -0700, Nicolin Chen wrote: > > > > @@ -946,4 +947,40 @@ stru

Re: [PATCH v1 15/16] iommu/arm-smmu-v3: Add viommu cache invalidation support

2024-08-19 Thread Jason Gunthorpe
On Thu, Aug 15, 2024 at 05:50:06PM -0700, Nicolin Chen wrote: > Though only driver would know whether it would eventually access > the vdev_id list, I'd like to keep things in the way of having a > core-managed VIOMMU object (IOMMU_VIOMMU_TYPE_DEFAULT), so the > viommu invalidation handler could h

Re: [PATCH v1 05/16] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-08-19 Thread Jason Gunthorpe
On Thu, Aug 15, 2024 at 05:21:57PM -0700, Nicolin Chen wrote: > > Why not? The idev becomes linked to the viommu when the dev id is set > > > Unless we are also going to enforce the idev is always attached to a > > nested then I don't think we need to check it here. > > > > Things will definatel

  1   2   >