[PATCH 5.10 5/5] net: test for not too small csum_start in virtio_net_hdr_to_skb()

2025-01-31 Thread Denis Arefev
From: Eric Dumazet commit 49d14b54a527289d09a9480f214b8c586322310a upstream. syzbot was able to trigger this warning [1], after injecting a malicious packet through af_packet, setting skb->csum_start and thus the transport header to an incorrect value. We can at least make sure the transport he

[PATCH bpf-next v4 13/14] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
XDP programs loaded on egress is tested by test_xdp_redirect_multi.sh but not by the test_progs framework. Add a test case in test_xdp_veth.c to test the XDP program on egress. Use the same BPF program than test_xdp_redirect_multi.sh that replaces the source MAC address by one provided through a

[PATCH bpf-next v4 10/14] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
The XDP redirection is tested without any flag provided to the xdp_attach() function. Add two subtests that check the correct behaviour with XDP_FLAGS_{DRV/SKB}_MODE flags Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp

[PATCH v7 6/6] selftests/mm: use PIDFD_SELF in guard pages test

2025-01-30 Thread Lorenzo Stoakes
Now we have PIDFD_SELF available for process_madvise(), make use of it in the guard pages test. This is both more convenient and asserts that PIDFD_SELF works as expected. Signed-off-by: Lorenzo Stoakes --- tools/testing/selftests/mm/Makefile | 4 tools/testing/selftests/mm/guard

[PATCH rcu v2] 01/11] torture: Add get_torture_init_jiffies() for test-start time

2025-01-30 Thread Paul E. McKenney
This commit adds a get_torture_init_jiffies() function that returns the value of the jiffies counter at the start of the test, that is, at the point where torture_init_begin() was invoked. This will be used to enable torture-test holdoffs for tests implemented using per-CPU kthreads, which are

Re: [PATCH rcu 0/11] Torture-test updates

2025-01-30 Thread Paul E. McKenney
Hello! This series contains torture-test updates: 1. Add get_torture_init_jiffies() for test-start time. 2. Add a test_boost_holdoff module parameter. 3. Include grace-period sequence numbers in failure/close-call. 4. Expand failure/close-call grace-period output. 5

[PATCH rcu v2] 14/20] rcutorture: Add ability to test srcu_read_{,un}lock_fast()

2025-01-30 Thread Paul E. McKenney
This commit permits rcutorture to test srcu_read_{,un}lock_fast(), which is specified by the rcutorture.reader_flavor=0x8 kernel boot parameter. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- kernel/rcu/rcutorture.c

Re: [RFC net-next 2/2] selftests: drv-net: Test queue xsk attribute

2025-01-30 Thread Joe Damato
On Wed, Jan 29, 2025 at 06:07:51PM -0800, Jakub Kicinski wrote: > On Wed, 29 Jan 2025 17:24:25 + Joe Damato wrote: > > Test that queues which are used for AF_XDP have the xsk attribute set. > > > diff --git a/tools/testing/selftests/drivers/.gitignore > > b/tools/t

Re: [RFC net-next 2/2] selftests: drv-net: Test queue xsk attribute

2025-01-29 Thread Jakub Kicinski
On Wed, 29 Jan 2025 17:24:25 + Joe Damato wrote: > Test that queues which are used for AF_XDP have the xsk attribute set. > diff --git a/tools/testing/selftests/drivers/.gitignore > b/tools/testing/selftests/drivers/.gitignore > index 09e23b5afa96..3c109144f7ff 100644 > ---

[RFC net-next 2/2] selftests: drv-net: Test queue xsk attribute

2025-01-29 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk attribute set. Signed-off-by: Joe Damato --- tools/testing/selftests/drivers/.gitignore| 1 + tools/testing/selftests/drivers/net/Makefile | 3 + tools/testing/selftests/drivers/net/queues.py | 32 ++- .../selftests/drivers/net

[PATCH bpf-next v3 13/14] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
XDP programs loaded on egress is tested by test_xdp_redirect_multi.sh but not by the test_progs framework. Add a test case in test_xdp_veth.c to test the XDP program on egress. Use the same BPF program than test_xdp_redirect_multi.sh that replaces the source MAC address by one provided through a

[PATCH bpf-next v3 10/14] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
The XDP redirection is tested without any flag provided to the xdp_attach() function. Add two subtests that check the correct behaviour with XDP_FLAGS_{DRV/SKB}_MODE flags Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp

[PATCH v3 6/6] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO

2025-01-28 Thread Dmitry V. Levin
LOG_KILL_TRACEE("%s: exit stop mismatch", text); + } + ASSERT_EQ(exp_exit->rval, info->exit.rval) { + LOG_KILL_TRACEE("%s: exit stop mismatch", text); + } +} + +TEST(set_syscall_info) +{ + const pid_t tracer_pid = getpid(); +

[PATCH v6 3/3] selftests/lam: Test get_user() LAM pointer handling

2025-01-27 Thread Maciej Wieczor-Retman
Recent change in how get_user() handles pointers [1] has a specific case for LAM. It assigns a different bitmask that's later used to check whether a pointer comes from userland in get_user(). Add test case to LAM that utilizes a ioctl (FIOASYNC) syscall which uses get_user() i

[PATCH v6 2/3] selftests/lam: Skip test if LAM is disabled

2025-01-27 Thread Maciej Wieczor-Retman
Until LASS is merged into the kernel [1], LAM is left disabled in the config file. Running the LAM selftest with disabled LAM only results in unhelpful output. Use one of LAM syscalls() to determine whether the kernel was compiled with LAM support (CONFIG_ADDRESS_MASKING) or not. Skip running the

Re: [PATCH v5 3/3] selftests/lam: Test get_user() LAM pointer handling

2025-01-24 Thread Maciej Wieczor-Retman
On 2025-01-24 at 08:32:18 -0800, Dave Hansen wrote: >On 11/27/24 09:35, Maciej Wieczor-Retman wrote: >... >> +switch (test->later) { >> +case GET_USER_USER: >> +/* Control group - properly tagger user pointer */ >> +ptr = (void *

Re: [PATCH v5 2/3] selftests/lam: Skip test if LAM is disabled

2025-01-24 Thread Maciej Wieczor-Retman
On 2025-01-24 at 08:23:09 -0800, Dave Hansen wrote: >On 11/27/24 09:35, Maciej Wieczor-Retman wrote: >> +static inline int kernel_has_lam(void) >> +{ >> +unsigned long bits; >> + >> +syscall(SYS_arch_prctl, ARCH_GET_MAX_TAG_BITS, &bits); >> +return !!bits; >> +} > >Generally, I'm less p

Re: [PATCH v5 3/3] selftests/lam: Test get_user() LAM pointer handling

2025-01-24 Thread Dave Hansen
On 11/27/24 09:35, Maciej Wieczor-Retman wrote: ... > + switch (test->later) { > + case GET_USER_USER: > + /* Control group - properly tagger user pointer */ > + ptr = (void *)set_metadata((uint64_t)ptr, test->lam); > + br

Re: [PATCH v5 2/3] selftests/lam: Skip test if LAM is disabled

2025-01-24 Thread Dave Hansen
On 11/27/24 09:35, Maciej Wieczor-Retman wrote: > +static inline int kernel_has_lam(void) > +{ > + unsigned long bits; > + > + syscall(SYS_arch_prctl, ARCH_GET_MAX_TAG_BITS, &bits); > + return !!bits; > +} Generally, I'm less picky about selftest/ code than in-kernel code. But people r

Re: [PATCH 3/4] rcu: Update TREE05.boot to test normal synchronize_rcu()

2025-01-23 Thread Paul E. McKenney
On Thu, Jan 23, 2025 at 07:58:27PM +0100, Uladzislau Rezki (Sony) wrote: > Add extra parameters for rcutorture module. One is the "nfakewriters" > which is set -1. There will be created number of test-kthreads which > correspond to number of CPUs in a test system. Those thread

[PATCH 3/4] rcu: Update TREE05.boot to test normal synchronize_rcu()

2025-01-23 Thread Uladzislau Rezki (Sony)
Add extra parameters for rcutorture module. One is the "nfakewriters" which is set -1. There will be created number of test-kthreads which correspond to number of CPUs in a test system. Those threads randomly invoke synchronize_rcu() call. Apart of that "rcu_normal" is set

[PATCH v2 0/5] selftests/nolibc: test kernel configuration cleanups

2025-01-22 Thread Thomas Weißschuh
lways keep test kernel configuration up to date tools/testing/selftests/nolibc/Makefile | 17 + tools/testing/selftests/nolibc/run-tests.sh | 7 +++ 2 files changed, 8 insertions(+), 16 deletions(-) --- base-commit: 21266b8df5224c4f677acf9f353eecc9094731f0 change-id: 20250

[PATCH v2 5/5] selftests/nolibc: always keep test kernel configuration up to date

2025-01-22 Thread Thomas Weißschuh
Avoid using a stale test kernel configuration by always synchronizing it to the current source tree. kbuild is smart enough to avoid spurious rebuilds. Shuffle the code around a bit to keep all the commands with side-effects together. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests

Re: [PATCH 5/5] selftests/nolibc: always keep test kernel configuration up to date

2025-01-22 Thread Willy Tarreau
On Wed, Jan 22, 2025 at 08:00:28PM +0100, Thomas Weißschuh wrote: > Hi Willy! > > On 2025-01-22 19:52:06+0100, Willy Tarreau wrote: > > On Wed, Jan 22, 2025 at 07:41:48PM +0100, Thomas Weißschuh wrote: > > > @@ -173,7 +170,7 @@ test_arch() { > > > exit 1 > > > esac > > > prin

Re: [PATCH 5/5] selftests/nolibc: always keep test kernel configuration up to date

2025-01-22 Thread Willy Tarreau
Hi Thomas! On Wed, Jan 22, 2025 at 07:41:48PM +0100, Thomas Weißschuh wrote: > @@ -173,7 +170,7 @@ test_arch() { > exit 1 > esac > printf '%-15s' "$arch:" > - swallow_output "${MAKE[@]}" CFLAGS_EXTRA="$CFLAGS_EXTRA" "$test_target" > V=1 > + swallow_output

Re: [PATCH 5/5] selftests/nolibc: always keep test kernel configuration up to date

2025-01-22 Thread Thomas Weißschuh
Hi Willy! On 2025-01-22 19:52:06+0100, Willy Tarreau wrote: > On Wed, Jan 22, 2025 at 07:41:48PM +0100, Thomas Weißschuh wrote: > > @@ -173,7 +170,7 @@ test_arch() { > > exit 1 > > esac > > printf '%-15s' "$arch:" > > - swallow_output "${MAKE[@]}" CFLAGS_EXTRA="$CFLAG

[PATCH 5/5] selftests/nolibc: always keep test kernel configuration up to date

2025-01-22 Thread Thomas Weißschuh
Avoid using a stale test kernel configuration by always synchronizing it to the current source tree. kbuild is smart enough to avoid spurious rebuilds. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/run-tests.sh | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff

[PATCH 0/5] selftests/nolibc: test kernel configuration cleanups

2025-01-22 Thread Thomas Weißschuh
mrproper target selftests/nolibc: execute defconfig before other targets selftests/nolibc: always keep test kernel configuration up to date tools/testing/selftests/nolibc/Makefile | 17 + tools/testing/selftests/nolibc/run-tests.sh | 5 + 2 files changed, 6

[PATCH v2 3/3] selftests/mm: test splitting file-backed THP to any lower order.

2025-01-22 Thread Zi Yan
Now split_huge_page*() supports shmem THP split to any lower order. Test it. The test now reads file content out after split to check if the split corrupts the file data. Signed-off-by: Zi Yan Reviewed-by: Baolin Wang Tested-by: Baolin Wang --- tools/testing/selftests/mm

[PATCH 3/3] selftests/mm: test splitting file-backed THP to any lower order.

2025-01-22 Thread Zi Yan
Now split_huge_page*() supports shmem THP split to any lower order. Test it. The test now reads file content out after split to check if the split corrupts the file data. Signed-off-by: Zi Yan Reviewed-by: Baolin Wang Tested-by: Baolin Wang --- .../selftests/mm/split_huge_page_test.c

Re: [PATCH v5 03/10] selftests/mm: test splitting file-backed THP to any lower order.

2025-01-21 Thread Baolin Wang
On 2025/1/17 05:10, Zi Yan wrote: Now split_huge_page*() supports shmem THP split to any lower order. Test it. The test now reads file content out after split to check if the split corrupts the file data. Signed-off-by: Zi Yan LGTM. Reviewed-by: Baolin Wang Tested-by: Baolin Wang

[PATCH bpf-next v2 09/10] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
XDP programs loaded on egress is tested by test_xdp_redirect_multi.sh but not by the test_progs framework. Add a test case in test_xdp_veth.c to test the XDP program on egress. Use the same BPF program than test_xdp_redirect_multi.sh that replaces the source MAC address by one provided through a

[PATCH bpf-next v2 06/10] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
The XDP redirection is tested without any flag provided to the xdp_attach() function. Add two subtests that check the correct behaviour with XDP_FLAGS_{DRV/SKB}_MODE flags Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 27 +++

[PATCH bpf-next 09/10] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
XDP programs loaded on egress is tested by test_xdp_redirect_multi.sh but not by the test_progs framework. Add a test case in test_xdp_veth.c to test the XDP program on egress. Use the same BPF program than test_xdp_redirect_multi.sh that replaces the source MAC address by one provided through a

[PATCH bpf-next 06/10] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
The XDP redirection is tested without any flag provided to the xdp_attach() function. Add two subtests that check the correct behaviour with XDP_FLAGS_{DRV/SKB}_MODE flags Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 27 +++

Re: [PATCH v2 6/6] KVM: x86: selftests: Test PerfMonV2

2025-01-20 Thread Colton Lewis
Sean Christopherson writes: On Wed, Sep 18, 2024, Colton Lewis wrote: Test PerfMonV2, which defines global registers to enable multiple performance counters with a single MSR write, in its own function. If the feature is available, ensure the global control register has the ability to

Re: [PATCH v2 5/6] KVM: x86: selftests: Test core events

2025-01-20 Thread Colton Lewis
Sean Christopherson writes: On Wed, Sep 18, 2024, Colton Lewis wrote: Test events on core counters by iterating through every combination of events in amd_pmu_zen_events with every core counter. For each combination, calculate the appropriate register addresses for the event selection

Re: [PATCH v2 4/6] KVM: x86: selftests: Test read/write core counters

2025-01-20 Thread Colton Lewis
Sean Christopherson writes: On Wed, Sep 18, 2024, Colton Lewis wrote: Run a basic test to ensure we can write an arbitrary value to the core counters and read it back. Signed-off-by: Colton Lewis --- .../selftests/kvm/x86_64/pmu_counters_test.c | 54 +++ 1 file changed

[for-next][PATCH 3/3] selftests/ftrace: Add test that tests event :mod: commands

2025-01-17 Thread Steven Rostedt
From: Steven Rostedt Now that here's a :mod: command that can be sent into set_event, add a test that tests its use. Both setting events for a loaded module, as well as caching what events to set for a module that is not loaded yet. Cc: Shuah Khan Cc: Masami Hiramatsu Cc: Mark Rutlan

Re: [PATCH net-next 0/1] selftests: drv-net-hw: fix pp_alloc_fail test error

2025-01-16 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Wed, 15 Jan 2025 10:13:11 -0800 you wrote: > The tool pp_alloc_fail.py tested error recovery by injecting errors > into page_pool_alloc_pages(). Perhaps due to the netmems conversion, > page_pool_put_full_page() do

[PATCH v5 03/10] selftests/mm: test splitting file-backed THP to any lower order.

2025-01-16 Thread Zi Yan
Now split_huge_page*() supports shmem THP split to any lower order. Test it. The test now reads file content out after split to check if the split corrupts the file data. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 30 ++- 1 file changed, 23

[PATCH rcu 0/11] Torture-test updates

2025-01-16 Thread Paul E. McKenney
Hello! This series contains torture-test updates: 1. Add get_torture_init_jiffies() for test-start time. 2. Add a test_boost_holdoff module parameter. 3. Include grace-period sequence numbers in failure/close-call. 4. Expand failure/close-call grace-period output. 5

[PATCH rcu 01/11] torture: Add get_torture_init_jiffies() for test-start time

2025-01-16 Thread Paul E. McKenney
This commit adds a get_torture_init_jiffies() function that returns the value of the jiffies counter at the start of the test, that is, at the point where torture_init_begin() was invoked. This will be used to enable torture-test holdoffs for tests implemented using per-CPU kthreads, which are

[PATCH rcu 14/17] rcutorture: Add ability to test srcu_read_{,un}lock_fast()

2025-01-16 Thread Paul E. McKenney
This commit permits rcutorture to test srcu_read_{,un}lock_fast(), which is specified by the rcutorture.reader_flavor=0x8 kernel boot parameter. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- kernel/rcu/rcutorture.c

[PATCH v6 1/4] PCI: endpoint: pci-epf-test: Fix the check for DMA MEMCPY test

2025-01-16 Thread Manivannan Sadhasivam
Currently, if DMA MEMCPY test is requested by the host, and if the endpoint DMA controller supports DMA_PRIVATE, the test will fail. This is not correct since there is no check for DMA_MEMCPY capability and the DMA controller can support both DMA_PRIVATE and DMA_MEMCPY. So fix the check and also

Re: [PATCH v5 1/4] PCI: endpoint: pci-epf-test: Fix the check for DMA MEMCPY test

2025-01-16 Thread Niklas Cassel
On Thu, Jan 16, 2025 at 07:21:03PM +0530, Manivannan Sadhasivam wrote: > Currently, if DMA MEMCPY test is requested by the host, and if the endpoint > DMA controller supports DMA_PRIVATE, the test will fail. This is not > correct since there is no check for DMA_MEMCPY capability an

[PATCH v5 1/4] PCI: endpoint: pci-epf-test: Fix the check for DMA MEMCPY test

2025-01-16 Thread Manivannan Sadhasivam
Currently, if DMA MEMCPY test is requested by the host, and if the endpoint DMA controller supports DMA_PRIVATE, the test will fail. This is not correct since there is no check for DMA_MEMCPY capability and the DMA controller can support both DMA_PRIVATE and DMA_MEMCPY. So fix the check and also

[PATCH net-next 0/1] selftests: drv-net-hw: fix pp_alloc_fail test error

2025-01-15 Thread John Daley
The tool pp_alloc_fail.py tested error recovery by injecting errors into page_pool_alloc_pages(). Perhaps due to the netmems conversion, page_pool_put_full_page() does not end up calling that function. page_pool_alloc_netmems() seems to be the base function for all the the allocation functions in

Re: [PATCH v2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-15 Thread Petr Mladek
Hi Filipe, first, thanks for the test. It is good. I just suggest a lot of clean up ;-) On Sat 2025-01-11 15:42:27, Filipe Xavier wrote: > This new test makes sure that ftrace can trace a > function that was introduced by a livepatch. > --- > Changes in v2: > - functions.sh: adde

Re: [PATCH v2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-15 Thread Joe Lawrence
On 1/14/25 12:18, Marcos Paulo de Souza wrote: > On Sat, 2025-01-11 at 15:42 -0300, Filipe Xavier wrote: >> This new test makes sure that ftrace can trace a >> function that was introduced by a livepatch. >> >> Signed-off-by: Filipe Xavier > > Thanks for the

Re: [PATCH v6 3/3] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-15 Thread Andrew Jones
On Wed, Jan 15, 2025 at 07:13:29PM +0800, Celeste Liu wrote: > This test checks that orig_a0 and a0 can be modified and accessed > independently. > > Co-developed-by: Quan Zhou > Signed-off-by: Quan Zhou > Co-developed-by: Charlie Jenkins > Signed-off-by: Charlie Jenkins

Re: [PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-15 Thread Celeste Liu
t; +#define sizeof_field(TYPE, MEMBER) sizeofTYPE *)0)->MEMBER)) >>>> +#endif >>>> +#ifndef offsetofend >>>> +#define offsetofend(TYPE, MEMBER) \ >>>> + (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER)) >>>> +#endif >>>

[PATCH v6 3/3] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-15 Thread Celeste Liu
This test checks that orig_a0 and a0 can be modified and accessed independently. Co-developed-by: Quan Zhou Signed-off-by: Quan Zhou Co-developed-by: Charlie Jenkins Signed-off-by: Charlie Jenkins Reviewed-by: Björn Töpel Signed-off-by: Celeste Liu --- tools/testing/selftests/riscv/abi

Re: [PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-15 Thread Andrew Jones
R)) > >> +#endif > >> +#ifndef offsetofend > >> +#define offsetofend(TYPE, MEMBER) \ > >> + (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER)) > >> +#endif > > > > I think this is the sixth test to define these. We should copy >

Re: [PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-15 Thread Celeste Liu
On 2025-01-15 17:14, Andrew Jones wrote: > On Wed, Jan 15, 2025 at 04:24:59AM +0800, Celeste Liu wrote: >> This test checks that orig_a0 and a0 can be modified and accessed >> independently. >> >> Co-developed-by: Quan Zhou >> Signed-off-by: Quan Zhou &g

Re: [PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-15 Thread Andrew Jones
On Wed, Jan 15, 2025 at 04:24:59AM +0800, Celeste Liu wrote: > This test checks that orig_a0 and a0 can be modified and accessed > independently. > > Co-developed-by: Quan Zhou > Signed-off-by: Quan Zhou > Co-developed-by: Charlie Jenkins > Signed-off-by: Charlie Jenkins

[PATCH v1 16/19] selftests/livepatch: Remove obsolete test modules for per-object callbacks

2025-01-15 Thread Petr Mladek
The per-object callbacks have been deprecated in favor of per-state callbacks and are scheduled for removal. This commit removes the corresponding test modules that are no longer needed. These test modules have been superseded by new tests that exercise the per-state callback functionality

[PATCH net-next 0/1] selftests: drv-net-hw: fix pp_alloc_fail test error

2025-01-14 Thread John Daley
The tool pp_alloc_fail.py tested error recovery by injecting errors into page_pool_alloc_pages(). Perhaps due to the netmems conversion, page_pool_put_full_page() does not end up calling that function. page_pool_alloc_netmems() seems to be the base function for all the the allocation functions in

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2025-01-14 Thread Celeste Liu
On 2025-01-10 11:34, Charlie Jenkins wrote: > On Thu, Dec 26, 2024 at 11:21:59PM +0800, Celeste Liu wrote: >> >> On 2024-12-26 21:35, Dmitry V. Levin wrote: >>> On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: >>>> This test checks that orig_a0 allo

[PATCH v5 2/2] riscv: selftests: Add a ptrace test to verify a0 and orig_a0 access

2025-01-14 Thread Celeste Liu
This test checks that orig_a0 and a0 can be modified and accessed independently. Co-developed-by: Quan Zhou Signed-off-by: Quan Zhou Co-developed-by: Charlie Jenkins Signed-off-by: Charlie Jenkins Reviewed-by: Björn Töpel Signed-off-by: Celeste Liu --- tools/testing/selftests/riscv/abi

Re: [PATCH v2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-14 Thread Marcos Paulo de Souza
On Sat, 2025-01-11 at 15:42 -0300, Filipe Xavier wrote: > This new test makes sure that ftrace can trace a > function that was introduced by a livepatch. > > Signed-off-by: Filipe Xavier Thanks for the new test Filipe! I have some nits below, but these don't need to be addre

[PATCH v2 7/7] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO

2025-01-13 Thread Dmitry V. Levin
tracee(pid); \ + TH_LOG("wait #%d: " fmt,\ + ptrace_stop, ##__VA_ARGS__); \ + } while (0) + +struct si_entry { + int nr; + __kernel_ulong_t args[6]; +}; +struct si_exit { + unsigned int is_error; + i

[PATCH v2] tools/virtio: Add DMA_MAPPING_ERROR and sg_dma_len api define for virtio test

2025-01-13 Thread Yufeng Wang
irtio/virtio_ring.c:1535:41: error:'DMA_MAPPING_ERROR'Undeclared (first use within this function) 1535 | DMA_MAPPING_ERROR : addr; | ^ Fixes: ("virtio_ring: perform premapped operations based on per-buffer&quo

[PATCH net-next v18 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-13 Thread Antonio Quartulli
|5 + tools/testing/selftests/net/ovpn/ovpn-cli.c| 2367 tools/testing/selftests/net/ovpn/tcp_peers.txt |5 + .../testing/selftests/net/ovpn/test-chachapoly.sh |9 + tools/testing/selftests/net/ovpn/test-float.sh |9 + tools/testing/selftests/net

[PATCH] tools/virtio: Add DMA_MAPPING_ERROR define for virtio test

2025-01-13 Thread Yufeng Wang
Fixes: ("virtio_ring: perform premapped operations based on per-buffer") also add DMA_MAPPING_ERROR define for virtio test. Signed-off-by: Yufeng Wang --- tools/virtio/linux/dma-mapping.h | 12 1 file changed, 12 insertions(+) diff --git a/tools/virtio/linux/dma-mapping

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2025-01-12 Thread Celeste Liu
On 2025-01-10 11:34, Charlie Jenkins wrote: > On Thu, Dec 26, 2024 at 11:21:59PM +0800, Celeste Liu wrote: >> >> On 2024-12-26 21:35, Dmitry V. Levin wrote: >>> On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: >>>> This test checks that orig_a0 allo

Re: [PATCH net-next v17 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-11 Thread Antonio Quartulli
Hey Jakub, I just realized that I forgot to fix the nla_get_uint clash triggered on Fedora. However, I'd rather not send a new patchset right away... Maybe we will be happy with this version and then I will just resend this patch alone. Best Regards, -- Antonio Quartulli OpenVPN Inc.

[PATCH v2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-11 Thread Filipe Xavier
This new test makes sure that ftrace can trace a function that was introduced by a livepatch. Signed-off-by: Filipe Xavier --- Changes in v2: - functions.sh: added reset tracing on push and pop_config. - test-ftrace.sh: enabled tracing_on before test init. - nitpick: added double quotations on

Re: [PATCH] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-11 Thread Joe Lawrence
On 1/10/25 12:13, Filipe Xavier wrote: > Em 07/01/2025 13:23, Joe Lawrence escreveu: > >> On Thu, Jan 02, 2025 at 03:42:10PM -0300, Filipe Xavier wrote: >>> This new test makes sure that ftrace can trace a >>> function that was introduced by a livepatch. >>>

[PATCH 1/2] selftests/mm: use selftests framework to print test result.

2025-01-10 Thread Zi Yan
Otherwise the number of tests does not match the reality. Fixes: 391e86971161 ("mm: selftest to verify zero-filled pages are mapped to zeropage") Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 34 +++ 1 file changed, 12 insertions(+), 22 deletions(-)

[PATCH net-next v17 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-10 Thread Antonio Quartulli
|5 + tools/testing/selftests/net/ovpn/ovpn-cli.c| 2366 tools/testing/selftests/net/ovpn/tcp_peers.txt |5 + .../testing/selftests/net/ovpn/test-chachapoly.sh |9 + tools/testing/selftests/net/ovpn/test-float.sh |9 + tools/testing/selftests/net

Re: [sos-linux-ext-patches] [PATCH v4 2/8] KVM: selftests: SEV-SNP test for KVM_SEV_INIT2

2025-01-10 Thread Pratik Rajesh Sampat
On 1/9/25 11:52 PM, Nikunj A. Dadhania wrote: > > > On 11/15/2024 5:10 AM, Pratik R. Sampat wrote: >> Add the X86_FEATURE_SNP CPU feature to the architectural definition for >> the SEV-SNP VM type to exercise the KVM_SEV_INIT2 call. Ensure that the >> SNP test is

Re: [PATCH] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-10 Thread Filipe Xavier
Em 07/01/2025 13:23, Joe Lawrence escreveu: On Thu, Jan 02, 2025 at 03:42:10PM -0300, Filipe Xavier wrote: This new test makes sure that ftrace can trace a function that was introduced by a livepatch. Hi Filipe, Thanks for adding a test! Aside: another similar test could verify that the

Re: [sos-linux-ext-patches] [PATCH v4 2/8] KVM: selftests: SEV-SNP test for KVM_SEV_INIT2

2025-01-09 Thread Nikunj A. Dadhania
On 1/10/2025 11:22 AM, Nikunj A. Dadhania wrote: > > > On 11/15/2024 5:10 AM, Pratik R. Sampat wrote: >> Add the X86_FEATURE_SNP CPU feature to the architectural definition for >> the SEV-SNP VM type to exercise the KVM_SEV_INIT2 call. Ensure that the >> SNP test is

Re: [sos-linux-ext-patches] [PATCH v4 2/8] KVM: selftests: SEV-SNP test for KVM_SEV_INIT2

2025-01-09 Thread Nikunj A. Dadhania
On 11/15/2024 5:10 AM, Pratik R. Sampat wrote: > Add the X86_FEATURE_SNP CPU feature to the architectural definition for > the SEV-SNP VM type to exercise the KVM_SEV_INIT2 call. Ensure that the > SNP test is skipped in scenarios where CPUID supports it but KVM does > not, so that

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2025-01-09 Thread Charlie Jenkins
On Thu, Dec 26, 2024 at 11:21:59PM +0800, Celeste Liu wrote: > > On 2024-12-26 21:35, Dmitry V. Levin wrote: > > On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: > >> This test checks that orig_a0 allows a syscall argument to be modified, > >> and that c

Re: [PATCH v2 6/6] KVM: x86: selftests: Test PerfMonV2

2025-01-08 Thread Sean Christopherson
On Wed, Sep 18, 2024, Colton Lewis wrote: > Test PerfMonV2, which defines global registers to enable multiple > performance counters with a single MSR write, in its own function. > > If the feature is available, ensure the global control register has > the ability to sta

Re: [PATCH v2 5/6] KVM: x86: selftests: Test core events

2025-01-08 Thread Sean Christopherson
On Wed, Sep 18, 2024, Colton Lewis wrote: > Test events on core counters by iterating through every combination of > events in amd_pmu_zen_events with every core counter. > > For each combination, calculate the appropriate register addresses for > the event selection/control r

Re: [PATCH v2 4/6] KVM: x86: selftests: Test read/write core counters

2025-01-08 Thread Sean Christopherson
On Wed, Sep 18, 2024, Colton Lewis wrote: > Run a basic test to ensure we can write an arbitrary value to the core > counters and read it back. > > Signed-off-by: Colton Lewis > --- > .../selftests/kvm/x86_64/pmu_counters_test.c | 54 +++ > 1 file c

Re: [PATCH v6] riscv: selftests: Fix warnings pointer masking test

2025-01-08 Thread patchwork-bot+linux-riscv
pwrite’ declared with attribute > ‘warn_unused_result’ [-Wunused-result] > 208 | pwrite(fd, &value, 1, 0); > > [...] Here is the summary with links: - [v6] riscv: selftests: Fix warnings pointer masking test https://git.kernel.org/riscv/c/498d5b14db8c You are awesome,

[PATCH 6/6] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO

2025-01-07 Thread Dmitry V. Levin
kill_tracee(pid); \ + TH_LOG("wait #%d: " fmt,\ + ptrace_stop, ##__VA_ARGS__); \ + } while (0) + +struct si_entry { + int nr; + unsigned long args[6]; +}; +struct si_exit { + unsigned int is_error;

Re: [PATCH] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-07 Thread Joe Lawrence
On Thu, Jan 02, 2025 at 03:42:10PM -0300, Filipe Xavier wrote: > This new test makes sure that ftrace can trace a > function that was introduced by a livepatch. > Hi Filipe, Thanks for adding a test! Aside: another similar test could verify that the original function, in

[PATCH v1 2/2] selftests/mm: Introduce uffd-wp-mremap regression test

2025-01-07 Thread Ryan Roberts
Introduce a test that registers a range of memory for UFFDIO_WRITEPROTECT_MODE_WP without UFFD_FEATURE_EVENT_REMAP. First check that the uffd-wp bit is set for every PTE in the range. Then mremap() the range to a new location and check that the uffd-wp bit is clear for every PTE in the range. Run

[PATCHv4 RESEND net-next 2/2] selftests: wireguard: update to using nft for qemu test

2025-01-06 Thread Hangbin Liu
Since we will replace iptables with nft for wireguard netns testing, let's also convert the qemu test to use nft at the same time. Co-developed-by: Phil Sutter Signed-off-by: Phil Sutter Signed-off-by: Hangbin Liu --- .../testing/selftests/wireguard/qemu/Makefile

[PATCH v8 1/2] selftests: tmpfs: Add Test-skip if not run as root

2025-01-05 Thread Shivam Chaudhary
Add 'ksft_exit_skip()', if not run as root, with an appropriate Warning. Add 'ksft_print_header()' and 'ksft_set_plan()' to structure test outputs more effectively. Test logs: Before Change: - Without root error: unshare, errno 1 - With root No, output Aft

Re: [PATCH v7 1/2] selftests: tmpfs: Add Test-skip if not run as root

2025-01-03 Thread Shuah Khan
On 1/3/25 09:36, Shivam Chaudhary wrote: On 03/01/25 3:24 AM, Shuah Khan wrote: On 1/2/25 03:04, Shivam Chaudhary wrote: Add 'ksft_exit_skip()', if  not run as root, with an appropriate Warning. Add 'ksft_print_header()' and 'ksft_set_plan()' to structure test o

Re: [PATCH v7 1/2] selftests: tmpfs: Add Test-skip if not run as root

2025-01-03 Thread Shivam Chaudhary
On 03/01/25 3:24 AM, Shuah Khan wrote: On 1/2/25 03:04, Shivam Chaudhary wrote: Add 'ksft_exit_skip()', if  not run as root, with an appropriate Warning. Add 'ksft_print_header()' and 'ksft_set_plan()' to structure test outputs more effectively. Test logs:

Re: [PATCH v5 3/3] rust: kunit: allow to know if we are in a test

2025-01-03 Thread Miguel Ojeda
On Fri, Dec 13, 2024 at 9:10 AM David Gow wrote: > > +/// In some cases, you need to call test-only code from outside the test > case, for example, to > +/// create a function mock. This function can be invoked to know whether we > are currently running a > +/// KUnit

Re: [PATCH v7 1/2] selftests: tmpfs: Add Test-skip if not run as root

2025-01-02 Thread Shuah Khan
On 1/2/25 03:04, Shivam Chaudhary wrote: Add 'ksft_exit_skip()', if not run as root, with an appropriate Warning. Add 'ksft_print_header()' and 'ksft_set_plan()' to structure test outputs more effectively. Test logs: Before Change: - Without root error: unsh

[PATCH] selftests: livepatch: test if ftrace can trace a livepatched function

2025-01-02 Thread Filipe Xavier
This new test makes sure that ftrace can trace a function that was introduced by a livepatch. Signed-off-by: Filipe Xavier --- tools/testing/selftests/livepatch/test-ftrace.sh | 37 1 file changed, 37 insertions(+) diff --git a/tools/testing/selftests/livepatch/test

[PATCH v7 1/2] selftests: tmpfs: Add Test-skip if not run as root

2025-01-02 Thread Shivam Chaudhary
Add 'ksft_exit_skip()', if not run as root, with an appropriate Warning. Add 'ksft_print_header()' and 'ksft_set_plan()' to structure test outputs more effectively. Test logs: Before Change: - Without root error: unshare, errno 1 - With root No, output Aft

[PATCH v3 2/2] selftests: coredump: Add stackdump test

2025-01-02 Thread Nam Cao
Add a test which checks that the kstkesp field in /proc/pid/stat can be read for all threads of a coredumping process. For full details including the motivation for this test and how it works, see the README file added by this commit. Reviewed-by: John Ogness Signed-off-by: Nam Cao --- tools

[PATCH 1/1] selftests/memfd: skip hugetlbfs test if it's not supported

2025-01-01 Thread Po-Hsu Lin
Handle the case that hugetlbfs is not supported. To make it easier for debugging. On a system that does not support hugetlbfs. There will be no such HugePages_Free entry in /proc/meminfo. And consequently freepgs will be empty. The huge pages availability check will fail and the test will be

[PATCH 0/1] selftests/memfd: skip hugetlbfs test if it's not supported

2025-01-01 Thread Po-Hsu Lin
Handle the case that hugetlbfs is not supported. To make it easier for debugging. On a system that does not support hugetlbfs. There will be no such HugePages_Free entry in /proc/meminfo. And consequently freepgs will be empty. The huge pages availability check will fail and the test will be

Re: [PATCH net-next v16 26/26] testing/selftests: add test tool and scripts for ovpn module

2024-12-30 Thread Antonio Quartulli
On 20/12/24 05:02, Jakub Kicinski wrote: On Thu, 19 Dec 2024 02:42:20 +0100 Antonio Quartulli wrote: +uint64_t nla_get_uint(struct nlattr *attr) +{ + if (nla_len(attr) == sizeof(uint32_t)) + return nla_get_u32(attr); + else + return nla_get_u64(attr); +}

Re: [PATCH v2 2/2] selftests: coredump: Add stackdump test

2024-12-30 Thread Kees Cook
On Mon, Dec 30, 2024 at 11:17:31AM +0100, Nam Cao wrote: > Add a test which checks that the kstkesp field in /proc/pid/stat can be > read for all threads of a coredumping process. > > For full details including the motivation for this test and how it works, > see the README fil

[PATCH v2 2/2] selftests: coredump: Add stackdump test

2024-12-30 Thread Nam Cao
Add a test which checks that the kstkesp field in /proc/pid/stat can be read for all threads of a coredumping process. For full details including the motivation for this test and how it works, see the README file added by this commit. Reviewed-by: John Ogness Signed-off-by: Nam Cao --- tools

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-26 Thread Celeste Liu
On 2024-12-26 21:35, Dmitry V. Levin wrote: > On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: >> This test checks that orig_a0 allows a syscall argument to be modified, >> and that changing a0 does not change the syscall argument. >> >> Co-developed-by:

Re: [PATCH v4 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-26 Thread Dmitry V. Levin
On Thu, Dec 26, 2024 at 06:52:52PM +0800, Celeste Liu wrote: > This test checks that orig_a0 allows a syscall argument to be modified, > and that changing a0 does not change the syscall argument. > > Co-developed-by: Quan Zhou > Signed-off-by: Quan Zhou > Co-developed-b

Re: [PATCH v2 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-26 Thread Celeste Liu
05:30:05PM +0800, Celeste Liu wrote: >>>>> From: Charlie Jenkins >>>>> >>>>> This test checks that orig_a0 allows a syscall argument to be modified, >>>>> and that changing a0 does not change the syscall argument. >>>>> >>&

  1   2   3   4   5   6   7   8   9   10   >