[PATCH] selftests/dma:remove unused variable

2024-07-09 Thread Zhu Jun
The variable are never referenced in the code, just remove it that this problem was discovered by reading code Signed-off-by: Zhu Jun --- tools/testing/selftests/dma/dma_map_benchmark.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools/te

[PATCH] selftests/dma:Fix a resource leak

2024-07-09 Thread Zhu Jun
The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by reading code Signed-off-by: Zhu Jun --- tools/testing/selftests/dma/dma_map_benchmark.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/dma/dma_map_be

[PATCH] selftests/rtc:Fix a resource leak

2024-07-09 Thread Zhu Jun
The opened file should be closed before exit, otherwise resource leak will occur that this problem was discovered by reading code Signed-off-by: Zhu Jun --- tools/testing/selftests/rtc/setdate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/rtc/setdate.c b/tools/te

[PATCH] selftests:Fix printf format string in kselftest_harness.h

2024-07-09 Thread Zhu Jun
'%u' in format string requires 'unsigned int' in __wait_for_test() but the argument type is 'signed int'. Signed-off-by: Zhu Jun --- tools/testing/selftests/kselftest_harness.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tool

Re: [PATCH bpf-next v2 4/6] selftests/bpf: Null checks for link in bpf_tcp_ca

2024-07-09 Thread Geliang Tang
Hi Eduard, On Mon, 2024-07-08 at 12:42 -0700, Eduard Zingerman wrote: > On Fri, 2024-07-05 at 10:38 +0800, Geliang Tang wrote: > > [...] > > I think that this patch is an improvement independent of the patch- > set. > Please submit it separately. > > >  .../selftests/bpf/prog_tests/bpf_tcp_ca.c

[PATCH v2] selftests/breakpoints:Add return value in main function

2024-07-09 Thread Zhu Jun
Main function return value is int type, so add return value in the end that this problem was discovered by reading the code Signed-off-by: Zhu Jun --- Changes in v2: - modify commit info tools/testing/selftests/breakpoints/step_after_suspend_test.c | 4 +++- 1 file changed, 3 insertions(+),

[PATCH v2] selftests/breakpoints:Remove unused variable

2024-07-09 Thread Zhu Jun
This variable is never referenced in the code, just remove them that this problem was discovered by reading the code Signed-off-by: Zhu Jun --- Changes in v2: - modify commit info tools/testing/selftests/breakpoints/step_after_suspend_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/

[PATCH bpf-next v2] selftests/bpf:fix a resource leak

2024-07-09 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- Changes in v2: - check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+), 4 dele

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

2024-07-09 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 v16 12/13] selftests: add ncdevmem, netcat for devmem TCP

2024-07-09 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 v16 11/13] net: add devmem TCP documentation

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

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

2024-07-09 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 v16 09/13] tcp: RX path for devmem TCP

2024-07-09 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 v16 08/13] net: add support for skbs with unreadable frags

2024-07-09 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 v16 06/13] memory-provider: dmabuf devmem memory provider

2024-07-09 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 v16 07/13] net: support non paged skb frags

2024-07-09 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 v16 05/13] page_pool: devmem support

2024-07-09 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 v16 04/13] netdev: netdevice devmem allocator

2024-07-09 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 v16 03/13] netdev: support binding dma-buf to netdevice

2024-07-09 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 v16 02/13] net: netdev netlink api to bind dma-buf to a net device

2024-07-09 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 --- v16: - Use subset-of: queue queue-id instead of queue-dmabuf (Jakub). - Rename attribute 'bind-dmabuf' t

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

2024-07-09 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel

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

2024-07-09 Thread Mina Almasry
v16: https://patchwork.kernel.org/project/netdevbpf/list/?series=866353&state=* v15 got a thorough review and some testing, and this version addresses almost all the feedback. Some more minor comments where the authors said it could be done later, I left out. Major changes: - Addition of dma

[PATCH] kunit: executor: Simplify string allocation handling

2024-07-09 Thread Kees Cook
The alloc/copy code pattern is better consolidated to single kstrdup (and kstrndup) calls instead. This gets rid of deprecated[1] strncpy() uses as well. Replace one other strncpy() use with the more idiomatic strscpy(). Link: https://github.com/KSPP/linux/issues/90 [1] Signed-off-by: Kees Cook -

Re: [PATCH 1/2] uprobes: Optimize the return_instance related routines

2024-07-09 Thread Andrii Nakryiko
On Mon, Jul 8, 2024 at 6:00 PM Liao Chang wrote: > > Reduce the runtime overhead for struct return_instance data managed by > uretprobe. This patch replaces the dynamic allocation with statically > allocated array, leverage two facts that are limited nesting depth of > uretprobe (max 64) and the f

Re: [PATCH 0/4] selftest: x86: conform tests to TAP format output

2024-07-09 Thread Shuah Khan
On 7/2/24 04:17, Muhammad Usama Anjum wrote: On 6/10/24 10:19 AM, Muhammad Usama Anjum wrote: Adding Borislav, Dave and x86 mailing list: Please review the series. Kind reminder Usama, As I mentioned another TAP conversion patch from you patch if the following command gives you TAP

Re: [PATCH v2 2/2] selftests/thermel/intel: conform the test to TAP output

2024-07-09 Thread Shuah Khan
On 7/2/24 04:12, Muhammad Usama Anjum wrote: Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. The test has infinite loop to read the value of status_str. Break the loop after getting the value once and finish

Re: [PATCH v2 1/2] selftests/thermel/intel: conform the test to TAP output

2024-07-09 Thread Shuah Khan
On 7/2/24 04:12, Muhammad Usama Anjum wrote: Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. The test has infitie loop to read the value of index_str. Break the loop after successfully reading the value once

Re: [PATCH] selftests: tpm2: conform test to TAP output

2024-07-09 Thread Shuah Khan
On 7/2/24 00:55, Muhammad Usama Anjum wrote: The python unittest is being used for executing tests. TAP output cannot be added in the unittest framework. The python unittest is being run from a script. Add the output TAP logs to the script. Add "#" prefix to the python unittest output which will

Re: [PATCH v2 1/4] kselftests: vdso: vdso_test_clock_getres: conform test to TAP output

2024-07-09 Thread Shuah Khan
On 6/12/24 02:17, Muhammad Usama Anjum wrote: On 6/12/24 1:32 AM, Shuah Khan wrote: On 6/9/24 23:41, Muhammad Usama Anjum wrote: Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Use kselftest_harness.h to co

Re: [PATCH v4 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-09 Thread Shuah Khan
On 7/9/24 14:51, Shuah Khan wrote: On 7/9/24 14:40, John Hubbard wrote: On 7/9/24 1:34 PM, Shuah Khan wrote: On 7/4/24 01:24, John Hubbard wrote: ...>> Muhammad Usama Anjum (1):    selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp Usama and John, I am seeing checkpatch

Re: [PATCH v4 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-09 Thread Shuah Khan
On 7/9/24 14:40, John Hubbard wrote: On 7/9/24 1:34 PM, Shuah Khan wrote: On 7/4/24 01:24, John Hubbard wrote: ...>> Muhammad Usama Anjum (1):    selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp Usama and John, I am seeing checkpatch warnings in this series. v4-3-7 WAR

Re: [PATCH v4 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-09 Thread John Hubbard
On 7/9/24 1:34 PM, Shuah Khan wrote: On 7/4/24 01:24, John Hubbard wrote: ...>> Muhammad Usama Anjum (1):    selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp Usama and John, I am seeing checkpatch warnings in this series. v4-3-7 WARNING: externs should be avoided in .c

Re: [PATCH v3] selftest/timerns: fix clang build failures for abs() calls

2024-07-09 Thread Shuah Khan
On 7/3/24 21:44, Andrei Vagin wrote: On Wed, Jul 3, 2024 at 7:52 PM John Hubbard wrote: When building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang warns about mismatches between the expected and required integer length being supplied to abs(3). Fix this by using the

Re: [PATCH v4 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-09 Thread Shuah Khan
On 7/4/24 01:24, John Hubbard wrote: Changes since v3: 1) Rebased onto Linux 6.10-rc6+. 2) Added Muhammad's acks for the series. Cover letter for v3: Hi, Dave Hansen, Muhammad Usama Anjum, here is the combined series that we discussed yesterday [1]. As I mentioned then, this is a bit intrus

Re: [PATCH v6 4/8] of: Add a KUnit test for overlays and test managed APIs

2024-07-09 Thread Stephen Boyd
Quoting Jeff Johnson (2024-07-09 07:49:40) > On 7/5/24 21:54, Stephen Boyd wrote: > > Test the KUnit test managed overlay APIs. Confirm that platform devices > > are created and destroyed properly. This provides us confidence that the > > test managed APIs work correctly and can be relied upon to p

Re: [RESEND] selftests/breakpoints:Add return value in main function

2024-07-09 Thread Shuah Khan
On 7/9/24 03:51, Zhu Jun wrote: Main function return value is int type, so add return value in the end Signed-off-by: Zhu Jun Please add information on how this problem was found. If you used a tool, include which tool and warning from the tool. thanks, -- Shuah

Re: [RESEND] selftests/breakpoints:Remove unused variable

2024-07-09 Thread Shuah Khan
On 7/9/24 03:44, Zhu Jun wrote: This variable is never referenced in the code, just remove them. Please add information on how this problem was found. If you used a tool, include which tool and warning from the tool. Signed-off-by: Zhu Jun --- tools/testing/selftests/breakpoints/step_afte

Re: [PATCH bpf] selftests/bpf: DENYLIST.aarch64: Remove fexit_sleep

2024-07-09 Thread Manu Bretelle
From: Daniel Borkmann Sent: Tuesday, July 9, 2024 10:44 AM To: KP Singh Cc: Puranjay Mohan ; Andrii Nakryiko ; Eduard Zingerman ; Mykola Lysenko ; Alexei Starovoitov ; Martin KaFai Lau ; Song Liu ; Yonghong Song ; John Fastabend ; Stanislav Fomichev

[PATCH] KVM: selftests: Add SEV-ES shutdown test

2024-07-09 Thread Peter Gonda
Regression test for ae20eef5 ("KVM: SVM: Update SEV-ES shutdown intercepts with more metadata"). Test confirms userspace is correctly indicated of a guest shutdown not previous behavior of an EINVAL from KVM_RUN. Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Alper Gun Cc: Tom Lendacky Cc: Mich

[RFC PATCH v1 4/4] KVM: selftests: Add bus lock exit test

2024-07-09 Thread Manali Shukla
From: Nikunj A Dadhania Malicious guests can cause bus locks to degrade the performance of a system. The Bus Lock Threshold feature is beneficial for hypervisors aiming to restrict the ability of the guests to perform excessive bus locks and slow down the system for all the tenants. Add a test

[RFC PATCH v1 3/4] KVM: x86: nSVM: Implement support for nested Bus Lock Threshold

2024-07-09 Thread Manali Shukla
Expose the Bus Lock Threshold in the guest CPUID and support its functionality in nested guest. Ensure proper restoration and saving of the bus_lock_counter at VM Entry and VM Exit respectively in nested guest scenarios. Case 1: L0 supports buslock exit and L1 does not: use buslock counter from L

[RFC PATCH v1 2/4] KVM: SVM: Enable Bus lock threshold exit

2024-07-09 Thread Manali Shukla
From: Nikunj A Dadhania Malicious guests can cause bus locks to degrade the performance of system. Non-WB(write-back) and misaligned locked RMW(read-modify-write) instructions are referred to as "bus locks" and require system wide synchronization among all processors to guarantee atomicity. Bus

[RFC PATCH v1 0/4] Add support for the Bus Lock Threshold

2024-07-09 Thread Manali Shukla
Malicious guests can cause bus locks to degrade the performance of a system. Non-WB (write-back) and misaligned locked RMW (read-modify-write) instructions are referred to as "bus locks" and require system wide synchronization among all processors to guarantee the atomicity. The bus locks can impos

[RFC PATCH v1 1/4] x86/cpufeatures: Add CPUID feature bit for the Bus Lock Threshold

2024-07-09 Thread Manali Shukla
Malicious guests can cause bus locks to degrade the performance of a system. Non-WB(write-back) and misaligned locked RMW(read-modify-write) instructions are referred to as "bus locks" and require system wide synchronization among all processors to guarantee atomicity. The bus locks may incur sign

Re: [PATCH bpf] selftests/bpf: DENYLIST.aarch64: Remove fexit_sleep

2024-07-09 Thread Daniel Borkmann
On 7/8/24 6:42 PM, KP Singh wrote: On Mon, Jul 8, 2024 at 6:09 PM Daniel Borkmann wrote: On 7/8/24 5:35 PM, Puranjay Mohan wrote: Daniel Borkmann writes: On 7/8/24 5:26 PM, KP Singh wrote: On Mon, Jul 8, 2024 at 5:00 PM Puranjay Mohan wrote: Daniel Borkmann writes: On 7/5/24 4:50 PM, Pu

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

2024-07-09 Thread Mina Almasry
On Tue, Jul 9, 2024 at 8:37 AM Taehee Yoo wrote: > ... > And I found another bug. > > [ 236.625141] BUG: KASAN: slab-use-after-free in > net_devmem_unbind_dmabuf+0x364/0x440 ... > Reproducer: > ./ncdevmem -f -l -p 5201 -v 7 -t 0 -q 2 & > sleep 10 > modprobe -rv bnxt_en > killall ncdevmem > > I th

Re: [PATCH 10/17] arm64: generate 64-bit syscall.tbl

2024-07-09 Thread Mark Brown
1e4e26ec. git bisect start # status: waiting for both good and bad commits # bad: [82d01fe6ee52086035b201cfa1410a3b04384257] Add linux-next specific files for 20240709 git bisect bad 82d01fe6ee52086035b201cfa1410a3b04384257 # status: waiting for good commit(s), bad commit known # good: [037206cd4cb

Re: [PATCH v1 5/9] selftests: kvm: s390: Add debug print functions

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:57:00 +0200 Christoph Schlameuss wrote: > Add functions to simply print some basic state information in selftests. > > The output can be enabled by setting: > > #define TH_LOG_ENABLED 1 > #define DEBUG 1 > > * print_psw: current SIE state description and VM run s

Re: [PATCH v1 8/9] selftests: kvm: s390: Add uc_skey VM test case

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:57:03 +0200 Christoph Schlameuss wrote: > Add a test case manipulating s390 storage keys from within the ucontrol > VM. > > Signed-off-by: Christoph Schlameuss > --- > .../selftests/kvm/s390x/ucontrol_test.c | 83 +++ > 1 file changed, 83 insertions

Re: [PATCH v1 6/9] selftests: kvm: s390: Add VM run test case

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:57:01 +0200 Christoph Schlameuss wrote: > Add test case running code interacting with registers within a > ucontrol VM. > > * Add uc_gprs test case > > The test uses the same VM setup using the fixture and debug macros > introduced in earlier patches in this series. > >

Re: [PATCH v1 2/9] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:56:57 +0200 Christoph Schlameuss wrote: > Subsequent tests do require direct manipulation of the SIE instruction. > This commit introduces the SIE definition for the selftests. > > There are already definitions of this within the kernel. > This differs in two ways. > * Thi

Re: [PATCH v1 3/9] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:56:58 +0200 Christoph Schlameuss wrote: > Add test suite to validate the s390x architecture specific ucontrol KVM > interface. > > Make use of the selftest test harness. > > * uc_cap_hpage testcase verifies that a ucontrol VM cannot be run with > hugepages. > > To allo

Re: [PATCH v1 1/9] selftests: kvm: s390: Define page sizes in shared header

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:56:56 +0200 Christoph Schlameuss wrote: > Multiple test cases need page size and shift definitions. > By moving the definitions to a single architecture specific header we > limit the repetition. > > Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing > cod

Re: [PATCH v1 9/9] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:57:04 +0200 Christoph Schlameuss wrote: > Add a test case verifying KVM_SET_USER_MEMORY_REGION and > KVM_SET_USER_MEMORY_REGION2 cannot be executed on ucontrol VMs. > > Executing this test case on not patched kernels will cause a null > pointer dereference in the host kern

Re: [PATCH v1 4/9] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-07-09 Thread Claudio Imbrenda
On Tue, 9 Jul 2024 14:56:59 +0200 Christoph Schlameuss wrote: > Add a uc_kvm fixture to create and destroy a ucontrol VM. > > * uc_sie_assertions asserts basic settings in the SIE as setup by the > kernel. > * uc_attr_mem_limit asserts the memory limit is max value and cannot be > set (not

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

2024-07-09 Thread Taehee Yoo
On Tue, Jul 9, 2024 at 5:08 AM Mina Almasry wrote: > Hi Mina, Thanks a lot for your reply! > On Thu, Jul 4, 2024 at 10:57 AM Taehee Yoo wrote: > > > > I found several locking warnings while testing. > > > > Thanks for Testing Taehee! And sorry for the late reply. I was off for > a couple of day

Re: [GIT PULL] Kselftest fixes for Linux 6.10

2024-07-09 Thread pr-tracker-bot
The pull request you sent on Mon, 8 Jul 2024 16:42:13 -0600: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-fixes-6.10 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/920bc844baa92fe508d9cb7c72765d6f54dfebe1 Thank you! --

Re: [PATCH v6 4/8] of: Add a KUnit test for overlays and test managed APIs

2024-07-09 Thread Jeff Johnson
On 7/5/24 21:54, Stephen Boyd wrote: Test the KUnit test managed overlay APIs. Confirm that platform devices are created and destroyed properly. This provides us confidence that the test managed APIs work correctly and can be relied upon to provide tests with fake platform devices and device node

[PATCH v22 4/4] selftests/vDSO: add tests for vgetrandom

2024-07-09 Thread Jason A. Donenfeld
This adds two tests for vgetrandom. The first one, vdso_test_chacha, simply checks that the assembly implementation of chacha20 matches that of libsodium, a basic sanity check that should catch most errors. The second, vdso_test_getrandom, is a full "libc-like" implementation of the userspace side

[PATCH v1 9/9] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-07-09 Thread Christoph Schlameuss
Add a test case verifying KVM_SET_USER_MEMORY_REGION and KVM_SET_USER_MEMORY_REGION2 cannot be executed on ucontrol VMs. Executing this test case on not patched kernels will cause a null pointer dereference in the host kernel. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucon

[PATCH v1 8/9] selftests: kvm: s390: Add uc_skey VM test case

2024-07-09 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 83 +++ 1 file changed, 83 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/te

[PATCH v1 7/9] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-07-09 Thread Christoph Schlameuss
Add a test case verifying basic running and interaction of ucontrol VMs. Fill the segment and page tables for allocated memory and map memory on first access. * uc_map_unmap Store and load data to mapped and unmapped memory and use pic segment translation handling to map memory on access. Sig

[PATCH v1 6/9] selftests: kvm: s390: Add VM run test case

2024-07-09 Thread Christoph Schlameuss
Add test case running code interacting with registers within a ucontrol VM. * Add uc_gprs test case The test uses the same VM setup using the fixture and debug macros introduced in earlier patches in this series. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c

[PATCH v1 5/9] selftests: kvm: s390: Add debug print functions

2024-07-09 Thread Christoph Schlameuss
Add functions to simply print some basic state information in selftests. The output can be enabled by setting: #define TH_LOG_ENABLED 1 #define DEBUG 1 * print_psw: current SIE state description and VM run state * print_hex_bytes: print memory with some counting markers * print_hex: PRIN

[PATCH v1 2/9] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-09 Thread Christoph Schlameuss
Subsequent tests do require direct manipulation of the SIE instruction. This commit introduces the SIE definition for the selftests. There are already definitions of this within the kernel. This differs in two ways. * This is the first definition of this in userspace. * This does not require atomi

[PATCH v1 4/9] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-07-09 Thread Christoph Schlameuss
Add a uc_kvm fixture to create and destroy a ucontrol VM. * uc_sie_assertions asserts basic settings in the SIE as setup by the kernel. * uc_attr_mem_limit asserts the memory limit is max value and cannot be set (not supported). * uc_no_dirty_log asserts dirty log is not supported. Signed-off

[PATCH v1 0/9] selftests: kvm: s390: Add s390x ucontrol selftests

2024-07-09 Thread Christoph Schlameuss
This patch series adds a selftest suite to validate the s390x architecture specific ucontrol KVM interface. When creating a VM on s390x it is possible to create it as userspace controlled VM or in short ucontrol VM. These VMs delegates the management of the VM to userspace instead of handling most

[PATCH v1 3/9] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-07-09 Thread Christoph Schlameuss
Add test suite to validate the s390x architecture specific ucontrol KVM interface. Make use of the selftest test harness. * uc_cap_hpage testcase verifies that a ucontrol VM cannot be run with hugepages. To allow testing of the ucontrol interface the kernel needs a non-default config containin

[PATCH v1 1/9] selftests: kvm: s390: Define page sizes in shared header

2024-07-09 Thread Christoph Schlameuss
Multiple test cases need page size and shift definitions. By moving the definitions to a single architecture specific header we limit the repetition. Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing code. Signed-off-by: Christoph Schlameuss --- tools/testing/selftests/kvm/inc

Re: [PATCH 6/6] arm: defconfig: drop RT_GROUP_SCHED=y from bcm2855/tegra/omap2plus

2024-07-09 Thread Celeste Liu
On 2024-07-09 20:26, Stefan Wahren wrote: > Hi Celeste, > > there is a typo in the subject line > > s/bcm2855/bcm2835 Will be included in next version. > > Am 09.07.24 um 01:49 schrieb Kevin Hilman: >> Celeste Liu writes: >> >>> Commit 673ce00c5d6c ("ARM: omap2plus_defconfig: Add support fo

Re: [PATCH 6/6] arm: defconfig: drop RT_GROUP_SCHED=y from bcm2855/tegra/omap2plus

2024-07-09 Thread Stefan Wahren
Hi Celeste, there is a typo in the subject line s/bcm2855/bcm2835 Am 09.07.24 um 01:49 schrieb Kevin Hilman: Celeste Liu writes: Commit 673ce00c5d6c ("ARM: omap2plus_defconfig: Add support for distros with systemd") said it's because of recommendation from systemd. But systemd changed their

Re: [PATCH] selftests/bpf:fix a resource leak

2024-07-09 Thread Jiri Olsa
On Tue, Jul 09, 2024 at 02:38:42AM -0700, Zhu Jun wrote: > The requested resources should be closed before return > in main(), otherwise resource leak will occur > > Signed-off-by: Zhu Jun should have 'PATCHv2 bpf-next' (or bpf) in subject, other than that lgtm Acked-by: Jiri Olsa jirka > --

Re: [PATCH] selftests/net: missing close function in randomize function

2024-07-09 Thread Paolo Abeni
On Fri, 2024-07-05 at 16:24 +0800, Liu Jing wrote: > in randomize function, there is a open function, but there is no > close function in the randomize, which is easy to cause memory leaks. Please not that the file descriptor is not leaked, the kernel will dispose it at process exit() time. > >

[PATCH bpf-next 3/3] selftests/bpf: Close obj in error paths in xdp_adjust_tail

2024-07-09 Thread Geliang Tang
From: Geliang Tang If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj" opened before this should be closed. So use "goto out" to close it instead of using "return" here. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 2 +- 1 file

[PATCH bpf-next 2/3] selftests/bpf: Check ASSERT_OK(err) in dummy_st_ops

2024-07-09 Thread Geliang Tang
From: Geliang Tang Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch platform, some "unexpected arg" errors occur: ''' #78/1dummy_st_ops/dummy_st_ops_attach:OK test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \ actual 0 !=

[PATCH bpf-next 1/3] selftests/bpf: Null checks for links in bpf_tcp_ca

2024-07-09 Thread Geliang Tang
From: Geliang Tang Run bpf_tcp_ca selftests (./test_progs -t bpf_tcp_ca) on a Loongarch platform, some "Segmentation fault" errors occur: ''' test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -524 #29/1bpf_tcp_ca/dctcp:FAIL test_

[PATCH bpf-next 0/3] BPF selftests misc fixes

2024-07-09 Thread Geliang Tang
From: Geliang Tang Resend patch 1 out of "skip ENOTSUPP BPF selftests" set as Eduard suggested. Together with two other cleanups. Geliang Tang (3): selftests/bpf: Null checks for links in bpf_tcp_ca selftests/bpf: Check ASSERT_OK(err) in dummy_st_ops selftests/bpf: Close obj in error paths

[RESEND] selftests/breakpoints:Add return value in main function

2024-07-09 Thread Zhu Jun
Main function return value is int type, so add return value in the end Signed-off-by: Zhu Jun --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/

[RESEND] selftests/breakpoints:Remove unused variable

2024-07-09 Thread Zhu Jun
This variable is never referenced in the code, just remove them. Signed-off-by: Zhu Jun --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests/br

[PATCH] selftests/bpf:fix a resource leak

2024-07-09 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- v1 -> v2: check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-)

Re: [PATCH net-next v7 3/3] selftests: add MSG_ZEROCOPY msg_control notification test

2024-07-09 Thread Simon Horman
+ Dave Miller, Jakub Kicinski, Paolo Abeni, Shuah Khan, linux-kselftest@vger.kernel.org On Mon, Jul 08, 2024 at 09:04:05PM +, zijianzh...@bytedance.com wrote: > From: Zijian Zhang > > We update selftests/net/msg_zerocopy.c to accommodate the new mechanism, > cfg_notification_limit has the

[PATCH bpf-next v11 9/9] selftests/bpf: Drop make_socket in sk_lookup

2024-07-09 Thread Geliang Tang
From: Geliang Tang Use local helper make_client() in drop_on_lookup(), drop_on_reuseport() and run_multi_prog_lookup() instead of using make_socket() + connect(). Then make_socket() and inetaddr_len() can be dropped now. make_client() returns normal "fd" instead of "-1" when connect() fails but

[PATCH bpf-next v11 8/9] selftests/bpf: Use connect_fd_to_addr_str in sk_lookup

2024-07-09 Thread Geliang Tang
From: Geliang Tang This patch uses the new helper connect_fd_to_addr_str() in make_client() instead of using local defined function make_socket() + connect(). This local function can be dropped latter. A new parameter "expect_errno" is added for make_client() too to allow different "expect_errno

[PATCH bpf-next v11 6/9] selftests/bpf: Use connect_fd_to_fd in sk_lookup

2024-07-09 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_fd_to_fd() exported in network_helpers.h instead of using getsockname() + connect() in run_lookup_prog() in prog_tests/sk_lookup.c. This can simplify the code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/sk_loo

[PATCH bpf-next v11 7/9] selftests/bpf: Add connect_fd_to_addr_str helper

2024-07-09 Thread Geliang Tang
From: Geliang Tang Similar to connect_fd_to_fd() helper to connect from a client fd to a server fd, this patch adds a new helper connect_fd_to_addr_str() to connect from a client fd to a server address. It accepts the server address string "addr_str", together with the server family, type and por

[PATCH bpf-next v11 5/9] selftests/bpf: Use start_server_addr in sk_lookup

2024-07-09 Thread Geliang Tang
From: Geliang Tang This patch uses public helper start_server_addr() in udp_recv_send() in prog_tests/sk_lookup.c to simplify the code. And use ASSERT_OK_FD() to check fd returned by start_server_addr(). Acked-by: Eduard Zingerman Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/p

[PATCH bpf-next v11 4/9] selftests/bpf: Use start_server_str in sk_lookup

2024-07-09 Thread Geliang Tang
From: Geliang Tang This patch uses public helper start_server_str() to simplify make_server() in prog_tests/sk_lookup.c. Add a callback setsockopts() to do all sockopts, set it to post_socket_cb pointer of struct network_helper_opts. And add a new struct cb_opts to save the data needed to pass t

[PATCH bpf-next v11 3/9] selftests/bpf: Close fd in error path in drop_on_reuseport

2024-07-09 Thread Geliang Tang
From: Geliang Tang In the error path when update_lookup_map() fails in drop_on_reuseport in prog_tests/sk_lookup.c, "server1", the fd of server 1, should be closed. This patch fixes this by using "goto close_srv1" lable instead of "detach" to close "server1" in this case. Acked-by: Eduard Zinger

[PATCH bpf-next v11 1/9] selftests/bpf: Add backlog for network_helper_opts

2024-07-09 Thread Geliang Tang
From: Geliang Tang Some callers expect __start_server() helper to pass their own "backlog" value to listen() instead of the default of 1. So this patch adds struct member "backlog" for network_helper_opts to allow callers to set "backlog" value via start_server_str() helper. listen(fd, 0 /* back

[PATCH bpf-next v11 2/9] selftests/bpf: Add ASSERT_OK_FD macro

2024-07-09 Thread Geliang Tang
From: Geliang Tang Add a new dedicated ASSERT macro ASSERT_OK_FD to test whether a socket FD is valid or not. It can be used to replace macros ASSERT_GT(fd, 0, ""), ASSERT_NEQ(fd, -1, "") or statements (fd < 0), (fd != -1). Suggested-by: Martin KaFai Lau Signed-off-by: Geliang Tang --- tools/

[PATCH bpf-next v11 0/9] use network helpers, part 8

2024-07-09 Thread Geliang Tang
From: Geliang Tang v11: - new patches 2, 4, 6. - drop expect_errno from network_helper_opts as Eduard and Martin suggested. - drop sockmap_ktls patches from this set. - add a new helper connect_fd_to_addr_str. v10: - a new patch 10 is added. - patches 1-6, 8-9 unchanged, only commit log

Re: [PATCH net v5] skmsg: skip zero length skb in sk_msg_recvmsg

2024-07-09 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf.git (master) by Daniel Borkmann : On Wed, 3 Jul 2024 16:39:31 +0800 you wrote: > From: Geliang Tang > > Run this BPF selftests (./test_progs -t sockmap_basic) on a Loongarch > platform, a kernel panic occurs: > > ''' > Oops[#1]: > CPU: 22 PID: 2824 Com

Re: [PATCH v3 2/2] selftests/resctrl: Adjust SNC support messages

2024-07-09 Thread Maciej Wieczor-Retman
Hello, On 2024-07-08 at 09:39:02 -0700, Reinette Chatre wrote: >Hi Maciej, > >On 7/4/24 12:23 AM, Maciej Wieczor-Retman wrote: >> On 2024-07-03 at 13:51:03 -0700, Reinette Chatre wrote: >> > On 7/3/24 12:43 AM, Maciej Wieczór-Retman wrote: >> > > On 3.07.2024 00:21, Reinette Chatre wrote: >> > > >