Re: [PATCH RFT v12 0/8] fork: Support shadow stacks in clone3()

2024-11-01 Thread Mark Brown
On Thu, Oct 31, 2024 at 09:06:09PM +, Edgecombe, Rick P wrote: > On Thu, 2024-10-31 at 19:25 +0000, Mark Brown wrote: > > base-commit: d17cd7b7cc92d37ee8b2df8f975fc859a261f4dc > Where can I find this base commit? Ah, that's still my branch from when I posted what's no

[PATCH RFT v12 4/8] fork: Add shadow stack support to clone3()

2024-10-31 Thread Mark Brown
-by: Mark Brown --- arch/arm64/mm/gcs.c | 54 +- arch/x86/include/asm/shstk.h | 11 +++-- arch/x86/kernel/process.c| 2 +- arch/x86/kernel/shstk.c | 57 +--- include/asm-generic/cacheflush.h | 11 + include/linux/sched

[PATCH RFT v12 8/8] selftests/clone3: Test shadow stack support

2024-10-31 Thread Mark Brown
., this should be overly cautious. Acked-by: Shuah Khan Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3.c | 143 +- tools/testing/selftests/clone3/clone3_selftests.h | 63 ++ 2 files changed, 205 insertions(+), 1 deletion(-) diff --git a

[PATCH RFT v12 7/8] selftests/clone3: Allow tests to flag if -E2BIG is a valid error code

2024-10-31 Thread Mark Brown
iewed-by: Catalin Marinas Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c index e066b201fa64eb17c55939b7cec18ac5d10

[PATCH RFT v12 6/8] selftests/clone3: Factor more of main loop into test_clone3()

2024-10-31 Thread Mark Brown
change. Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Reviewed-by: Catalin Marinas Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3.c | 77 - 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/tools/testing

[PATCH RFT v12 5/8] selftests/clone3: Remove redundant flushes of output streams

2024-10-31 Thread Mark Brown
s. Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Reviewed-by: Catalin Marinas Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3_selftests.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/clone3/clone3_selftests.h b/tools/te

[PATCH RFT v12 3/8] selftests: Provide helper header for shadow stack testing

2024-10-31 Thread Mark Brown
interfaces. Reviewed-by: Rick Edgecombe Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Signed-off-by: Mark Brown --- tools/testing/selftests/ksft_shstk.h | 98 1 file changed, 98 insertions(+) diff --git a/tools/testing/selftests/ksft_shstk.h b

[PATCH RFT v12 2/8] Documentation: userspace-api: Add shadow stack API documentation

2024-10-31 Thread Mark Brown
feature let's provide some documentation covering the common aspects. Reviewed-by: Catalin Marinas Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Signed-off-by: Mark Brown --- Documentation/userspace-api/index.rst| 1 + Documentation/userspace-api/shadow_stack.rst

[PATCH RFT v12 1/8] arm64/gcs: Return a success value from gcs_alloc_thread_stack()

2024-10-31 Thread Mark Brown
error code on failure. Acked-by: Deepak Gupta Signed-off-by: Mark Brown --- arch/arm64/include/asm/gcs.h | 8 arch/arm64/kernel/process.c | 8 arch/arm64/mm/gcs.c | 8 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/gcs.h b

[PATCH RFT v12 0/8] fork: Support shadow stacks in clone3()

2024-10-31 Thread Mark Brown
..@kernel.org/T/#mc58f97f27461749ccf400ebabf6f9f937116a86b Signed-off-by: Mark Brown --- Changes in v12: - Add the regular prctl() to the userspace API document since arm64 support is queued in -next. - Link to v11: https://lore.kernel.org/r/20241005-clone3-shadow-stack-v11-0-2a6a2bd6d...@kernel.

Re: [PATCH RFT v11 0/8] fork: Support shadow stacks in clone3()

2024-10-30 Thread Mark Brown
On Sat, Oct 05, 2024 at 11:31:27AM +0100, Mark Brown wrote: > The kernel has recently added support for shadow stacks, currently > x86 only using their CET feature but both arm64 and RISC-V have > equivalent features (GCS and Zicfiss respectively), I am actively > working on GCS[1].

[PATCH v2 2/2] kselftest/arm64: Poll less often while waiting for fp-stress children

2024-10-29 Thread Mark Brown
ignal raise interval when all the children are started and we start sending signals. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/self

[PATCH v2 0/2] kselftest/arm64: fp-stress signal delivery interval improvements

2024-10-29 Thread Mark Brown
One of the things that fp-stress does to stress the floating point context switching is send signals to the test threads it spawns. Currently we do this once per second but as suggested by Mark Rutland if we increase this we can improve the chances of triggering any issues with context switching

[PATCH v2 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Brown
moved the signal generation out of the main supervisor thread, though we should also consider that he percentage of time that we spend interacting with the floating point state is also a consideration. Suggested-by: Mark Rutland Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp

Re: [PATCH 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Brown
On Tue, Oct 29, 2024 at 03:43:37PM +, Mark Rutland wrote: > On those emulated platforms (FVP?), does this change trigger the faukure > more often? Yes. > I gave this a quick test, and with this change, running fp-stress on a > defconfig kernel running on 1 CPU triggers the

Re: [PATCH 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Rutland
Hi Mark, On Tue, Oct 29, 2024 at 12:10:39AM +, Mark Brown wrote: > Currently we only deliver signals to the processes being tested about > once a second, meaning that the signal code paths are subject to > relatively little stress. Increase this frequency substantially to > 25

Re: [PATCH 2/2] kselftest/arm64: Lower poll interval while waiting for fp-stress children

2024-10-29 Thread Mark Rutland
this looks fine. Mark. On Tue, Oct 29, 2024 at 12:10:40AM +0000, Mark Brown wrote: > While fp-stress is waiting for children to start it doesn't send any > signals to them so there is no need for it to have as short an epoll() > timeout as it does when the children are all running.

[PATCH] kselftest/arm64: Use ksft_perror() to log MTE failures

2024-10-29 Thread Mark Brown
more information is available should the tests fail. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/mte/mte_common_util.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/arm64/mte/mte_common_util.c b/tools/testing/selftests/

[PATCH 2/2] kselftest/arm64: Lower poll interval while waiting for fp-stress children

2024-10-28 Thread Mark Brown
ignal raise interval when all the children are started and we start sending signals. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/self

[PATCH 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-28 Thread Mark Brown
moved the signal generation out of the main supervisor thread, though we should also consider that he percentage of time that we spend interacting with the floating point state is also a consideration. Suggested-by: Mark Rutland Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp

[PATCH 0/2] kselftest/arm64: fp-stress signal delivery interval improvements

2024-10-28 Thread Mark Brown
One of the things that fp-stress does to stress the floating point context switching is send signals to the test threads it spawns. Currently we do this once per second but as suggested by Mark Rutland if we increase this we can improve the chances of triggering any issues with context switching

[PATCH] kselftest/arm64: Fix encoding for SVE B16B16 test

2024-10-28 Thread Mark Brown
The test for SVE_B16B16 had a cut'n'paste of a SME instruction, fix it with a relevant SVE instruction. Fixes: 44d10c27bd75 ("kselftest/arm64: Add 2023 DPISA hwcap test coverage") Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/abi/hwcap.c | 4 ++-- 1 file c

Re: kselftest:arm64/FVP: arm64_check_buffer_fill - failed on Linux next-20241025

2024-10-28 Thread Mark Brown
On Tue, Oct 29, 2024 at 01:16:32AM +0530, Naresh Kamboju wrote: > The following kselftest arm64 and FVP failed with Linux next-20241025 on > - Qemu-arm64 > - FVP > > running Linux next-20241025 kernel. > > First seen on next-20241025 > Good: next-20241024 > BAD: next-20241025 > > kself

Re: [PATCH 0/6] kselftest/arm64: Test floating point signal context restore in fp-stress

2024-10-28 Thread Mark Rutland
On Wed, Oct 23, 2024 at 09:38:28PM +0100, Mark Brown wrote: > Currently we test signal delivery to the programs run by fp-stress but > our signal handlers simply count the number of signals seen and don't do > anything with the floating point state. The original fpsimd-test

Re: [PATCH 0/6] kselftest/arm64: Test floating point signal context restore in fp-stress

2024-10-28 Thread Mark Brown
On Mon, Oct 28, 2024 at 02:26:44PM +, Mark Rutland wrote: > 1) We only singal the tasks once a second. Dave's original shell test >script hammered this constantly, and it makes a substantial impact >actually triggering a bug. >Without these patches, I hacked the

Re: [PATCH for-next 1/7] selftests/alsa: Add a few missing gitignore files

2024-10-25 Thread Mark Brown
On Fri, Oct 25, 2024 at 09:40:04AM +0800, Li Zhijian wrote: > index 12dc3fcd3456..1407fd24a97b 100644 > --- a/tools/testing/selftests/alsa/.gitignore > +++ b/tools/testing/selftests/alsa/.gitignore > @@ -1,3 +1,5 @@ > mixer-test > pcm-test > test-pcmtest-driver > +global-timer > +utimer-test >

[PATCH 1/6] kselftest/arm64: Correct misleading comments on fp-stress irritators

2024-10-23 Thread Mark Brown
current register state which is expected to be overwritten on return from the handler by the saved register state. Update the comment to reflect what the handler is actually doing. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fpsimd-test.S | 3 +-- tools/testing/selftests/arm64

[PATCH 4/6] kselftest/arm64: Implement irritators for ZA and ZT

2024-10-23 Thread Mark Brown
ment them, just trivially SMSTOP and SMSTART to reset all bits in the register to 0. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/za-test.S | 12 tools/testing/selftests/arm64/fp/zt-test.S | 12 2 files changed, 8 insertions(+), 16 deletions(-) dif

[PATCH 6/6] kselftest/arm64: Test signal handler state modification in fp-stress

2024-10-23 Thread Mark Brown
the signal handler, verifying that when we return the saved register state is restored from the signal context as expected. Switch over to triggering that to validate that we are restoring as expected. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 2 +- 1 file

[PATCH 5/6] kselftest/arm64: Provide a SIGUSR1 handler in the kernel mode FP stress test

2024-10-23 Thread Mark Brown
s the number of signals like we do for SIGUSR2, allowing fp-stress to treat all the test programs uniformly. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/kernel-test.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/arm64/fp/kernel-test.c b/tools/te

[PATCH 3/6] kselftest/arm64: Corrupt P15 in the irritator when testing SSVE

2024-10-23 Thread Mark Brown
When building for streaming SVE the irritator for SVE skips updates of both P15 and FFR. While FFR is skipped since it might not be present there is no reason to skip corrupting P15 so move the ifdef appropriately. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/sve-test.S | 2

[PATCH 2/6] kselftest/arm64: Remove unused ADRs from irritator handlers

2024-10-23 Thread Mark Brown
The irritator handlers for the fp-stress test programs all use ADR to load an address into x0 which is then not referenced. Remove these ADRs as they just cause confusion. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fpsimd-test.S | 1 - tools/testing/selftests/arm64/fp/sve

[PATCH 0/6] kselftest/arm64: Test floating point signal context restore in fp-stress

2024-10-23 Thread Mark Brown
test programs that can have them and then switch the signals generated by the fp-stress program over to use the irritators, ensuring that we validate that we restore the saved signal context properly. Signed-off-by: Mark Brown --- Mark Brown (6): kselftest/arm64: Correct misleading comments

[PATCH] kselftest/arm64: Log fp-stress child startup errors to stdout

2024-10-22 Thread Mark Brown
g for output from the child. Improve robustness and output quality by logging to stdout instead. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/arm64/fp/fp-stress

[PATCH] KVM: selftests: Fix build on on non-x86 architectures

2024-10-21 Thread Mark Brown
ddition of this x86 specific command line flag conditional on building for x86. Fixes: 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions") Signed-off-by: Mark Brown --- tools/testing/selftests/kvm/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH] kselftest/arm64: Fail the overall fp-stress test if any test fails

2024-10-17 Thread Mark Brown
Currently fp-stress does not report a top level test result if it runs to completion, it always exits with a return code 0. Use the ksft_finished() helper to ensure that the exit code for the top level program reports a failure if any of the individual tests has failed. Signed-off-by: Mark Brown

[PATCH] kselftest/arm64: Ensure stable names for GCS stress test results

2024-10-11 Thread Mark Brown
The GCS stress test program currently uses the PID of the threads it creates in the test names it reports, resulting in unstable test names between runs. Fix this by using a thread number instead. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/gcs/gcs-stress.c | 6 +++--- 1 file

Re: [PATCH v3] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-09 Thread Mark Brown
On Tue, Oct 08, 2024 at 05:35:18PM +0200, Björn Töpel wrote: > The sched_ext selftests is missing proper cross-compilation support, a > proper target entry, and out-of-tree build support. Tested-by: Mark Brown Reviewed-by: Mark Brown There's still the thing with picking up the hos

Re: [PATCH v2] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-07 Thread Mark Brown
On Mon, Oct 07, 2024 at 06:00:57PM +0200, Björn Töpel wrote: > The sched_ext BPF programs relies on a vmlinux.h, which is generated > using bpftool and the vmlinux with BTF information. Have you built a > kernel with BTF support? OK, so having beaten the kernel config into shape and using GCC rat

Re: [PATCH v2] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-07 Thread Mark Brown
On Mon, Oct 07, 2024 at 06:45:32PM +0200, Björn Töpel wrote: > Mark Brown writes: > > I didn't actually build a kernel, if the build system needs a kernel > > it's just silently not detected that it's missing? > It tries to find a kernel with BTF: >

Re: [PATCH v2] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-07 Thread Mark Brown
On Mon, Oct 07, 2024 at 06:00:57PM +0200, Björn Töpel wrote: > Mark Brown writes: > > When building for arm64 with this applied on top of mainline or -next > > I'm seeing: > Thanks for taking it for a spin! > >make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C

Re: [PATCH v2] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-07 Thread Mark Brown
On Mon, Oct 07, 2024 at 06:00:57PM +0200, Björn Töpel wrote: > Mark Brown writes: > > On Mon, Oct 07, 2024 at 09:31:32AM +0200, Björn Töpel wrote: > > CLNG-BPF create_dsq.bpf.o > > In file included from create_dsq.bpf.c:9: > > /home/broonie/git/linux/tools/sched_ext/

Re: [PATCH v2] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-07 Thread Mark Brown
On Mon, Oct 07, 2024 at 09:31:32AM +0200, Björn Töpel wrote: > When building the kselftest suite, e.g.: > make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ > SKIP_TARGETS="" O=/output/foo -C tools/testing/selftests install > The expectation is that the sched_ext is included, cross-built,

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

2024-10-07 Thread Mark Brown
On Mon, Oct 07, 2024 at 10:07:24AM +0530, Dev Jain wrote: > On 9/16/24 09:28, Dev Jain wrote: > > Gentle ping, adding all x86 maintainers and the x86 list, in case they > > missed. > Gentle ping Given that this was posted prior to the merge window you should probably resend it at this point. s

Re: [PATCH] selftests: Do not skip BPF selftests by default

2024-10-05 Thread Mark Brown
On Sat, Oct 05, 2024 at 12:12:15PM +0200, Björn Töpel wrote: > Mark Brown writes: > > On Fri, Oct 04, 2024 at 03:34:49PM +0200, Björn Töpel wrote: > >> Mark Brown writes: > > It's a bit unfortunate having to pull clang into GCC build containers, > > and needi

[PATCH RFT v11 8/8] selftests/clone3: Test shadow stack support

2024-10-05 Thread Mark Brown
., this should be overly cautious. Acked-by: Shuah Khan Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3.c | 143 +- tools/testing/selftests/clone3/clone3_selftests.h | 63 ++ 2 files changed, 205 insertions(+), 1 deletion(-) diff --git a

[PATCH RFT v11 7/8] selftests/clone3: Allow tests to flag if -E2BIG is a valid error code

2024-10-05 Thread Mark Brown
d-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c index e066b201fa64eb17c55939b7cec18ac5d109613b..5b8b7d640e70132242fc6939450669acd0c534f9 1

[PATCH RFT v11 6/8] selftests/clone3: Factor more of main loop into test_clone3()

2024-10-05 Thread Mark Brown
change. Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3.c | 77 - 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/tools/testing/selftests/clone3/clone3.c b

[PATCH RFT v11 5/8] selftests/clone3: Remove redundant flushes of output streams

2024-10-05 Thread Mark Brown
s. Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Signed-off-by: Mark Brown --- tools/testing/selftests/clone3/clone3_selftests.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/clone3/clone3_selftests.h b/tools/testing/selftests/clone3/clone3_se

[PATCH RFT v11 4/8] fork: Add shadow stack support to clone3()

2024-10-05 Thread Mark Brown
-by: Mark Brown --- arch/arm64/mm/gcs.c | 54 +- arch/x86/include/asm/shstk.h | 11 +++-- arch/x86/kernel/process.c| 2 +- arch/x86/kernel/shstk.c | 57 +--- include/asm-generic/cacheflush.h | 11 + include/linux/sched

[PATCH RFT v11 3/8] selftests: Provide helper header for shadow stack testing

2024-10-05 Thread Mark Brown
interfaces. Reviewed-by: Rick Edgecombe Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Signed-off-by: Mark Brown --- tools/testing/selftests/ksft_shstk.h | 98 1 file changed, 98 insertions(+) diff --git a/tools/testing/selftests/ksft_shstk.h b

[PATCH RFT v11 2/8] Documentation: userspace-api: Add shadow stack API documentation

2024-10-05 Thread Mark Brown
feature let's provide some documentation covering the common aspects. Reviewed-by: Catalin Marinas Reviewed-by: Kees Cook Tested-by: Kees Cook Acked-by: Shuah Khan Signed-off-by: Mark Brown --- Documentation/userspace-api/index.rst| 1 + Documentation/userspace-api/shadow_stack.rst

[PATCH RFT v11 1/8] arm64/gcs: Return a success value from gcs_alloc_thread_stack()

2024-10-05 Thread Mark Brown
error code on failure. Signed-off-by: Mark Brown --- arch/arm64/include/asm/gcs.h | 8 arch/arm64/kernel/process.c | 8 arch/arm64/mm/gcs.c | 8 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/gcs.h b/arch/arm64/include/asm/

[PATCH RFT v11 0/8] fork: Support shadow stacks in clone3()

2024-10-05 Thread Mark Brown
..@kernel.org/T/#mc58f97f27461749ccf400ebabf6f9f937116a86b Signed-off-by: Mark Brown --- Changes in v11: - Rebase onto arm64 for-next/gcs, which is based on v6.12-rc1, and integrate arm64 support. - Rework the interface to specify a shadow stack pointer rather than a base and size like we do for th

[PATCH] kselftest/arm64: Validate that GCS push and write permissions work

2024-10-04 Thread Mark Brown
to get the permissions in case the system is locked down to make them inaccessible. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/gcs/.gitignore | 2 + tools/testing/selftests/arm64/gcs/Makefile | 8 ++- tools/testing/selftests/arm64/gcs/gcspushm.S | 96

Re: [PATCH] selftests: Do not skip BPF selftests by default

2024-10-04 Thread Mark Brown
On Fri, Oct 04, 2024 at 03:34:49PM +0200, Björn Töpel wrote: > Mark Brown writes: > > On Fri, Oct 04, 2024 at 11:53:47AM +0200, Björn Töpel wrote: > >> This effectively is a revert of commit 7a6eb7c34a78 ("selftests: Skip > >> BPF seftests by default"). At

Re: [PATCH] selftests: Do not skip BPF selftests by default

2024-10-04 Thread Mark Brown
On Fri, Oct 04, 2024 at 11:53:47AM +0200, Björn Töpel wrote: > From: Björn Töpel > > This effectively is a revert of commit 7a6eb7c34a78 ("selftests: Skip > BPF seftests by default"). At the time when this was added, BPF had > "build time dependencies on cutting edge versions". Since then a > num

Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-10-02 Thread Mark Brown
On Wed, Oct 02, 2024 at 02:42:58PM +0100, Mark Brown wrote: > On Tue, Oct 01, 2024 at 11:03:10PM +, Edgecombe, Rick P wrote: > > I'm not so sure. The thing is a regular stack can be re-used in full - just > > set > > the RSP to the end and take advantage of the w

Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-10-02 Thread Mark Brown
On Tue, Oct 01, 2024 at 11:03:10PM +, Edgecombe, Rick P wrote: > On Tue, 2024-10-01 at 18:33 +0100, Mark Brown wrote: > > My suspicion would be that if we're doing the pivot to a previously used > > shadow stack we'd also be pivoting the regular stack along wit

Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-10-01 Thread Mark Brown
On Tue, Oct 01, 2024 at 05:12:38PM +0200, Christian Brauner wrote: > On Fri, Sep 27, 2024 at 03:21:59PM GMT, Edgecombe, Rick P wrote: > > Did you catch that a token can be at a different offsets location on the > > stack > > depending on args passed to map_shadow_stack? So userspace will need >

[PATCH] KVM: selftests: Fix build on architectures other than x86_64

2024-09-30 Thread Mark Brown
004a ("KVM: selftests: Allow slot modification stress test with quirk disabled") Reported-by: Aishwarya TCV Signed-off-by: Mark Brown --- This is obviously disruptive for testing of KVM changes on non-x86 architectures. --- tools/testing/selftests/kvm/memslot_modification_stress_test.c |

[PATCH] remoteproc: virtio: Add synchronize_cbs to remoteproc_virtio

2024-09-20 Thread Mark-PK Tsai
ly in __rproc_virtio_del_vqs before virtqueue is free to ensure that rproc_vq_interrupt is aware of the virtqueue removal. The synchronized_vqs is expected to be implemented in rproc driver to ensure that all previous vring_interrupts are handled before the vqs are marked as broken or removed. Signed-off-by: Ma

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

2024-09-05 Thread Mark Brown
On Thu, Sep 05, 2024 at 11:26:02AM +0530, Dev Jain wrote: > On 9/4/24 22:35, Shuah Khan wrote: > > So who does the backports whenevenr something changes? You are adding > > work where as the automated process would just work without this > > change. It doesn't matter if there is another test that

Re: [BUG] tracing: dynamic ftrace selftest detected failures

2024-08-21 Thread Mark Rutland
On Wed, Aug 21, 2024 at 04:32:46PM +0100, Mark Rutland wrote: > On Wed, Aug 21, 2024 at 07:05:39AM +0900, Masami Hiramatsu wrote: > > On Tue, 20 Aug 2024 08:10:42 -0700 > > Sami Tolvanen wrote: > > > > > On Tue, Aug 20, 2024 at 3:48 AM Mark Rutland wrote: > >

Re: [BUG] tracing: dynamic ftrace selftest detected failures

2024-08-21 Thread Mark Rutland
On Wed, Aug 21, 2024 at 07:05:39AM +0900, Masami Hiramatsu wrote: > On Tue, 20 Aug 2024 08:10:42 -0700 > Sami Tolvanen wrote: > > > On Tue, Aug 20, 2024 at 3:48 AM Mark Rutland wrote: > > > > > > On Tue, Aug 20, 2024 at 10:03:30AM +0900, Masami Hiramatsu wrote:

Re: [BUG] tracing: dynamic ftrace selftest detected failures

2024-08-20 Thread Mark Rutland
much larger implications for noinstr code and similar, and means that LTO is unsound... > I found a discussion similar to this problem, but it seems very hacky. > > https://groups.google.com/g/llvm-dev/c/6baI9LISmSU/m/uEeY_CRbBQAJ?pli=1 Thanks for the link! Mark.

Re: [PATCH] arm64: insn: Simulate nop and push instruction for better uprobe performance

2024-08-15 Thread Mark Rutland
pcode, long addr, struct pt_regs *regs) > +{ > + long imm7; > + u64 buf[2]; > + long new_sp; > + > + imm7 = sign_extend64((opcode >> 15) & 0x7f, 6); > + new_sp = regs->sp + (imm7 << 3); We have accessors for these fields, please use them. > + > + buf[0] = regs->regs[29]; > + buf[1] = regs->regs[30]; > + > + if (copy_to_user((void __user *)new_sp, buf, sizeof(buf))) { > + force_sig(SIGSEGV); > + return; > + } As above, this won't interact with VMSA features (e.g. MTE, POE) in the same way as an STP in userspace, and this will not have the same atomicity properties as an STP. > + > + regs->sp = new_sp; > + instruction_pointer_set(regs, instruction_pointer(regs) + 4); Likewise, this sould need ot use arm64_skip_faulting_instruction(), though as above I think we should drop STP emulation entirely. Mark.

Re: [PATCH v7 3/5] regulator: add regulators driver for Marvell 88PM886 PMIC

2024-06-26 Thread Mark Brown
On Fri, May 31, 2024 at 07:34:58PM +0200, Karel Balej wrote: > Support the LDO and buck regulators of the Marvell 88PM886 PMIC. Reviewed-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH v2 5/5] ftrace: Add comments to ftrace_hash_move() and friends

2024-06-06 Thread Mark Rutland
On Wed, Jun 05, 2024 at 02:03:39PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Describe what ftrace_hash_move() does and add some more comments to some > other functions to make it easier to understand. > > Signed-off-by: Steven Rostedt (Goog

Re: [PATCH v2 4/5] ftrace: Convert "inc" parameter to bool in ftrace_hash_rec_update_modify()

2024-06-06 Thread Mark Rutland
es. > > Signed-off-by: Steven Rostedt (Google) Acked-by: Mark Rutland Mark. > --- > kernel/trace/ftrace.c | 23 --- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 1a2444199

Re: [PATCH v2 2/5] ftrace: Remove "ftrace_hash" parameter from __ftrace_hash_rec_update()

2024-06-06 Thread Mark Rutland
. > Remove the "filter_hash" parameter from __filter_hash_rec_update() and > comment the function for what it really is doing. > > Signed-off-by: Steven Rostedt (Google) FWIW, this looks good to me, and works in testing, so: Reviewed-by: Mark Rutland Tested-by: Mark Rutlan

Re: [PATCH v2 1/5] ftrace: Rename dup_hash() and comment it

2024-06-06 Thread Mark Rutland
ated one. Rename it to "__move_hash()" (using starting underscores as > it is an internal function), and add some comments about what it does. > > Signed-off-by: Steven Rostedt (Google) Acked-by: Mark Rutland Mark. > --- > kernel/trace/ftrace.c | 8 ++-- > 1

Re: [PATCH v3 00/27] function_graph: Allow multiple users for function graph tracing

2024-06-05 Thread Mark Rutland
e horrid hacks to manipulate the global filters, and after this series I just need to manipulate the filters in fgraph_ops::ops, which is *much* nicer. I've pushed out my WIP to: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=stacktrace/tests ... which is all to

Re: [PATCH 4/5] ftrace: Convert "filter_hash" and "inc" to bool in ftrace_hash_rec_update_modify()

2024-06-05 Thread Mark Rutland
mentation to what the function does. > > Signed-off-by: Steven Rostedt (Google) Aside from the issue with forward declarations that need to be updated, this looks good to me, so with that fixed: Acked-by: Mark Rutland Mark. > --- > kernel/trace/ftrace.c | 33 ++

Re: [PATCH 3/5] ftrace: Remove "filter_hash" parameter from ftrace_hash_rec_disable/enable()

2024-06-05 Thread Mark Rutland
in true to __ftrace_hash_rec_update(). > > Also add some comments to both those functions explaining what they do. > > Signed-off-by: Steven Rostedt (Google) Looks good to me. Acked-by: Mark Rutland Mark. > --- > kernel/trace/ftrace.c | 24 > 1

Re: [PATCH 2/5] ftrace: Comment __ftrace_hash_rec_update() and make filter_hash bool

2024-06-05 Thread Mark Rutland
* @filter_hash: True if for the filter hash is udpated, false for the > + * notrace hash Typo: s/udpated/updated/ ... though I couldn't parse this regardless; maybe: @filter_hash: true to update the filter hash, false to update the notrace hash

Re: [PATCH] ftrace/selftests: Fix pid test with function graph not showing pids

2024-06-05 Thread Mark Rutland
it can not > find them. Without fungraph-proc option set, it will not be displayed and > the test will fail. > > Link: https://lore.kernel.org/all/Zl9JFnzKGuUM10X2@J2N7QTR9R3/ > > Fixes: 35b944a997e2 ("selftests/ftrace: Add function_graph tracer to > func-filter-pid test

Re: [PATCH v3 00/27] function_graph: Allow multiple users for function graph tracing

2024-06-04 Thread Mark Rutland
On Tue, Jun 04, 2024 at 12:31:24PM -0400, Steven Rostedt wrote: > On Tue, 4 Jun 2024 15:44:40 +0100 > Mark Rutland wrote: > > > Hi Steve, Masami, > > > > On Tue, Jun 04, 2024 at 08:18:50AM -0400, Steven Rostedt wrote: > > > > > > Masami, > >

Re: [PATCH v3 00/27] function_graph: Allow multiple users for function graph tracing

2024-06-04 Thread Mark Rutland
g odd with the filesystem I'm using (e.g. the wnership test failed because this lacks 'stat'). Mark. > > -- Steve > > > On Mon, 03 Jun 2024 15:07:04 -0400 > Steven Rostedt wrote: > > > This is a continuation of the function graph multi user code. >

Re: [PATCH RFC 0/4] static key support for error injection functions

2024-05-31 Thread Mark Rutland
thing needs to change within ftrace itself. > If ftrace can only observe the function being called, maybe it > wouldn't be wrong to just observe nothing if the static key isn't > enabled because nobody is doing the fault injection? Yep, that sounds right to me. Mark.

Re: [PATCH v6 3/5] regulator: add regulators driver for Marvell 88PM886 PMIC

2024-05-05 Thread Mark Brown
On Sun, May 05, 2024 at 08:52:06PM +0200, Karel Balej wrote: > Should I then drop this op and the max_uA values from all the > regulators? Probably, yes. signature.asc Description: PGP signature

Re: [PATCH v6 3/5] regulator: add regulators driver for Marvell 88PM886 PMIC

2024-05-05 Thread Mark Brown
On Sat, May 04, 2024 at 09:37:06PM +0200, Karel Balej wrote: > +static const struct regulator_ops pm886_ldo_ops = { > + .list_voltage = regulator_list_voltage_table, > + .map_voltage = regulator_map_voltage_iterate, > + .set_voltage_sel = regulator_set_voltage_sel_regmap, > + .get_

Re: [PATCH] ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value

2024-04-16 Thread Mark Brown
tting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark

Re: [PATCH v4 05/15] mm: introduce execmem_alloc() and execmem_free()

2024-04-15 Thread Mark Rutland
nce modules can refreence other modules, that ends up actually being halved, and modules have to fit within some 2G window that also covers the kernel. * I'm not sure about BPF's requirements; it seems happy doing the same as modules. So if we *must* use a common execmem allocator, what we'd reall want is our own types, e.g. EXECMEM_ANYWHERE EXECMEM_NOPLT EXECMEM_PREL32 ... and then we use those in arch code to implement module_alloc() and friends. Mark.

Re: [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n

2024-03-26 Thread Mark Rutland
On Tue, Mar 26, 2024 at 09:15:14AM -0700, Calvin Owens wrote: > On Wednesday 03/27 at 00:24 +0900, Masami Hiramatsu wrote: > > On Tue, 26 Mar 2024 14:46:10 + > > Mark Rutland wrote: > > > Different exectuable allocations can have different requirements. For >

Re: [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n

2024-03-26 Thread Mark Rutland
On Wed, Mar 27, 2024 at 12:24:03AM +0900, Masami Hiramatsu wrote: > On Tue, 26 Mar 2024 14:46:10 + > Mark Rutland wrote: > > > > On Mon, Mar 25, 2024 at 11:56:32AM +0900, Masami Hiramatsu wrote: > > > I think, we'd better to introduce `alloc_execmem()`, >

Re: [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n

2024-03-26 Thread Mark Rutland
s which an architecture can then choose to implement using a common library if it wants to. I took a look at doing that using the core ifdeffery fixups from Jarkko's v6, and it looks pretty clean to me (and works in testing on arm64): https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=kprobes/without-modules Could we please start with that approach, with kprobe-specific alloc/free code provided by the architecture? Thanks, Mark.

Re: (subset) [PATCH 0/5] Add TCPM support for PM7250B and Fairphone 4

2024-03-25 Thread Mark Brown
ting patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark

Re: [RFC PATCH v4 2/5] mfd: add driver for Marvell 88PM886 PMIC

2024-03-21 Thread Mark Brown
On Thu, Mar 21, 2024 at 08:14:44PM +0100, Karel Balej wrote: > Mark Brown, 2024-03-21T19:00:24+00:00: > > I would expect that if you have two separate register maps they would > > have separate configurations that describe the corresponding physical > > register maps, as f

Re: [RFC PATCH v4 2/5] mfd: add driver for Marvell 88PM886 PMIC

2024-03-21 Thread Mark Brown
On Thu, Mar 21, 2024 at 07:16:43PM +0100, Karel Balej wrote: > Mark Brown, 2024-03-21T17:48:28+00:00: > > > They do according to the downstream driver which is my only reference. > > > In fact, there the driver defines the configs separately for each regmap > >

Re: [RFC PATCH v4 2/5] mfd: add driver for Marvell 88PM886 PMIC

2024-03-21 Thread Mark Brown
On Thu, Mar 21, 2024 at 06:32:03PM +0100, Karel Balej wrote: > Mark Brown, 2024-03-21T17:17:40+00:00: > > Do they both genuinely have the same maximum register? > They do according to the downstream driver which is my only reference. > In fact, there the driver defines the configs

Re: [RFC PATCH v4 2/5] mfd: add driver for Marvell 88PM886 PMIC

2024-03-21 Thread Mark Brown
On Thu, Mar 21, 2024 at 06:08:16PM +0100, Karel Balej wrote: > Mark Brown, 2024-03-21T16:58:44+00:00: > > > > > > > +static const struct regmap_config pm886_i2c_regmap = { > > > > > > > + .reg_bits = 8, > > > > > > > + .val_b

Re: [RFC PATCH v4 2/5] mfd: add driver for Marvell 88PM886 PMIC

2024-03-21 Thread Mark Brown
On Thu, Mar 21, 2024 at 05:55:17PM +0100, Karel Balej wrote: > Lee Jones, 2024-03-21T16:20:45+00:00: > > On Thu, 21 Mar 2024, Karel Balej wrote: > > > > > +static const struct regmap_config pm886_i2c_regmap = { > > > > > + .reg_bits = 8, > > > > > + .val_bits = 8, > > > > > + .max_regi

Re: [RFC PATCH] riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS

2024-03-20 Thread Mark Rutland
n is split over multiple > instructions) is a no-go. It's just a too big can of worms. So, if we > can only patch one insn, it's CALL_OPS. > > A couple of options (in addition to Andy's), and all require a > per-function landing address ala CALL_OPS) tweaking what Mark is doing &g

Re: [RFC PATCH] riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS

2024-03-12 Thread Mark Rutland
e recovered by the common ftrace trampoline. > > Not really a review, but some more background; Another rationale (on-top > of the improved per-call performance!) for CALL_OPS was to use it to > build ftrace direct call support (which BPF uses a lot!). Mark, please > correct me if I

Re: [PATCH 0/2] ASoC: trace: trace more parameters in ASoC DAPM events

2024-03-06 Thread Mark Brown
nt lists and maintainers to the CCs when replying to this mail. Thanks, Mark

Re: Question about the ipi_raise filter usage and output

2024-02-05 Thread Mark Rutland
[adding Valentin] On Mon, Feb 05, 2024 at 08:06:09AM -0500, Steven Rostedt wrote: > On Mon, 5 Feb 2024 10:28:57 + > Mark Rutland wrote: > > > > I try to write below: > > > echo 'target_cpus == 11 && reason == "Function call interrupts"&#

Re: Question about the ipi_raise filter usage and output

2024-02-05 Thread Mark Rutland
/ipi/ipi_raise/filter The '=' checks if the target_cpus bitmap *only* contains CPU 11. If the cpumask contains other CPUs, the filter will skip the call. I believe you can use '&' to check whether a cpumask contains a CPU, e.g. 'target_cpus & 11' Thanks, Mark.

Re: [PATCH v5 11/34] function_graph: Have the instances use their own ftrace_ops for filtering

2024-01-11 Thread Mark Rutland
On Thu, Jan 11, 2024 at 11:15:33AM +0900, Masami Hiramatsu wrote: > Hi Mark, > > Thanks for the investigation. Hi! As a heads-up, I already figured out the problem and sent a fixup at: https://lore.kernel.org/lkml/ZZwEz8HsTa2IZE3L@FVFF77S0Q05N/ ... and a more refined fix at:

Re: [PATCH] ftrace: Fix DIRECT_CALLS to use SAVE_REGS by default

2024-01-10 Thread Mark Rutland
/sys/kernel/tracing/current_tracer # less /sys/kernel/tracing/trace ... -0 [007] ..s3. 172.932840: wake_up_process <-process_timeout -0 [007] ..s1. 172.932842: my_direct_func: waking up kcompactd0-62 -0 [007] ..s3. 173.444836: wake_u

  1   2   3   4   5   6   7   8   9   10   >