[PATCH v3 2/2] selftests: Add a test mangling with uc_sigmask

2024-06-25 Thread Dev Jain
This test asserts the relation between blocked signal, delivered signal, and ucontext. The ucontext is mangled with, by adding a signal mask to it; on return from the handler, the thread must block the corresponding signal. In the test description, I have also described signal delivery and blockag

[PATCH v3 1/2] selftests: Rename sigaltstack to generic signal

2024-06-25 Thread Dev Jain
Rename sigaltstack to signal, and rename the existing test to sigaltstack.c. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.gitignore | 2 +- tools/testing/selftest

[PATCH v3 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-06-25 Thread Dev Jain
This patch series is motivated by the following observation: Raise a signal, jump to signal handler. The ucontext_t structure dumped by kernel to userspace has a uc_sigmask field having the mask of blocked signals. If you run a fresh minimalistic program doing this, this field is empty, even if yo

[PATCH v6 3/4] selftest/mm: test enable_soft_offline behaviors

2024-06-25 Thread Jiaqi Yan
Add regression and new tests when hugepage has correctable memory errors, and how userspace wants to deal with it: * if enable_soft_offline=1, mapped hugepage is soft offlined * if enable_soft_offline=0, mapped hugepage is intact Free hugepages case is not explicitly covered by the tests. Hugepag

[PATCH v6 4/4] docs: mm: add enable_soft_offline sysctl

2024-06-25 Thread Jiaqi Yan
Add the documentation for soft offline behaviors / costs, and what the new enable_soft_offline sysctl is for. Acked-by: Oscar Salvador Acked-by: Miaohe Lin Signed-off-by: Jiaqi Yan --- Documentation/admin-guide/sysctl/vm.rst | 32 + 1 file changed, 32 insertions(+) dif

[PATCH v6 2/4] mm/memory-failure: userspace controls soft-offlining pages

2024-06-25 Thread Jiaqi Yan
Correctable memory errors are very common on servers with large amount of memory, and are corrected by ECC. Soft offline is kernel's additional recovery handling for memory pages having (excessive) corrected memory errors. Impacted page is migrated to a healthy page if inuse; the original page is d

[PATCH v6 1/4] mm/memory-failure: refactor log format in soft offline code

2024-06-25 Thread Jiaqi Yan
Logs from soft_offline_page and soft_offline_in_use_page have different formats than majority of the memory failure code: "Memory failure: 0x${pfn}: ${lower_case_message}" Convert them to the following format: "Soft offline: 0x${pfn}: ${lower_case_message}" No functional change in this comm

[PATCH v6 0/4] Userspace controls soft-offline pages

2024-06-25 Thread Jiaqi Yan
Correctable memory errors are very common on servers with large amount of memory, and are corrected by ECC, but with two pain points to users: 1. Correction usually happens on the fly and adds latency overhead 2. Not-fully-proved theory states excessive correctable memory errors can develop into

Re: [PATCH v5 3/4] selftest/mm: test enable_soft_offline behaviors

2024-06-25 Thread Jiaqi Yan
On Tue, Jun 25, 2024 at 6:54 PM Miaohe Lin wrote: > > On 2024/6/26 7:57, Jiaqi Yan wrote: > > On Tue, Jun 25, 2024 at 12:05 AM Miaohe Lin wrote: > >> > >> On 2024/6/25 0:33, Jiaqi Yan wrote: > >>> Add regression and new tests when hugepage has correctable memory > >> ... > >>> diff --git a/tools/

Re: [PATCH RFC 0/5] mm/gup: Introduce exclusive GUP pinning

2024-06-25 Thread Vishal Annapurve
On Mon, Jun 24, 2024 at 2:50 PM David Rientjes wrote: > > On Mon, 24 Jun 2024, Sean Christopherson wrote: > > > On Fri, Jun 21, 2024, Elliot Berman wrote: > > > On Fri, Jun 21, 2024 at 11:16:31AM +0100, Fuad Tabba wrote: > > > > On Fri, Jun 21, 2024 at 10:10 AM David Hildenbrand > > > > wrote: >

Re: [PATCH v5 3/4] selftest/mm: test enable_soft_offline behaviors

2024-06-25 Thread Miaohe Lin
On 2024/6/26 7:57, Jiaqi Yan wrote: > On Tue, Jun 25, 2024 at 12:05 AM Miaohe Lin wrote: >> >> On 2024/6/25 0:33, Jiaqi Yan wrote: >>> Add regression and new tests when hugepage has correctable memory >> ... >>> diff --git a/tools/testing/selftests/mm/hugetlb-soft-offline.c >>> b/tools/testing/se

[PATCH net-next v1 0/3] selftests: rds selftest

2024-06-25 Thread allison . henderson
From: Allison Henderson Hi All, This series is a new selftest that Vegard, Chuck and myself have been working on to provide some test coverage for rds. I've made quite a few updates since the rfc sent a few weeks ago: I've added several knobs to the script to tune network turbulance, and d

[PATCH net-next v1 2/3] net: rds: add option for GCOV profiling

2024-06-25 Thread allison . henderson
From: Vegard Nossum To better our unit tests we need code coverage to be part of the kernel. This patch borrows heavily from how CONFIG_GCOV_PROFILE_FTRACE is implemented Reviewed-by: Chuck Lever Signed-off-by: Vegard Nossum Signed-off-by: Allison Henderson --- net/rds/Kconfig | 9 +

[PATCH net-next v1 3/3] selftests: rds: add testing infrastructure

2024-06-25 Thread allison . henderson
From: Vegard Nossum This adds some basic self-testing infrastructure for RDS-TCP. Signed-off-by: Vegard Nossum Signed-off-by: Chuck Lever Signed-off-by: Allison Henderson --- Documentation/dev-tools/gcov.rst | 11 + MAINTAINERS| 1 + tools/testing

[PATCH net-next v1 1/3] .gitignore: add .gcda files

2024-06-25 Thread allison . henderson
From: Vegard Nossum These files contain the runtime coverage data generated by gcov. Signed-off-by: Vegard Nossum Signed-off-by: Chuck Lever Signed-off-by: Allison Henderson --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c59dc60ba62e..8ff1b41

Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk

2024-06-25 Thread Edward Liaw
On Tue, Jun 25, 2024 at 5:41 PM Edward Liaw wrote: > > On Tue, Jun 25, 2024 at 4:34 PM Shuah Khan wrote: > > > > On 6/25/24 14:52, Andrew Morton wrote: > > > On Mon, 24 Jun 2024 23:26:09 + Edward Liaw wrote: > > > > > >> Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all

Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk

2024-06-25 Thread Edward Liaw
On Tue, Jun 25, 2024 at 4:34 PM Shuah Khan wrote: > > On 6/25/24 14:52, Andrew Morton wrote: > > On Mon, 24 Jun 2024 23:26:09 + Edward Liaw wrote: > > > >> Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all > >> resulting macro redefinition warnings. > >> > >> These patch

Re: [PATCH v5 4/4] docs: mm: add enable_soft_offline sysctl

2024-06-25 Thread Jiaqi Yan
On Tue, Jun 25, 2024 at 5:02 PM Randy Dunlap wrote: > > Hi-- > > On 6/24/24 9:33 AM, Jiaqi Yan wrote: > > Add the documentation for soft offline behaviors / costs, and what > > the new enable_soft_offline sysctl is for. > > > > Acked-by: Oscar Salvador > > > > Signed-off-by: Jiaqi Yan > > --- >

Re: [PATCH v5 4/4] docs: mm: add enable_soft_offline sysctl

2024-06-25 Thread Randy Dunlap
Hi-- On 6/24/24 9:33 AM, Jiaqi Yan wrote: > Add the documentation for soft offline behaviors / costs, and what > the new enable_soft_offline sysctl is for. > > Acked-by: Oscar Salvador > > Signed-off-by: Jiaqi Yan > --- > Documentation/admin-guide/sysctl/vm.rst | 32 +

Re: [PATCH v5 3/4] selftest/mm: test enable_soft_offline behaviors

2024-06-25 Thread Jiaqi Yan
On Tue, Jun 25, 2024 at 12:05 AM Miaohe Lin wrote: > > On 2024/6/25 0:33, Jiaqi Yan wrote: > > Add regression and new tests when hugepage has correctable memory > ... > > diff --git a/tools/testing/selftests/mm/hugetlb-soft-offline.c > > b/tools/testing/selftests/mm/hugetlb-soft-offline.c > > new

Re: [PATCH v2 3/3] Turn off test_uffdio_wp if CONFIG_PTE_MARKER_UFFD_WP is not configured.

2024-06-25 Thread Peter Xu
On Tue, Jun 25, 2024 at 04:05:58PM -0700, Andrew Morton wrote: > On Mon, 24 Jun 2024 10:42:00 -0400 Peter Xu wrote: > > > > uffdio_api.features &= ~UFFD_FEATURE_WP_HUGETLBFS_SHMEM; > > > uffdio_api.features &= ~UFFD_FEATURE_WP_UNPOPULATED; > > > uffdio_api.features &= ~UFF

Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk

2024-06-25 Thread Shuah Khan
On 6/25/24 14:52, Andrew Morton wrote: On Mon, 24 Jun 2024 23:26:09 + Edward Liaw wrote: Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all resulting macro redefinition warnings. These patches will need to be merged in one shot to avoid redefinition warnings. Yes, p

Re: [PATCH v2 3/3] Turn off test_uffdio_wp if CONFIG_PTE_MARKER_UFFD_WP is not configured.

2024-06-25 Thread Andrew Morton
On Mon, 24 Jun 2024 10:42:00 -0400 Peter Xu wrote: > > uffdio_api.features &= ~UFFD_FEATURE_WP_HUGETLBFS_SHMEM; > > uffdio_api.features &= ~UFFD_FEATURE_WP_UNPOPULATED; > > uffdio_api.features &= ~UFFD_FEATURE_WP_ASYNC; > > #endif > > > > If you run the userfaultfd selfte

Re: [PATCH v9 05/39] arm64/gcs: Document the ABI for Guarded Control Stacks

2024-06-25 Thread Randy Dunlap
On 6/25/24 7:57 AM, Mark Brown wrote: > Add some documentation of the userspace ABI for Guarded Control Stacks. > > Reviewed-by: Thiago Jung Bauermann > Signed-off-by: Mark Brown > --- > Documentation/arch/arm64/gcs.rst | 233 > + > Documentation/arch/a

[PATCH v7 1/1] selftests: Centralize -D_GNU_SOURCE= to CFLAGS in lib.mk

2024-06-25 Thread Edward Liaw
Centralize the _GNU_SOURCE definition to CFLAGS in lib.mk. Remove redundant defines from Makefiles that import lib.mk. Convert any usage of "#define _GNU_SOURCE 1" to "#define _GNU_SOURCE". This uses the form "-D_GNU_SOURCE=", which is equivalent to "#define _GNU_SOURCE". Otherwise using "-D_GN

[PATCH v7 0/1] Centralize _GNU_SOURCE definition into lib.mk

2024-06-25 Thread Edward Liaw
Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all resulting macro redefinition warnings. The initial attempt at this patch was abandoned because it affected lines in many source files and caused a large amount of churn. However, from earlier discussions, centralizing _GNU_SOU

Re: [PATCH RFT v6 1/9] Documentation: userspace-api: Add shadow stack API documentation

2024-06-25 Thread Randy Dunlap
Hi, On 6/23/24 4:23 AM, Mark Brown wrote: > There are a number of architectures with shadow stack features which we are > presenting to userspace with as consistent an API as we can (though there > are some architecture specifics). Especially given that there are some > important considerations fo

[PATCH net-next v5 10/10] selftests: openvswitch: add emit_sample test

2024-06-25 Thread Adrian Moreno
Add a test to verify sampling packets via psample works. In order to do that, create a subcommand in ovs-dpctl.py to listen to on the psample multicast group and print samples. Signed-off-by: Adrian Moreno --- .../selftests/net/openvswitch/openvswitch.sh | 114 +- .../selftests

[PATCH net-next v5 09/10] selftests: openvswitch: parse trunc action

2024-06-25 Thread Adrian Moreno
The trunc action was supported decode-able but not parse-able. Add support for parsing the action string. Signed-off-by: Adrian Moreno --- .../testing/selftests/net/openvswitch/ovs-dpctl.py | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/net/openvswitc

[PATCH net-next v5 08/10] selftests: openvswitch: add userspace parsing

2024-06-25 Thread Adrian Moreno
The userspace action lacks parsing support plus it contains a bug in the name of one of its attributes. This patch makes userspace action work. Signed-off-by: Adrian Moreno --- .../selftests/net/openvswitch/ovs-dpctl.py| 24 +-- 1 file changed, 22 insertions(+), 2 deletions(

[PATCH net-next v5 07/10] selftests: openvswitch: add emit_sample action

2024-06-25 Thread Adrian Moreno
Add sample and emit_sample action support to ovs-dpctl.py. Refactor common attribute parsing logic into an external function. Signed-off-by: Adrian Moreno --- .../selftests/net/openvswitch/ovs-dpctl.py| 162 +- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/t

Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk

2024-06-25 Thread Andrew Morton
On Mon, 24 Jun 2024 23:26:09 + Edward Liaw wrote: > Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all > resulting macro redefinition warnings. > > These patches will need to be merged in one shot to avoid redefinition > warnings. Yes, please do this as a single patch a

[PATCH net-next v5 00/10] net: openvswitch: Add sample multicasting.

2024-06-25 Thread Adrian Moreno
** Background ** Currently, OVS supports several packet sampling mechanisms (sFlow, per-bridge IPFIX, per-flow IPFIX). These end up being translated into a userspace action that needs to be handled by ovs-vswitchd's handler threads only to be forwarded to some third party application that will some

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

2024-06-25 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 v14 12/13] net: add devmem TCP documentation

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

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

2024-06-25 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 --- v

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

2024-06-25 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 v14 10/13] tcp: RX path for devmem TCP

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

2024-06-25 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 v14 08/13] net: support non paged skb frags

2024-06-25 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 --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section of the functions I touched.

[PATCH net-next v14 06/13] page_pool: devmem support

2024-06-25 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 v14 05/13] page_pool: convert to use netmem

2024-06-25 Thread Mina Almasry
Abstract 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 p

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

2024-06-25 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 v14 03/13] netdev: support binding dma-buf to netdevice

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

2024-06-25 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 to

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

2024-06-25 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 --- v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel). - Fix ndo_queue_mem_free c

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

2024-06-25 Thread Mina Almasry
v14: https://patchwork.kernel.org/project/netdevbpf/list/?series=865135&archive=both&state=* No material changes in this version. Only rebase and re-verification on top of net-next. v13, I think, raced with commit ebad6d0334793 ("net/ipv4: Use nested-BH locking for ipv4_tcp_sk.") being merge

Re: [PATCH bpf-next v2 1/4] skmsg: null check for sg_page in sk_msg_recvmsg

2024-06-25 Thread John Fastabend
Eric Dumazet wrote: > On Tue, Jun 25, 2024 at 10:25 AM Geliang Tang wrote: > > > > From: Geliang Tang > > > > Run the following BPF selftests on Loongarch: > > > > ./test_progs -t sockmap_basic > > > > A Kernel panic occurs: > > > > ''' > > Oops[#1]: > > CPU: 22 PID: 2824 Comm: test_progs Taint

Re: [PATCH v3 8/9] selftests/arm: Add ptrace_64 test

2024-06-25 Thread Mark Brown
On Tue, Jun 25, 2024 at 05:54:07PM +0530, Dev Jain wrote: > +static int do_child(void) > +{ > + if (ptrace(PTRACE_TRACEME, -1, NULL, NULL)) > + ksft_exit_fail_perror("PTRACE_TRACEME"); > + > + /* SIGTRAP makes the child stop after exec; do_parent() resumes it */ > + execv("

Re: [PATCH v3 6/9] selftests/arm64: Split ptrace, use ifdeffery

2024-06-25 Thread Mark Brown
On Tue, Jun 25, 2024 at 05:54:05PM +0530, Dev Jain wrote: > --- /dev/null > +++ b/tools/testing/selftests/arm64/abi/ptrace.h > @@ -0,0 +1,135 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (C) 2024 ARM Limited. > + */ > +#include "../../kselftest.h" > + > +static void run_te

[PATCH 8/8] selftests/damon/damon_nr_regions: test online-tuned max_nr_regions

2024-06-25 Thread SeongJae Park
User could update max_nr_regions parameter while DAMON is running to a value that smaller than the current number of regions that DAMON is seeing. Such update could be done for reducing the monitoring overhead. In the case, DAMON should merge regions aggressively more than normal situation to ensu

[PATCH 7/8] _damon_sysfs: implement commit() for online parameters update

2024-06-25 Thread SeongJae Park
Users can update DAMON parameters while it is running, using 'commit' DAMON sysfs interface command. For testing the feature in future tests, implement a function for doing that on the test-purpose DAMON sysfs interface wrapper Python module. Signed-off-by: SeongJae Park --- tools/testing/selft

[PATCH 6/8] selftests/damon: implement test for min/max_nr_regions

2024-06-25 Thread SeongJae Park
Implement a kselftest for DAMON's {min,max}_nr_regions' parameters. The test ensures both the minimum and the maximum number of regions limit is respected even if the workload's real number of regions is less than the minimum or larger than the maximum limits. Signed-off-by: SeongJae Park --- t

[PATCH 5/8] selftests/damon/_damon_sysfs: implement kdamonds stop function

2024-06-25 Thread SeongJae Park
Implement DAMON stop function on the test-purpose DAMON sysfs interface wrapper Python module, _damon_sysfs.py. This feature will be used by future DAMON tests that need to start/stop DAMON multiple times. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 11 +

[PATCH 4/8] selftests/damon: implement DAMOS tried regions test

2024-06-25 Thread SeongJae Park
Implement a test for DAMOS tried regions command of DAMON sysfs interface. It ensures the expected number of monitoring regions are created using an artificial memory access pattern generator program. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/Makefile| 1 + .../sel

[PATCH 3/8] selftests/damon: implement a program for even-numbered memory regions access

2024-06-25 Thread SeongJae Park
To test schemes_tried_regions feature, we need to have a program having specific number of regions that having different access pattern. Existing artificial access pattern generator, 'access_memory', cannot be used for the purpose, since it accesses only one region at a given time. Extending it cou

[PATCH 2/8] selftests/damon/_damon_sysfs: support schemes_update_tried_regions

2024-06-25 Thread SeongJae Park
Implement schemes_update_tried_regions DAMON sysfs command on _damon_sysfs.py, to use on implementations of future tests for the feature. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff

[PATCH 1/8] selftests/damon/access_memory: use user-defined region size

2024-06-25 Thread SeongJae Park
'access_memory' is an artificial memory access pattern generator for DAMON tests. It creates and accesses memory regions that the user specified the number and size via the command line. However, real access part of the program ignores the user-specified size of each region. Instead, it uses a h

[PATCH 0/8] selftests/damon: test DAMOS tried regions and {min,max}_nr_regions

2024-06-25 Thread SeongJae Park
This patch series fix a minor issue in a program for DAMON selftest, and implement new functionality selftests for DAMOS tried regions and {min,max}_nr_regions. The test for max_nr_regions also test the recovery from online tuning-caused limit violation, which was fixed by a previous patch [1] tit

Re: [PATCH] selftests/proc: fix unused result warning during test compilation

2024-06-25 Thread Andrew Morton
On Tue, 25 Jun 2024 15:21:39 + Abhinav Jain wrote: > Check the return value from write function to get rid of the warning > during test compilation, shared below. > Tested by compiling after the change, the warning disappears. > > proc-empty-vm.c:385:17: warning: ignoring return value of ‘w

Re: [PATCH v3 4/9] selftests/arm: Add signal tests

2024-06-25 Thread Mark Brown
On Tue, Jun 25, 2024 at 05:54:03PM +0530, Dev Jain wrote: > This patch introduces two signal tests, and generic test wrappers similar > to selftests/arm64/signal directory, along with the mangling testcases > found therein. arm_cpsr, dumped by the kernel to user space in the ucontext > structure to

[PATCH net-next v3 6/7] selftests: net: Use the provided dpctl rather than the vswitchd for tests.

2024-06-25 Thread Aaron Conole
The current pmtu test infrastucture requires an installed copy of the ovs-vswitchd userspace. This means that any automated or constrained environments may not have the requisite tools to run the tests. However, the pmtu tests don't require any special classifier processing. Indeed they are only

[PATCH net-next v3 7/7] selftests: net: add config for openvswitch

2024-06-25 Thread Aaron Conole
The pmtu testing will require that the OVS module is installed, so do that. Reviewed-by: Simon Horman Tested-by: Simon Horman Signed-off-by: Aaron Conole --- tools/testing/selftests/net/config | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/net/config b/tools/

[PATCH net-next v3 5/7] selftests: openvswitch: Support implicit ipv6 arguments.

2024-06-25 Thread Aaron Conole
The current iteration of IPv6 support requires explicit fields to be set in addition to not properly support the actual IPv6 addresses properly. With this change, make it so that the ipv6() bare option is usable to create wildcarded flows to match broad swaths of ipv6 traffic. Reviewed-by: Simon H

[PATCH net-next v3 4/7] selftests: openvswitch: Add support for tunnel() key.

2024-06-25 Thread Aaron Conole
This will be used when setting details about the tunnel to use as transport. There is a difference between the ODP format between tunnel(): the 'key' flag is not actually a flag field, so we don't support it in the same way that the vswitchd userspace supports displaying it. Signed-off-by: Aaron

[PATCH net-next v3 3/7] selftests: openvswitch: Add set() and set_masked() support.

2024-06-25 Thread Aaron Conole
These will be used in upcoming commits to set specific attributes for interacting with tunnels. Since set() will use the key parsing routine, we also make sure to prepend it with an open paren, for the action parsing to properly understand it. Reviewed-by: Simon Horman Tested-by: Simon Horman S

[PATCH net-next v3 2/7] selftests: openvswitch: Refactor actions parsing.

2024-06-25 Thread Aaron Conole
Until recently, the ovs-dpctl utility was used with a limited actions set and didn't need to have support for multiple similar actions. However, when adding support for tunnels, it will be important to support multiple set() actions in a single flow. When printing these actions, the existing code

[PATCH net-next v3 1/7] selftests: openvswitch: Support explicit tunnel port creation.

2024-06-25 Thread Aaron Conole
The OVS module can operate in conjunction with various types of tunnel ports. These are created as either explicit tunnel vport types, OR by creating a tunnel interface which acts as an anchor for the lightweight tunnel support. This patch adds the ability to add tunnel ports to an OVS datapath f

[PATCH net-next v3 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-25 Thread Aaron Conole
Currently, if a user wants to run pmtu.sh and cover all the provided test cases, they need to install the Open vSwitch userspace utilities. This dependency is difficult for users as well as CI environments, because the userspace build and setup may require lots of support and devel packages to be

Re: [PATCH v2 net-next 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-25 Thread Jakub Kicinski
On Tue, 25 Jun 2024 11:17:14 -0400 Aaron Conole wrote: > > BTW I popped the v2 back into the queue, so the next run (in 20min) > > will tell us if that's the only thing we were missing 🤞️ > > :) I'll wait to post the v3 then. So far, the only change I have is: > > --- a/tools/testing/selftest

Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-06-25 Thread Reinette Chatre
Hi Maciej, On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote: Hello, sorry it took me so long to get back to this. I prepared the next version with your comments applied and Tony's replies taken into account. Thank you very much for sticking with this. I wanted to briefly discuss this before

Re: [PATCH net] selftests: net: remove unneeded IP_GRE config

2024-06-25 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Mon, 24 Jun 2024 13:55:39 +0800 you wrote: > It seems that there is no definition for config IP_GRE, and it is not a > dependency of other configs, so remove it. > > linux$ find -name Kconfig | xargs grep "IP_GRE"

Re: [PATCH v5 1/4] mm/memory-failure: refactor log format in soft offline code

2024-06-25 Thread Jiaqi Yan
On Mon, Jun 24, 2024 at 11:41 PM Miaohe Lin wrote: > > On 2024/6/25 0:33, Jiaqi Yan wrote: > > Logs from soft_offline_page and soft_offline_in_use_page have > > different formats than majority of the memory failure code: > > > > "Memory failure: 0x${pfn}: ${lower_case_message}" > > > > Convert t

Re: [PATCH v2 net-next 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-25 Thread Stefano Brivio
On Tue, 25 Jun 2024 07:06:54 -0700 Jakub Kicinski wrote: > On Tue, 25 Jun 2024 09:20:29 -0400 Aaron Conole wrote: > > > I'm still wondering if the issue is Kconfig-related (plus possibly bad > > > interaction with vng). I don't see the OVS knob enabled in the self- > > > tests config. If it's imp

Re: [PATCH v3 3/9] selftests: arm, arm64: Use ifdeffery to pull signal infrastructure

2024-06-25 Thread Mark Brown
On Tue, Jun 25, 2024 at 05:54:02PM +0530, Dev Jain wrote: > Use ifdeffery to guard code chunks meant specifically for arm64, in > preparation for putting signal tests in selftests/arm. I've got to say I don't love this but I'm not sure how much better we could do if we want to share the code. Th

Re: [PATCH v3 9/9] selftests: Add build infrastructure along with README

2024-06-25 Thread Mark Brown
On Tue, Jun 25, 2024 at 05:54:08PM +0530, Dev Jain wrote: > Add arm target, individual Makefile targets, and instructions to build the > tests, along with .gitignore files. All the Makefiles are similar to > selftests/arm64, except abi: use TEST_CUSTOM_PROGS to override the make > rule from lib.mk

[PATCH] selftests/proc: fix unused result warning during test compilation

2024-06-25 Thread Abhinav Jain
Check the return value from write function to get rid of the warning during test compilation, shared below. Tested by compiling after the change, the warning disappears. proc-empty-vm.c:385:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]

Re: [PATCH v2 net-next 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-25 Thread Aaron Conole
Jakub Kicinski writes: > On Tue, 25 Jun 2024 10:14:24 -0400 Aaron Conole wrote: >> > Sorry for not checking it earlier, looks like the runner was missing >> > pyroute: >> > >> > # python3 ./tools/testing/selftests/net/openvswitch/ovs-dpctl.py >> > Need to install the python pyroute2 package >= 0.

[RFC PATCH 3/3] selftests/tracing: Add hist poll() support test

2024-06-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) --- tools/testing/selftests/ftrace/Makefile|

[RFC PATCH 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-06-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event return

[RFC PATCH 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-06-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But th

[RFC PATCH 0/3] tracing: Support poll on event hist file

2024-06-25 Thread Masami Hiramatsu (Google)
Hi, Here is an RFC patch to support polling on event 'hist' file. There has been interest in allowing user programs to monitor kernel events in real time. Ftrace provides `trace_pipe` interface to wait on events in the ring buffer, but it is needed to wait until filling up a page with events in t

[PATCH v9 39/39] kselftest/arm64: Enable GCS for the FP stress tests

2024-06-25 Thread Mark Brown
While it's a bit off topic for them the floating point stress tests do give us some coverage of context thrashing cases, and also of active signal delivery separate to the relatively complicated framework in the actual signals tests. Have the tests enable GCS on startup, ignoring failures so they c

[PATCH v9 38/39] kselftest/arm64: Add a GCS stress test

2024-06-25 Thread Mark Brown
Add a stress test which runs one more process than we have CPUs spinning through a very recursive function with frequent syscalls immediately prior to return and signals being injected every 100ms. The goal is to flag up any scheduling related issues, for example failure to ensure that barriers are

[PATCH v9 37/39] kselftest/arm64: Add GCS signal tests

2024-06-25 Thread Mark Brown
Do some testing of the signal handling for GCS, checking that a GCS frame has the expected information in it and that the expected signals are delivered with invalid operations. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/.gitignore|

[PATCH v9 36/39] kselftest/arm64: Add test coverage for GCS mode locking

2024-06-25 Thread Mark Brown
Verify that we can lock individual GCS mode bits, that other modes aren't affected and as a side effect also that every combination of modes can be enabled. Normally the inability to reenable GCS after disabling it would be an issue with testing but fortunately the kselftest_harness runs each test

[PATCH v9 35/39] kselftest/arm64: Add a GCS test program built with the system libc

2024-06-25 Thread Mark Brown
There are things like threads which nolibc struggles with which we want to add coverage for, and the ABI allows us to test most of these even if libc itself does not understand GCS so add a test application built using the system libc. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown

[PATCH v9 34/39] kselftest/arm64: Add very basic GCS test program

2024-06-25 Thread Mark Brown
This test program just covers the basic GCS ABI, covering aspects of the ABI as standalone features without attempting to integrate things. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/Makefile| 2 +- tools/testing/selftests/arm64/gcs/

[PATCH v9 33/39] kselftest/arm64: Always run signals tests with GCS enabled

2024-06-25 Thread Mark Brown
Since it is not possible to return from the function that enabled GCS without disabling GCS it is very inconvenient to use the signal handling tests to cover GCS when GCS is not enabled by the toolchain and runtime, something that no current distribution does. Since none of the testcases do anythin

[PATCH v9 32/39] kselftest/arm64: Allow signals tests to specify an expected si_code

2024-06-25 Thread Mark Brown
Currently we ignore si_code unless the expected signal is a SIGSEGV, in which case we enforce it being SEGV_ACCERR. Allow test cases to specify exactly which si_code should be generated so we can validate this, and test for other segfault codes. Reviewed-by: Thiago Jung Bauermann Signed-off-by: M

[PATCH v9 31/39] kselftest/arm64: Add framework support for GCS to signal handling tests

2024-06-25 Thread Mark Brown
Teach the framework about the GCS signal context, avoiding warnings on the unknown context. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/testcases/testcases.c | 7 +++ tools/testing/selftests/arm64/signal/testcases/testcases.h | 1 +

[PATCH v9 30/39] kselftest/arm64: Add GCS as a detected feature in the signal tests

2024-06-25 Thread Mark Brown
In preparation for testing GCS related signal handling add it as a feature we check for in the signal handling support code. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/test_signals.h | 2 ++ tools/testing/selftests/arm64/signal/te

[PATCH v9 29/39] selftests/clone3: Enable arm64 shadow stack testing

2024-06-25 Thread Mark Brown
In order to test shadow stack support in clone3() the clone3() selftests need to have a fully inline clone3() call, provide one for arm64. Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3_selftests.h | 26 +++ 1 file changed, 26 insertions(+) diff --git a/

[PATCH v9 28/39] kselftest: Provide shadow stack enable helpers for arm64

2024-06-25 Thread Mark Brown
Allow test programs to use the shadow stack helpers on arm64. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/ksft_shstk.h | 37 1 file changed, 37 insertions(+) diff --git a/tools/testing/selftests/ksft_shstk.h b/t

[PATCH v9 27/39] kselftest/arm64: Verify the GCS hwcap

2024-06-25 Thread Mark Brown
Add coverage of the GCS hwcap to the hwcap selftest, using a read of GCSPR_EL0 to generate SIGILL without having to worry about enabling GCS. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/abi/hwcap.c | 19 +++ 1 file changed, 19 i

[PATCH v9 26/39] arm64: Add Kconfig for Guarded Control Stack (GCS)

2024-06-25 Thread Mark Brown
Provide a Kconfig option allowing the user to select if GCS support is built into the kernel. Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- arch/arm64/Kconfig | 20 1 file changed, 20 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig ind

[PATCH v9 25/39] arm64/ptrace: Expose GCS via ptrace and core files

2024-06-25 Thread Mark Brown
Provide a new register type NT_ARM_GCS reporting the current GCS mode and pointer for EL0. Due to the interactions with allocation and deallocation of Guarded Control Stacks we do not permit any changes to the GCS mode via ptrace, only GCSPR_EL0 may be changed. Reviewed-by: Thiago Jung Bauermann

[PATCH v9 24/39] arm64/signal: Expose GCS state in signal frames

2024-06-25 Thread Mark Brown
Add a context for the GCS state and include it in the signal context when running on a system that supports GCS. We reuse the same flags that the prctl() uses to specify which GCS features are enabled and also provide the current GCS pointer. We do not support enabling GCS via signal return, there

[PATCH v9 23/39] arm64/signal: Set up and restore the GCS context for signal handlers

2024-06-25 Thread Mark Brown
When invoking a signal handler we use the GCS configuration and stack for the current thread. Since we implement signal return by calling the signal handler with a return address set up pointing to a trampoline in the vDSO we need to also configure any active GCS for this by pushing a frame for th

[PATCH v9 22/39] arm64/mm: Implement map_shadow_stack()

2024-06-25 Thread Mark Brown
As discussed extensively in the changelog for the addition of this syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the existing mmap() and madvise() syscalls do not map entirely well onto the security requirements for guarded control stacks since they lead to windows where memory i

  1   2   >