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
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
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
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
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
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
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
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
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/
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:
>
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
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
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 +
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
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
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
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
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
> > ---
>
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 +
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
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
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
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
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
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
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
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
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
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
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(
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
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
** 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
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
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
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
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
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
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
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.
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
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
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:
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
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
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
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
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
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("
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
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
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
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
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 +
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
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
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
'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
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
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
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
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
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/
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
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
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
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
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
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
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
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
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"
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
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
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
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
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]
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.
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|
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
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
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
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
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
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|
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
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
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/
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
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
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 +
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
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/
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
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
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
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
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
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
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 - 100 of 157 matches
Mail list logo