[PATCH bpf-next 3/4] selftests/bpf: Use connect_to_fd_opts in do_test in bpf_tcp_ca

2024-05-10 Thread Geliang Tang
From: Geliang Tang This patch uses connect_to_fd_opts() instead of using connect_fd_to_fd() and settcpca() in do_test() in prog_tests/bpf_tcp_ca.c to accept a struct network_helper_opts argument. Then define a dctcp dedicated post_socket_cb callback stg_post_socket_cb(), invoking both cc_cb()

[PATCH bpf-next 4/4] selftests/bpf: Add post_connect_cb callback

2024-05-10 Thread Geliang Tang
From: Geliang Tang For getting rid of the second parameter of do_test(), this patch adds a new callback post_connect_cb in struct network_helper_opts, it will be invoked after connect_fd_to_addr() in connect_to_fd_opts(). Then define a dctcp dedicated post_connect_cb callback, invoking

[PATCH bpf-next 2/4] selftests/bpf: Use start_server_addr in bpf_tcp_ca

2024-05-10 Thread Geliang Tang
From: Geliang Tang This patch uses start_server_addr() in do_test() in prog_tests/bpf_tcp_ca.c to accept a struct network_helper_opts argument instead of using start_server() and settcpca(). Then change the type of the first paramenter of do_test() into a struct network_helper_opts one. Define

[PATCH bpf-next 1/4] selftests/bpf: Use post_socket_cb in connect_to_fd_opts

2024-05-10 Thread Geliang Tang
From: Geliang Tang Since the post_socket_cb() callback is added in struct network_helper_opts, it's make sense to use it not only in __start_server(), but also in connect_to_fd_opts(). Then it can be used to set TCP_CONGESTION sockopt. Add a post_socket_opts type member cb_opts into struct

[PATCH bpf-next 0/4] use network helpers, part 5

2024-05-10 Thread Geliang Tang
From: Geliang Tang This patchset uses post_socket_cb and post_connect_cb callbacks of struct network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp test dedicated code out of do_test() into test_dctcp(). Patch 3 adds a new member in post_socket_opts and patch 4 adds a new

Re: [PATCH v2 12/25] KVM: VMX: Handle FRED event data

2024-05-10 Thread Chao Gao
On Fri, May 10, 2024 at 05:36:03PM +0800, Li, Xin3 wrote: >> >+ if (kvm_is_fred_enabled(vcpu)) { >> >+ u64 event_data = 0; >> >+ >> >+ if (is_debug(intr_info)) >> >+ /* >> >+*

Re: [PATCH v2 11/25] KVM: x86: Add kvm_is_fred_enabled()

2024-05-10 Thread Chao Gao
On Sat, May 11, 2024 at 09:24:12AM +0800, Li, Xin3 wrote: >> >+/* >> >+ * It's enough to check just CR4.FRED (X86_CR4_FRED) to tell if >> >+ * a vCPU is running with FRED enabled, because: >> >+ * 1) CR4.FRED can be set to 1 only _after_ IA32_EFER.LMA = 1. >> >+ * 2) To leave IA-32e mode, CR4.FRED

Re: [PATCH bpf-next 2/4] selftests/bpf: Add RUN_MPTCP_TEST macro

2024-05-10 Thread Geliang Tang
On Tue, 2024-05-07 at 13:51 -0700, Alexei Starovoitov wrote: > On Tue, May 7, 2024 at 9:02 AM Matthieu Baerts > wrote: > > > > Hi Alexei, > > > > Thank you for the review! > > > > On 07/05/2024 16:44, Alexei Starovoitov wrote: > > > On Tue, May 7, 2024 at 3:53 AM Matthieu Baerts (NGI0) > > >

[PATCH net-next v2] selftests: net: local_termination: annotate the expected failures

2024-05-10 Thread Jakub Kicinski
Vladimir said when adding this test: The bridge driver fares particularly badly [...] mainly because it does not implement IFF_UNICAST_FLT. See commit 90b9566aa5cd ("selftests: forwarding: add a test for local_termination.sh"). We don't want to hide the known gaps, but having a test which

Re: [PATCH net-next 1/2] selftests: net: fix timestamp not arriving in cmsg_time.sh

2024-05-10 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 9 May 2024 17:57:04 -0700 you wrote: > On slow machines the SND timestamp sometimes doesn't arrive before > we quit. The test only waits as long as the packet delay, so it's > easy for a race condition to

Re: [PATCH net] selftests: net: add missing config for amt.sh

2024-05-10 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Thu, 9 May 2024 09:19:19 -0700 you wrote: > Test needs IPv6 multicast. smcroute currently crashes when trying > to install a route in a kernel without IPv6 multicast. > > Fixes: c08e8baea78e ("selftests: add amt

Re: [PATCH net] selftests: net: move amt to socat for better compatibility

2024-05-10 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Thu, 9 May 2024 09:19:52 -0700 you wrote: > The test seems to expect that nc will exit after the first > received message. This is not the case with Ncat 7.94. > There are multiple versions of nc out there, switch >

RE: [PATCH v2 11/25] KVM: x86: Add kvm_is_fred_enabled()

2024-05-10 Thread Li, Xin3
> >+/* > >+ * It's enough to check just CR4.FRED (X86_CR4_FRED) to tell if > >+ * a vCPU is running with FRED enabled, because: > >+ * 1) CR4.FRED can be set to 1 only _after_ IA32_EFER.LMA = 1. > >+ * 2) To leave IA-32e mode, CR4.FRED must be cleared first. > >+ * > >+ * More details at FRED Spec

Re: [PATCH net-next 1/2] selftests: net: fix timestamp not arriving in cmsg_time.sh

2024-05-10 Thread Jakub Kicinski
On Thu, 09 May 2024 22:49:50 -0400 Willem de Bruijn wrote: > > struct sock_extended_err *see; > > struct scm_timestamping *ts; > > + unsigned int ts_seen = 0; > > nit: mixing unsigned long and unsigned int Fixed when applying, thanks!

Re: [PATCH v3 17/29] prctl: arch-agnostic prctl for indirect branch tracking

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:35:05PM -0700, Deepak Gupta wrote: > Three architectures (x86, aarch64, riscv) have support for indirect branch > tracking feature in a very similar fashion. On a very high level, indirect > branch tracking is a CPU feature where CPU tracks branches which uses > memory

[PATCH net-next v9 14/14] selftests: add ncdevmem, netcat for devmem TCP

2024-05-10 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,

[PATCH net-next v9 13/14] net: add devmem TCP documentation

2024-05-10 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-14-almasrym...@google.com/ - Bagas doc suggestions. v8: - Applied docs suggestions (Randy). Thanks! v7: - Applied docs suggestions

[PATCH net-next v9 12/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-05-10 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 ---

[PATCH net-next v9 11/14] tcp: RX path for devmem TCP

2024-05-10 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

[PATCH net-next v9 10/14] net: add support for skbs with unreadable frags

2024-05-10 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 v9 09/14] net: support non paged skb frags

2024-05-10 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 --- v6: - Rebased on top of the merged netmem changes. Changes in v1: - Fix illegal_highdma() (Yunsheng). - Rework napi_pp_put_page()

[PATCH net-next v9 08/14] memory-provider: dmabuf devmem memory provider

2024-05-10 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

[PATCH net-next v9 07/14] page_pool: devmem support

2024-05-10 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

[PATCH net-next v9 06/14] page_pool: convert to use netmem

2024-05-10 Thread Mina Almasry
Abstrace the memory type from the page_pool so we can later add support for new memory types. Convert the page_pool to use the new netmem type abstraction, rather than use struct page directly. As of this patch the netmem type is a no-op abstraction: it's always a struct page underneath. All the

[PATCH net-next v9 05/14] netdev: netdevice devmem allocator

2024-05-10 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 v9 04/14] netdev: support binding dma-buf to netdevice

2024-05-10 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

[PATCH net-next v9 03/14] net: netdev netlink api to bind dma-buf to a net device

2024-05-10 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 --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

[PATCH net-next v9 02/14] net: page_pool: create hooks for custom page providers

2024-05-10 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

[PATCH net-next v9 01/14] netdev: add netdev_rx_queue_restart()

2024-05-10 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/all/20240502045410.3524155-4...@davidwei.uk/ (submitted by David). - fixed SPDX license identifier (Simon). - Rebased on top of merged queue API

[PATCH net-next v9 00/14] Device Memory TCP

2024-05-10 Thread Mina Almasry
v9: === Major Changes: -- GVE queue API has been merged. Submitting this version as non-RFC after rebasing on top of the merged API, and dropped the out of tree queue API I was carrying on github. Addressed the little feedback v8 has received. Detailed changelog: --

Re: [PATCH v3 07/29] riscv: usercfi state for task and save/restore of CSR_SSP on trap entry/exit

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:34:55PM -0700, Deepak Gupta wrote: > Carves out space in arch specific thread struct for cfi status and shadow > stack in usermode on riscv. > > This patch does following > - defines a new structure cfi_status with status bit for cfi feature > - defines shadow stack

Re: [PATCH v3 06/29] riscv: zicfiss / zicfilp extension csr and bit definitions

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:34:54PM -0700, Deepak Gupta wrote: > zicfiss and zicfilp extension gets enabled via b3 and b2 in *envcfg CSR. > menvcfg controls enabling for S/HS mode. henvcfg control enabling for VS > while senvcfg controls enabling for U/VU mode. > > zicfilp extension extends

Re: [PATCH v3 03/29] riscv/Kconfig: enable HAVE_EXIT_THREAD for riscv

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:34:51PM -0700, Deepak Gupta wrote: > riscv will need an implementation for exit_thread to clean up shadow stack > when thread exits. If current thread had shadow stack enabled, shadow > stack is allocated by default for any new thread. > > Signed-off-by: Deepak Gupta >

Re: [PATCH v3 02/29] riscv: define default value for envcfg for task

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:34:50PM -0700, Deepak Gupta wrote: > Defines a base default value for envcfg per task. By default all tasks > should have cache zeroing capability. Any future base capabilities that > apply to all tasks can be turned on same way. > > Signed-off-by: Deepak Gupta > --- >

Re: [PATCH v1 bpf-next 00/17] Retire progs/test_sock_addr.c

2024-05-10 Thread Andrii Nakryiko
On Fri, May 10, 2024 at 3:13 PM Jordan Rife wrote: > > Andrii, > > It looks like the PR bot dropped one of the commits from the patch > series which is why it didn't build. > > > selftests/bpf: Handle ATTACH_REJECT test cases > > Is there any way to get it to recreate the PR with all 17 patches?

Re: [PATCH v1 bpf-next 00/17] Retire progs/test_sock_addr.c

2024-05-10 Thread Jordan Rife
Andrii, It looks like the PR bot dropped one of the commits from the patch series which is why it didn't build. > selftests/bpf: Handle ATTACH_REJECT test cases Is there any way to get it to recreate the PR with all 17 patches? -Jordan

Re: [PATCH v1 bpf-next 00/17] Retire progs/test_sock_addr.c

2024-05-10 Thread Andrii Nakryiko
On Fri, May 10, 2024 at 12:08 PM Jordan Rife wrote: > > This patch series migrates remaining tests from bpf/test_sock_addr.c to > prog_tests/sock_addr.c and progs/verifier_sock_addr.c in order to fully > retire the old-style test program and expands test coverage to test > previously untested

Re: [PATCH v6 06/17] riscv: Add vendor extensions to /proc/cpuinfo

2024-05-10 Thread Charlie Jenkins
On Fri, May 10, 2024 at 10:32:19PM +0100, Conor Dooley wrote: > On Fri, May 10, 2024 at 02:25:26PM -0700, Charlie Jenkins wrote: > > On Fri, May 10, 2024 at 09:50:32PM +0100, Conor Dooley wrote: > > > On Tue, May 07, 2024 at 06:03:19PM +0100, Conor Dooley wrote: > > > > On Fri, May 03, 2024 at

Re: [PATCH v6 06/17] riscv: Add vendor extensions to /proc/cpuinfo

2024-05-10 Thread Conor Dooley
On Fri, May 10, 2024 at 02:25:26PM -0700, Charlie Jenkins wrote: > On Fri, May 10, 2024 at 09:50:32PM +0100, Conor Dooley wrote: > > On Tue, May 07, 2024 at 06:03:19PM +0100, Conor Dooley wrote: > > > On Fri, May 03, 2024 at 11:18:21AM -0700, Charlie Jenkins wrote: > > > > All of the supported

Re: [PATCH v6 06/17] riscv: Add vendor extensions to /proc/cpuinfo

2024-05-10 Thread Charlie Jenkins
On Fri, May 10, 2024 at 09:50:32PM +0100, Conor Dooley wrote: > On Tue, May 07, 2024 at 06:03:19PM +0100, Conor Dooley wrote: > > On Fri, May 03, 2024 at 11:18:21AM -0700, Charlie Jenkins wrote: > > > All of the supported vendor extensions that have been listed in > > > riscv_isa_vendor_ext_list

Re: [PATCH v3 10/29] riscv/mm : ensure PROT_WRITE leads to VM_READ | VM_WRITE

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:34:58PM -0700, Deepak Gupta wrote: > `arch_calc_vm_prot_bits` is implemented on risc-v to return VM_READ | > VM_WRITE if PROT_WRITE is specified. Similarly `riscv_sys_mmap` is > updated to convert all incoming PROT_WRITE to (PROT_WRITE | PROT_READ). > This is to make

Re: [PATCH v1 1/1] selftests/sgx: Fix the implicit declaration of asprintf() compiler error

2024-05-10 Thread Mirsad Todorovac
On 5/10/24 22:52, John Hubbard wrote: > On 5/10/24 1:37 PM, Mirsad Todorovac wrote: > ... >> The fix defines __USE_GNU before including in case it isn't already >> defined. After this intervention the module compiles OK. > > Instead of interventions, I believe the standard way to do this is to

Re: [PATCH v1 1/1] selftests/sgx: Fix the implicit declaration of asprintf() compiler error

2024-05-10 Thread John Hubbard
On 5/10/24 1:37 PM, Mirsad Todorovac wrote: ... The fix defines __USE_GNU before including in case it isn't already defined. After this intervention the module compiles OK. Instead of interventions, I believe the standard way to do this is to simply define _GNU_SOURCE before including the

Re: [PATCH v6 06/17] riscv: Add vendor extensions to /proc/cpuinfo

2024-05-10 Thread Conor Dooley
On Tue, May 07, 2024 at 06:03:19PM +0100, Conor Dooley wrote: > On Fri, May 03, 2024 at 11:18:21AM -0700, Charlie Jenkins wrote: > > All of the supported vendor extensions that have been listed in > > riscv_isa_vendor_ext_list can be exported through /proc/cpuinfo. > > > > Signed-off-by: Charlie

[PATCH v1 1/1] selftests/sgx: Fix the implicit declaration of asprintf() compiler error

2024-05-10 Thread Mirsad Todorovac
The selftest/sgx/main.c didn't compile with [-Werror=implicit-function-declaration] [edited]: make[3]: Entering directory 'tools/testing/selftests/sgx' gcc -Wall -Werror -g -Itools/testing/selftests/../../../tools/include -fPIC -c main.c \ -o tools/testing/selftests/sgx/main.o In file

[PATCH v1 1/1] selftests/sgx: Fix the implicit declaration of asprintf() compiler error

2024-05-10 Thread Mirsad Todorovac
The selftest/sgx/main.c didn't compile with [-Werror=implicit-function-declaration] [edited]: make[3]: Entering directory 'tools/testing/selftests/sgx' gcc -Wall -Werror -g -Itools/testing/selftests/../../../tools/include -fPIC -c main.c \ -o tools/testing/selftests/sgx/main.o In file

Re: [PATCH v3 27/29] riscv: Documentation for landing pad / indirect branch tracking

2024-05-10 Thread Charlie Jenkins
On Wed, Apr 03, 2024 at 04:35:15PM -0700, Deepak Gupta wrote: > Adding documentation on landing pad aka indirect branch tracking on riscv > and kernel interfaces exposed so that user tasks can enable it. > > Signed-off-by: Deepak Gupta > --- > Documentation/arch/riscv/zicfilp.rst | 104

Re: [PATCH net-next v9 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment

2024-05-10 Thread Richard Gobert
Eric Dumazet wrote: > On Thu, May 9, 2024 at 8:58 PM Richard Gobert > wrote: >> > >> >> Interesting, I think that is indeed a bug, that exists also in the current >> implementation. >> NAPI_GRO_CB(p)->ip_fixedid (is_atomic before we renamed it in this commit) >> is cleared as being part of

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-05-10 Thread Stephen Boyd
Quoting David Gow (2024-05-04 01:30:34) > On Fri, 3 May 2024 at 09:04, Stephen Boyd wrote: > > > > Quoting David Gow (2024-05-01 00:55:46) > > > On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > > > diff --git a/Documentation/dev-tools/kunit/api/platformdevice.rst > > > >

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

2024-05-10 Thread Manu Bretelle
On 5/10/24, 7:06 AM, "Alexei Starovoitov" mailto:alexei.starovoi...@gmail.com>> wrote: !---| This Message Is From an External Sender |---! On Thu, May 9, 2024 at

[PATCH v1 bpf-next 00/17] Retire progs/test_sock_addr.c

2024-05-10 Thread Jordan Rife
This patch series migrates remaining tests from bpf/test_sock_addr.c to prog_tests/sock_addr.c and progs/verifier_sock_addr.c in order to fully retire the old-style test program and expands test coverage to test previously untested scenarios related to sockaddr hooks. This is a continuation of

[PATCH v1 bpf-next 17/17] selftests/bpf: Expand ATTACH_REJECT tests

2024-05-10 Thread Jordan Rife
This expands coverage for ATTACH_REJECT tests to include connect_unix, sendmsg_unix, recvmsg*, getsockname*, and getpeername*. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 187 ++ 1 file changed, 187 insertions(+) diff --git

[PATCH v1 bpf-next 16/17] selftests/bpf: Expand getsockname and getpeername tests

2024-05-10 Thread Jordan Rife
This expands coverage for getsockname and getpeername hooks to include getsockname4, getsockname6, getpeername4, and getpeername6. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 304 +- .../selftests/bpf/progs/getpeername4_prog.c | 24 ++

[PATCH v1 bpf-next 15/17] sefltests/bpf: Expand sockaddr hook deny tests

2024-05-10 Thread Jordan Rife
This patch expands test coverage for EPERM tests to include connect and bind calls and rounds out the coverage for sendmsg by adding tests for sendmsg_unix. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 342 ++

[PATCH v1 bpf-next 13/17] selftests/bpf: Retire test_sock_addr.(c|sh)

2024-05-10 Thread Jordan Rife
Fully remove test_sock_addr.c and test_sock_addr.sh, as test coverage has been fully moved to prog_tests/sock_addr.c. Signed-off-by: Jordan Rife --- tools/testing/selftests/bpf/.gitignore| 1 - tools/testing/selftests/bpf/Makefile | 4 +-

[PATCH v1 bpf-next 14/17] selftests/bpf: Expand sockaddr program return value tests

2024-05-10 Thread Jordan Rife
This patch expands verifier coverage for program return values to cover bind, connect, sendmsg, getsockname, and getpeername hooks. It also rounds out the recvmsg coverage by adding test cases for recvmsg_unix hooks. Signed-off-by: Jordan Rife --- .../selftests/bpf/progs/verifier_sock_addr.c |

[PATCH v1 bpf-next 12/17] selftests/bpf: Remove redundant sendmsg test cases

2024-05-10 Thread Jordan Rife
Remove these test cases completely, as the same behavior is already covered by other sendmsg* test cases in prog_tests/sock_addr.c. This just rewrites the destination address similar to sendmsg_v4_prog and sendmsg_v6_prog. Signed-off-by: Jordan Rife ---

[PATCH v1 bpf-next 10/17] selftests/bpf: Migrate expected_attach_type tests

2024-05-10 Thread Jordan Rife
Migrates tests from progs/test_sock_addr.c ensuring that programs fail to load when the expected attach type does not match. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 96 +++ tools/testing/selftests/bpf/test_sock_addr.c | 84

[PATCH v1 bpf-next 11/17] selftests/bpf: Migrate ATTACH_REJECT test cases

2024-05-10 Thread Jordan Rife
Migrate test case from bpf/test_sock_addr.c ensuring that program attachment fails when using an inappropriate attach type. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 102 tools/testing/selftests/bpf/test_sock_addr.c | 146 -- 2

[PATCH v1 bpf-next 09/17] selftests/bpf: Migrate wildcard destination rewrite test

2024-05-10 Thread Jordan Rife
Migrate test case from bpf/test_sock_addr.c ensuring that sendmsg respects when sendmsg6 hooks rewrite the destination IP with the IPv6 wildcard IP, [::]. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 17 .../selftests/bpf/progs/sendmsg6_prog.c

[PATCH v1 bpf-next 08/17] selftests/bpf: Migrate sendmsg6 v4 mapped address tests

2024-05-10 Thread Jordan Rife
Migrate test case from bpf/test_sock_addr.c ensuring that sendmsg returns -ENOTSUPP when sending to an IPv4-mapped IPv6 address to prog_tests/sock_addr.c. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 17 + .../selftests/bpf/progs/sendmsg6_prog.c

[PATCH v1 bpf-next 06/17] selftests/bpf: Migrate WILDCARD_IP test

2024-05-10 Thread Jordan Rife
Move wildcard IP sendmsg test case out of bpf/test_sock_addr.c into prog_tests/sock_addr.c. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 50 +++ .../selftests/bpf/progs/sendmsg6_prog.c | 6 +++ tools/testing/selftests/bpf/test_sock_addr.c

[PATCH v1 bpf-next 07/17] selftests/bpf: Migrate sendmsg deny test cases

2024-05-10 Thread Jordan Rife
This set of tests checks that sendmsg calls are rejected (return -EPERM) when the sendmsg* hook returns 0. Replace those in bpf/test_sock_addr.c with corresponding tests in prog_tests/sock_addr.c. Signed-off-by: Jordan Rife --- .../selftests/bpf/prog_tests/sock_addr.c | 98

[PATCH v1 bpf-next 05/17] selftests/bpf: Handle SYSCALL_EPERM and SYSCALL_ENOTSUPP test cases

2024-05-10 Thread Jordan Rife
In preparation to move test cases from bpf/test_sock_addr.c that expect system calls to return ENOTSUPP or EPERM, this patch propagates errno from relevant system calls up to test_sock_addr() where the result can be checked. Signed-off-by: Jordan Rife ---

[PATCH v1 bpf-next 04/17] selftests/bpf: Handle ATTACH_REJECT test cases

2024-05-10 Thread Jordan Rife
In preparation to move test cases from bpf/test_sock_addr.c that expect ATTACH_REJECT, this patch adds BPF_SKEL_FUNCS_RAW to generate load and destroy functions that use bpf_prog_attach() to control the attach_type. The normal load functions use bpf_program__attach_cgroup which does not have the

[PATCH v1 bpf-next 03/17] selftests/bpf: Handle LOAD_REJECT test cases

2024-05-10 Thread Jordan Rife
In preparation to move test cases from bpf/test_sock_addr.c that expect LOAD_REJECT, this patch adds expected_attach_type and extends load_fn to accept an expected attach type and a flag indicating whether or not rejection is expected. Signed-off-by: Jordan Rife ---

[PATCH v1 bpf-next 02/17] selftests/bpf: Use program name for skel load/destroy functions

2024-05-10 Thread Jordan Rife
In preparation to migrate tests from bpf/test_sock_addr.c to sock_addr.c, update BPF_SKEL_FUNCS so that it generates functions based on prog_name instead of skel_name. This allows us to differentiate between programs in the same skeleton. Signed-off-by: Jordan Rife ---

[PATCH v1 bpf-next 01/17] selftests/bpf: Migrate recvmsg* return code tests to verifier_sock_addr.c

2024-05-10 Thread Jordan Rife
This set of tests check that the BPF verifier rejects programs with invalid return codes (recvmsg4 and recvmsg6 hooks can only return 1). This patch replaces the tests in test_sock_addr.c with verifier_sock_addr.c, a new verifier prog_tests for sockaddr hooks, in a step towards fully retiring

Re: [PATCH v22 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-05-10 Thread Steven Rostedt
On Fri, 10 May 2024 14:44:36 -0400 Steven Rostedt wrote: > On Fri, 10 May 2024 12:04:31 +0100 > Vincent Donnefort wrote: > > > > Can you address Shuah's concerns. I'm starting to test patches 1-4 so > > > you only need to send an update to this one, unless of course I find an > > > issue with

Re: [PATCH v22 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-05-10 Thread Steven Rostedt
On Fri, 10 May 2024 12:04:31 +0100 Vincent Donnefort wrote: > > Can you address Shuah's concerns. I'm starting to test patches 1-4 so > > you only need to send an update to this one, unless of course I find an > > issue with one of the others. > > I will do, as well as with the VM_ flags

Kernel Testing & Dependability Micro-Conference at LPC 2024

2024-05-10 Thread Guillaume Tucker
Hello, We're pleased to announce the return of the Kernel Testing & Dependability Micro-Conference at Linux Plumbers 2024: https://lpc.events/event/18/contributions/1665/ You can already submit proposals by selecting the micro-conf in the Track drop-down list:

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-10 Thread John Hubbard
On 5/10/24 10:56 AM, John Hubbard wrote: On 5/10/24 4:52 AM, Ryan Roberts wrote: On 04/05/2024 05:43, John Hubbard wrote: ... It just occured to me that the bug report I was fixing with my attempt was invoking make like this (see [1]): # tools/testing/selftests/fchmodat2$ make CC=clang #

Re: [PATCH] selftests/resctrl: fix clang build warnings related to abs(), labs() calls

2024-05-10 Thread John Hubbard
On 5/10/24 2:06 AM, Ilpo Järvinen wrote: On Wed, 8 May 2024, John Hubbard wrote: When building with clang, via: make LLVM=1 -C tools/testing/selftests ...two types of warnings occur: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-10 Thread John Hubbard
On 5/10/24 4:52 AM, Ryan Roberts wrote: On 04/05/2024 05:43, John Hubbard wrote: ... It just occured to me that the bug report I was fixing with my attempt was invoking make like this (see [1]): # tools/testing/selftests/fchmodat2$ make CC=clang # tools/testing/selftests/openat2$ make

Re: [PATCH v4 55/66] selftests/seccomp: Drop define _GNU_SOURCE

2024-05-10 Thread Kees Cook
On Fri, May 10, 2024 at 12:07:12AM +, Edward Liaw wrote: > _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent > redefinition warnings. > > Reviewed-by: John Hubbard > Reviewed-by: Muhammad Usama Anjum > Signed-off-by: Edward Liaw Acked-by: Kees Cook -- Kees Cook

Re: [PATCH v4 13/66] selftests/exec: Drop duplicate -D_GNU_SOURCE

2024-05-10 Thread Kees Cook
On Fri, May 10, 2024 at 12:06:30AM +, Edward Liaw wrote: > -D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk. > > Signed-off-by: Edward Liaw Thanks! Acked-by: Kees Cook -- Kees Cook

Re: [PATCH net-next] selftests: net: use upstream mtools

2024-05-10 Thread Vladimir Oltean
On Fri, May 10, 2024 at 07:24:24AM -0700, Jakub Kicinski wrote: > On Fri, 10 May 2024 14:28:56 +0300 Vladimir Oltean wrote: > > Check that the deployed mtools version is 3.0 or above. Note that the > > version check breaks compatibility with my fork > > And Joachim's tree from before the tag,

[net-next PATCH] test: hsr: Extend the hsr_redbox.sh to have more SAN devices connected

2024-05-10 Thread Lukasz Majewski
After this change the single SAN device (ns3eth1) is now replaced with two SAN devices - respectively ns4eth1 and ns5eth1. It is possible to extend this script to have more SAN devices connected by adding them to ns3br1 bridge. Signed-off-by: Lukasz Majewski ---

Re: [PATCH net-next] selftests: net: use upstream mtools

2024-05-10 Thread Jakub Kicinski
On Fri, 10 May 2024 14:28:56 +0300 Vladimir Oltean wrote: > Check that the deployed mtools version is 3.0 or above. Note that the > version check breaks compatibility with my fork And Joachim's tree from before the tag, the PR was merged a while back ;) > where I didn't bump the version, but I

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

2024-05-10 Thread Alexei Starovoitov
On Thu, May 9, 2024 at 11:31 AM Matthieu Baerts wrote: > > Hello, > > On 09/05/2024 17:49, Matthieu Baerts (NGI0) wrote: > > From: Geliang Tang > > > > This patch adds a subtest named test_subflow to load and verify the newly > > added mptcp subflow example in test_mptcp. Add a helper

[PATCH v23 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-05-10 Thread Vincent Donnefort
Map a ring-buffer, validate the meta-page before and after emitting few events. Also check ring-buffer mapping boundaries and finally ensure the tracing snapshot is mutually exclusive. Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Muhammad Usama Anjum

Re: [PATCH v2 2/2] selftests/harness: Use 1024 in place of LINE_MAX

2024-05-10 Thread Simon Horman
On Thu, May 09, 2024 at 01:31:13PM +0800, Tao Su wrote: > Android was seeing a compilation error because its C library does not > define LINE_MAX. Since LINE_MAX is only used to determine the size of > test_name[] and 1024 should be enough for the test name, use 1024 > instead of LINE_MAX. > >

Re: [PATCH v2 1/2] Revert "selftests/harness: remove use of LINE_MAX"

2024-05-10 Thread Simon Horman
On Thu, May 09, 2024 at 01:31:12PM +0800, Tao Su wrote: > This reverts commit 8092162335554c8ef5e7f50eff68aa9cfbdbf865. > > asprintf() is declared in stdio.h when defining _GNU_SOURCE, but stdio.h > is so common that many files don’t define _GNU_SOURCE before including > stdio.h, and defining

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-10 Thread Ryan Roberts
On 04/05/2024 05:43, John Hubbard wrote: > When building with clang via: > > make LLVM=1 -C tools/testing/selftests > > two distinct failures occur: > > 1) gcc requires -static-libasan in order to ensure that Address > Sanitizer's library is the first one loaded. However, this leads to >

Re: [PATCH] selftests/mm: hugetlb_madv_vs_map: Avoid test skipping by querying hugepage size at runtime

2024-05-10 Thread Muhammad Usama Anjum
On 5/9/24 2:54 PM, Dev Jain wrote: > Currently, the size used in mmap() is statically defined, leading to > skipping of the test on a hugepage size other than 2 MB, since munmap() > won't free the hugepage for a size greater than 2 MB. Hence, query the > size at runtime. > > Also, there is no

Re: [PATCH v2] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

2024-05-10 Thread Muhammad Usama Anjum
On 5/9/24 1:00 AM, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns about several cases of using a signed integer for the > priority argument to mq_receive(3), which expects an unsigned int. > > Fix this by declaring the type

Re: [PATCH] selftest: epoll_busy_poll: Fix spelling mistake "couldnt" -> "couldn't"

2024-05-10 Thread Simon Horman
On Fri, May 10, 2024 at 09:48:11AM +0100, Colin Ian King wrote: > There is a spelling mistake in a TH_LOG message. Fix it. > > Signed-off-by: Colin Ian King Reviewed-by: Simon Horman

[PATCH net-next] selftests: net: use upstream mtools

2024-05-10 Thread Vladimir Oltean
Joachim kindly merged the IPv6 support in https://github.com/troglobit/mtools/pull/2, so we can just use his version now. A few more fixes subsequently came in for IPv6, so even better. Check that the deployed mtools version is 3.0 or above. Note that the version check breaks compatibility with

Re: [PATCH bpf-next v2 4/4] selftests/bpf: Add a null pointer check for the serial_test_tp_attach_query

2024-05-10 Thread Muhammad Usama Anjum
On 5/10/24 2:58 PM, kunwu.c...@linux.dev wrote: > From: Kunwu Chan > > There is a 'malloc' call, which can be unsuccessful. > Add the malloc failure checking to avoid possible null > dereference. > > Signed-off-by: Kunwu Chan > Suggested-by: Daniel Borkmann > --- > Changes in v2: > -

Re: [PATCH bpf-next v2 3/4] selftests/bpf: Add a null pointer check for the load_btf_spec

2024-05-10 Thread Muhammad Usama Anjum
On 5/10/24 2:58 PM, kunwu.c...@linux.dev wrote: > From: Kunwu Chan > > There is a 'malloc' call, which can be unsuccessful. > Add the malloc failure checking to avoid possible null > dereference. > > Signed-off-by: Kunwu Chan LGTM Reviewed-by: Muhammad Usama Anjum > --- >

Re: [PATCH bpf-next v2 2/4] selftests/bpf/sockopt: Add a null pointer check for the run_test

2024-05-10 Thread Muhammad Usama Anjum
On 5/10/24 2:58 PM, kunwu.c...@linux.dev wrote: > From: Kunwu Chan > > There is a 'malloc' call, which can be unsuccessful. > Add the malloc failure checking to avoid possible null > dereference and give more information > about test fail reasons. > > Signed-off-by: Kunwu Chan LGTM

Re: [PATCH bpf-next v2 1/4] selftests/bpf: Add some null pointer checks

2024-05-10 Thread Muhammad Usama Anjum
On 5/10/24 2:58 PM, kunwu.c...@linux.dev wrote: > From: Kunwu Chan > > There is a 'malloc' call, which can be unsuccessful. > This patch will add the malloc failure checking > to avoid possible null dereference. > > Signed-off-by: Kunwu Chan > --- > tools/testing/selftests/bpf/test_progs.c |

Re: [PATCH v22 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-05-10 Thread Vincent Donnefort
On Tue, May 07, 2024 at 07:35:55PM -0400, Steven Rostedt wrote: > On Fri, 3 May 2024 13:12:56 -0600 > Shuah Khan wrote: > > > On 4/30/24 05:13, Vincent Donnefort wrote: > > > This test maps a ring-buffer and validate the meta-page after reset and > > > after emitting few events. > > > > > >

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-10 Thread Vladimir Oltean
On Thu, May 09, 2024 at 04:55:53PM -0700, Jakub Kicinski wrote: > diff --git a/tools/testing/selftests/net/forwarding/local_termination.sh > b/tools/testing/selftests/net/forwarding/local_termination.sh > index c5b0cbc85b3e..4bba9c78db3e 100755 > ---

[PATCH bpf-next v2 4/4] selftests/bpf: Add a null pointer check for the serial_test_tp_attach_query

2024-05-10 Thread kunwu . chan
From: Kunwu Chan There is a 'malloc' call, which can be unsuccessful. Add the malloc failure checking to avoid possible null dereference. Signed-off-by: Kunwu Chan Suggested-by: Daniel Borkmann --- Changes in v2: - Use ASSERT* instead of CHECK - Add suggested-by tag ---

[PATCH bpf-next v2 3/4] selftests/bpf: Add a null pointer check for the load_btf_spec

2024-05-10 Thread kunwu . chan
From: Kunwu Chan There is a 'malloc' call, which can be unsuccessful. Add the malloc failure checking to avoid possible null dereference. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/test_verifier.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH bpf-next v2 2/4] selftests/bpf/sockopt: Add a null pointer check for the run_test

2024-05-10 Thread kunwu . chan
From: Kunwu Chan There is a 'malloc' call, which can be unsuccessful. Add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/prog_tests/sockopt.c | 6 ++ 1 file

[PATCH bpf-next v2 1/4] selftests/bpf: Add some null pointer checks

2024-05-10 Thread kunwu . chan
From: Kunwu Chan There is a 'malloc' call, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/test_progs.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH bpf-next v2 0/4] Add some 'malloc' failure checks

2024-05-10 Thread kunwu . chan
From: Kunwu Chan The "malloc" call may not be successful.Add the malloc failure checking to avoid possible null dereference. Changes since v1 [1]: - As Daniel Borkmann suggested, change patch 4/4 only - Other 3 patches no changes. [1]

RE: [PATCH v2 12/25] KVM: VMX: Handle FRED event data

2024-05-10 Thread Li, Xin3
> >+ if (kvm_is_fred_enabled(vcpu)) { > >+ u64 event_data = 0; > >+ > >+ if (is_debug(intr_info)) > >+ /* > >+* Compared to DR6, FRED #DB event data > >saved on > >+

  1   2   >