Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-22 Thread Maciej Wieczór-Retman
On 2024-01-22 at 08:32:36 -0800, Reinette Chatre wrote: >Hi Maciej, > >On 1/21/2024 11:56 PM, Maciej Wieczór-Retman wrote: >> Hi! >> >> On 2024-01-19 at 08:39:31 -0800, Reinette Chatre wrote: >>> Hi Maciej, >>> >>> On 1/18/2024 11:37 PM, Maciej Wieczór-Retman wrote: On 2024-01-18 at 09:15:46

Re: [PATCH] selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros

2024-01-22 Thread Muhammad Usama Anjum
Hi, Can anybody please pick this patch? This was fixing genuine regression in some build system. Thanks, On 10/24/23 8:51 PM, Muhammad Usama Anjum wrote: > Correct header file is needed for getting CLOSE_RANGE_* macros. > Previously it was tested with newer glibc which didn't show the need to >

Re: [PATCH v3 1/7] selftests/mm: hugepage-shm: conform test to TAP format output

2024-01-22 Thread Muhammad Usama Anjum
Hi Andrew, There hasn't been any comment on these. I guess, they can be picked up now? Thanks, On 1/15/24 12:32 PM, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages. > > The

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Muhammad Usama Anjum
On 1/22/24 2:59 PM, Ryan Roberts wrote: +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison >>> >>> The addition of this test causes 2 later tests to fail with ENOMEM. I >>> suspect >>> its a side-effect of marking the hugetlbs as hwpoisoned? (just a guess >>> based on >>> the test name!).

[PATCH v2 1/2] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Muhammad Usama Anjum
Add missing tests to run_vmtests.sh. The mm kselftests are run through run_vmtests.sh. If a test isn't present in this script, it'll not run with run_tests or `make -C tools/testing/selftests/mm run_tests`. Cc: Ryan Roberts Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Copy the

[PATCH v2 2/2] selftests/mm: run_vmtests: remove sudo and conform to tap

2024-01-22 Thread Muhammad Usama Anjum
Remove sudo as some test running environments may not have sudo available. Instead skip the test if root privileges aren't available in the test. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Added this patch in v2 We are allocating 2*RLIMIT_MEMLOCK.rlim_max memory and mmap()

[PATCH] selftests/landlock:Fix net_test build issues with old libc

2024-01-22 Thread Hu Yadi
From: "Hu.Yadi" Fixes: a549d055a22e ("selftests/landlock: Add network tests") one issues comes up while building selftest/landlock/net_test on my side (gcc 7.3/glibc-2.28/kernel-4.19) net_test.c: In function ‘set_service’: net_test.c:91:45: warning: implicit declaration of function ‘gettid’;

[PATCH net] selftests: netdevsim: fix the udp_tunnel_nic test

2024-01-22 Thread Jakub Kicinski
This test is missing a whole bunch of checks for interface renaming and one ifup. Presumably it was only used on a system with renaming disabled and NetworkManager running. Fixes: 91f430b2c49d ("selftests: net: add a test for UDP tunnel info infra") Signed-off-by: Jakub Kicinski --- CC:

Re: [RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-01-22 Thread Waiman Long
On 1/22/24 10:07, Michal Koutný wrote: Hello Waiman. On Wed, Jan 17, 2024 at 11:35:03AM -0500, Waiman Long wrote: This patch series is based on the RFC patch from Frederic [1]. Instead of offering RCU_NOCB as a separate option, it is now lumped into a root-only cpuset.cpus.isolation_full

[PATCH 6.6 336/583] kselftest/alsa - conf: Stringify the printed errno in sysfs_get()

2024-01-22 Thread Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit fd38dd6abda589a8771e7872e4dea28c99c6a6ef ] GCC 13.2.0 reported the warning of the print format specifier: conf.c: In function ‘sysfs_get’: conf.c:181:72:

[PATCH 6.6 335/583] kselftest/alsa - mixer-test: Fix the print format specifier warning

2024-01-22 Thread Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit 3f47c1ebe5ca9c5883e596c7888dec4bec0176d8 ] The GCC 13.2.0 compiler issued the following warning: mixer-test.c: In function ‘ctl_value_index_valid’:

[PATCH 6.6 334/583] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()

2024-01-22 Thread Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit 8c51c13dc63d46e754c44215eabc0890a8bd9bfb ] Minor fix in the number of arguments to error reporting function in the test program as reported by GCC 13.2.0

[PATCH 6.1 242/417] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()

2024-01-22 Thread Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit 8c51c13dc63d46e754c44215eabc0890a8bd9bfb ] Minor fix in the number of arguments to error reporting function in the test program as reported by GCC 13.2.0

[PATCH 6.1 243/417] kselftest/alsa - mixer-test: Fix the print format specifier warning

2024-01-22 Thread Greg Kroah-Hartman
6.1-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit 3f47c1ebe5ca9c5883e596c7888dec4bec0176d8 ] The GCC 13.2.0 compiler issued the following warning: mixer-test.c: In function ‘ctl_value_index_valid’:

[PATCH 63/82] mm: Refactor intentional wrap-around test

2024-01-22 Thread Kees Cook
In an effort to separate intentional arithmetic wrap-around from unexpected wrap-around, we need to refactor places that depend on this kind of math. One of the most common code patterns of this is: VAR + value < VAR Notably, this is considered "undefined behavior" for signed and pointer

[PATCH 6.7 372/641] kselftest/alsa - conf: Stringify the printed errno in sysfs_get()

2024-01-22 Thread Greg Kroah-Hartman
6.7-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit fd38dd6abda589a8771e7872e4dea28c99c6a6ef ] GCC 13.2.0 reported the warning of the print format specifier: conf.c: In function ‘sysfs_get’: conf.c:181:72:

[PATCH 6.7 371/641] kselftest/alsa - mixer-test: Fix the print format specifier warning

2024-01-22 Thread Greg Kroah-Hartman
6.7-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit 3f47c1ebe5ca9c5883e596c7888dec4bec0176d8 ] The GCC 13.2.0 compiler issued the following warning: mixer-test.c: In function ‘ctl_value_index_valid’:

[PATCH 6.7 370/641] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()

2024-01-22 Thread Greg Kroah-Hartman
6.7-stable review patch. If anyone has any objections, please let me know. -- From: Mirsad Todorovac [ Upstream commit 8c51c13dc63d46e754c44215eabc0890a8bd9bfb ] Minor fix in the number of arguments to error reporting function in the test program as reported by GCC 13.2.0

Re: [PATCH 6/6] of: Add KUnit test to confirm DTB is loaded

2024-01-22 Thread Stephen Boyd
Quoting David Gow (2024-01-15 21:03:12) > On Sat, 13 Jan 2024 at 04:07, Stephen Boyd wrote: > > > > Add a KUnit test that confirms a DTB has been loaded, i.e. there is a > > root node, and that the of_have_populated_dt() API works properly. > > > > Cc: Rob Herring > > Cc: Frank Rowand > > Cc:

Re: [PATCH v7 0/4] Introduce mseal()

2024-01-22 Thread Theo de Raadt
Jeff Xu wrote: > On Mon, Jan 22, 2024 at 7:49 AM Theo de Raadt wrote: > > > > Regarding these pieces > > > > > The PROT_SEAL bit in prot field of mmap(). When present, it marks > > > the map sealed since creation. > > > > OpenBSD won't be doing this. I had PROT_IMMUTABLE as a draft. In my > >

Re: [PATCH v7 0/4] Introduce mseal()

2024-01-22 Thread Jeff Xu
On Mon, Jan 22, 2024 at 7:49 AM Theo de Raadt wrote: > > Regarding these pieces > > > The PROT_SEAL bit in prot field of mmap(). When present, it marks > > the map sealed since creation. > > OpenBSD won't be doing this. I had PROT_IMMUTABLE as a draft. In my > research I found basically zero

Re: [PATCH v3 2/2] kselftest/seccomp: Report each expectation we assert as a KTAP test

2024-01-22 Thread Kees Cook
On Mon, Jan 22, 2024 at 09:08:18PM +, Mark Brown wrote: > The seccomp benchmark test makes a number of checks on the performance it > measures and logs them to the output but does so in a custom format which > none of the automated test runners understand meaning that the chances that > anyone

Re: [PATCH v3 1/2] kselftest/seccomp: Use kselftest output functions for benchmark

2024-01-22 Thread Kees Cook
On Mon, Jan 22, 2024 at 09:08:17PM +, Mark Brown wrote: > In preparation for trying to output the test results themselves in TAP > format rework all the prints in the benchmark to use the kselftest output > functions. The uses of system() all produce single line output so we can > avoid having

Re: [PATCH v2 2/2] kselftest/seccomp: Report each expectation we assert as a KTAP test

2024-01-22 Thread Kees Cook
On Mon, Jan 22, 2024 at 04:04:16PM +, Mark Brown wrote: > The seccomp benchmark test makes a number of checks on the performance it > measures and logs them to the output but does so in a custom format which > none of the automated test runners understand meaning that the chances that > anyone

Re: [PATCH v2 1/2] kselftest/seccomp: Use kselftest output functions for benchmark

2024-01-22 Thread Kees Cook
On Mon, Jan 22, 2024 at 04:04:15PM +, Mark Brown wrote: > In preparation for trying to output the test results themselves in TAP > format rework all the prints in the benchmark to use the kselftest output > functions. The uses of system() all produce single line output so we can > avoid having

Re: [PATCH v14] exec: Fix dead-lock in de_thread with ptrace_attach

2024-01-22 Thread Kees Cook
On Mon, Jan 22, 2024 at 02:24:37PM +0100, Bernd Edlinger wrote: > The main concern was when a set-suid program is executed by execve. > Then it makes a difference if the current thread is traced before the > execve or not. That means if the current thread is already traced, > the decision, which

[PATCH v3 2/2] kselftest/seccomp: Report each expectation we assert as a KTAP test

2024-01-22 Thread Mark Brown
The seccomp benchmark test makes a number of checks on the performance it measures and logs them to the output but does so in a custom format which none of the automated test runners understand meaning that the chances that anyone is paying attention are slim. Let's additionally log each result in

[PATCH v3 1/2] kselftest/seccomp: Use kselftest output functions for benchmark

2024-01-22 Thread Mark Brown
In preparation for trying to output the test results themselves in TAP format rework all the prints in the benchmark to use the kselftest output functions. The uses of system() all produce single line output so we can avoid having to deal with fully managing the child process and continue to use

[PATCH v3 0/2] kselftest/seccomp: Convert to KTAP output

2024-01-22 Thread Mark Brown
ideal for spotting problems. Let's rework things so that each check that the program does is reported as a test result to the framework. Signed-off-by: Mark Brown --- Changes in v3: - Re-add signoff. - Link to v2: https://lore.kernel.org/r/20240122-b4-kselftest-seccomp-benchmark-ktap-v2-0

[PATCH] kselftest/arm64: Test that ptrace takes effect in the target process

2024-01-22 Thread Mark Brown
While we have test coverage for the ptrace interface in our selftests the current programs have a number of gaps. The testing is done per regset so does not cover interactions and at no point do any of the tests actually run the traced processes meaning that there is no validation that anything we

[PATCH net] selftests: fill in some missing configs for net

2024-01-22 Thread Jakub Kicinski
We are missing a lot of config options from net selftests, it seems: tun/tap: CONFIG_TUN, CONFIG_MACVLAN, CONFIG_MACVTAP fib_tests: CONFIG_NET_SCH_FQ_CODEL l2tp:CONFIG_L2TP, CONFIG_L2TP_V3, CONFIG_L2TP_IP, CONFIG_L2TP_ETH sctp-vrf:CONFIG_INET_DIAG txtimestamp: CONFIG_NET_CLS_U32

[PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs

2024-01-22 Thread Jakub Kicinski
If there is more than 32 cpus the bitmask will start to contain commas, leading to: ./rps_default_mask.sh: line 36: [: ,: integer expression expected Remove the commas, bash doesn't interpret leading zeroes as oct so that should be good enough. Switch to bash, Simon reports that

Re: [PATCH v10 0/4] RISC-V: mm: Make SV48 the default address space

2024-01-22 Thread Charlie Jenkins
On Sat, Jan 20, 2024 at 03:09:51PM +0800, Yangyu Chen wrote: > > > On 1/20/24 14:49, Charlie Jenkins wrote: > > On Sat, Jan 20, 2024 at 02:13:14PM +0800, Yangyu Chen wrote: > > > Thanks for your reply. > > > > > > On 1/20/24 09:34, Charlie Jenkins wrote: > > > > On Sun, Jan 14, 2024 at

Re: [PATCH v2 2/2] kselftest/seccomp: Report each expectation we assert as a KTAP test

2024-01-22 Thread Shuah Khan
On 1/22/24 09:04, Mark Brown wrote: The seccomp benchmark test makes a number of checks on the performance it measures and logs them to the output but does so in a custom format which none of the automated test runners understand meaning that the chances that anyone is paying attention are slim.

[PATCH v4 3/3] kselftest: devices: Add sample board file for XPS 13 9300

2024-01-22 Thread Nícolas F . R . A . Prado
Add a sample board file describing the file's format and with the list of devices expected to be probed on the XPS 13 9300 machine as an example x86 platform. Test output: TAP version 13 Using board file: boards/Dell Inc.,XPS 13 9300.yaml 1..22 ok 1

[PATCH v4 2/3] kselftest: devices: Add sample board file for google,spherion

2024-01-22 Thread Nícolas F . R . A . Prado
Add a sample board file describing the file's format and with the list of devices expected to be probed on the google,spherion machine as an example. Test output: TAP version 13 Using board file: boards/google,spherion.yaml 1..8 ok 1 /usb2-controller@1120/1.4.1/camera.device ok 2

[PATCH v4 1/3] kselftest: Add test to verify probe of devices from discoverable buses

2024-01-22 Thread Nícolas F . R . A . Prado
Add a new test to verify that a list of expected devices from discoverable buses (ie USB, PCI) have been successfully instantiated and probed by a driver. The per-platform list of expected devices is selected from the ones under the boards/ directory based on the DT compatible or the DMI IDs.

[PATCH v4 0/3] Add test to verify probe of devices from discoverable buses

2024-01-22 Thread Nícolas F . R . A . Prado
change-id: 20240122-discoverable-devs-ksft-9d501e312688 Best regards, -- Nícolas F. R. A. Prado

[PATCH v15] exec: Fix dead-lock in de_thread with ptrace_attach

2024-01-22 Thread Bernd Edlinger
This introduces signal->exec_bprm, which is used to fix the case when at least one of the sibling threads is traced, and therefore the trace process may dead-lock in ptrace_attach, but de_thread will need to wait for the tracer to continue execution. The problem happens when a tracer tries to

resctrl selftests ready for inclusion

2024-01-22 Thread Reinette Chatre
Hi Shuah, Could you please consider Ilpo's resctrl selftest enhancements [1] for inclusion into kselftest's "next" branch in preparation for the next merge window? Thank you very much. Reinette [1] https://lore.kernel.org/lkml/20231215150515.36983-1-ilpo.jarvi...@linux.intel.com/

Re: [PATCH v6 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-22 Thread Shuah Khan
On 1/22/24 10:37, Marcos Paulo de Souza wrote: On Mon, 2024-01-22 at 10:15 -0700, Shuah Khan wrote: On 1/12/24 10:43, Marcos Paulo de Souza wrote: Add TEST_GEN_MODS_DIR variable for kselftests. It can point to a directory containing kernel modules that will be used by selftest scripts. The

Re: [PATCH v6 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-22 Thread Marcos Paulo de Souza
On Mon, 2024-01-22 at 10:15 -0700, Shuah Khan wrote: > On 1/12/24 10:43, Marcos Paulo de Souza wrote: > > Add TEST_GEN_MODS_DIR variable for kselftests. It can point to > > a directory containing kernel modules that will be used by > > selftest scripts. > > > > The modules are built as external

[PATCH v4 14/14] KVM: arm64: selftests: Teach get-reg-list about FPMR

2024-01-22 Thread Mark Brown
FEAT_FPMR defines a new register FMPR which is available at all ELs and is discovered via ID_AA64PFR2_EL1.FPMR, add this to the set of registers that get-reg-list knows to check for with the required identification register depdendency. Signed-off-by: Mark Brown ---

[PATCH v4 08/14] kselftest/arm64: Add basic FPMR test

2024-01-22 Thread Mark Brown
Verify that a FPMR frame is generated on systems that support FPMR and not generated otherwise. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/.gitignore| 1 + .../arm64/signal/testcases/fpmr_siginfo.c | 82 ++ 2 files changed, 83

Re: [PATCH v6 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2024-01-22 Thread Shuah Khan
On 1/22/24 05:55, Marcos Paulo de Souza wrote: On Fri, 2024-01-19 at 14:19 +0100, Alexander Gordeev wrote: On Fri, Jan 19, 2024 at 02:11:01PM +0100, Alexander Gordeev wrote: FWIW, for s390 part: Alexander Gordeev Acked-by: Alexander Gordeev Thanks Alexandre and Joe for testing and

[PATCH v4 00/14] arm64: Support for 2023 DPISA extensions

2024-01-22 Thread Mark Brown
This series enables support for the data processing extensions in the newly released 2023 architecture, this is mainly support for 8 bit floating point formats. Most of the extensions only introduce new instructions and therefore only require hwcaps but there is a new EL0 visible control register

[PATCH v4 11/14] KVM: arm64: Add newly allocated ID registers to register descriptions

2024-01-22 Thread Mark Brown
The 2023 architecture extensions have allocated some new ID registers, add them to the KVM system register descriptions so that they are visible to guests. Signed-off-by: Mark Brown --- arch/arm64/kvm/sys_regs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [PATCH v6 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-22 Thread Shuah Khan
On 1/12/24 10:43, Marcos Paulo de Souza wrote: Add TEST_GEN_MODS_DIR variable for kselftests. It can point to a directory containing kernel modules that will be used by selftest scripts. The modules are built as external modules for the running kernel. As a result they are always binary

[PATCH v2] kunit: Mark filter* params as rw

2024-01-22 Thread Lucas De Marchi
By allowing the filter_glob parameter to be written to, it's possible to tweak the testsuites that will be executed on new module loads. This makes it easier to run specific tests without having to reload kunit and provides a way to filter tests on real HW even if kunit is builtin. Example for xe

[PATCH v4 03/14] arm64/fpsimd: Support FEAT_FPMR

2024-01-22 Thread Mark Brown
FEAT_FPMR defines a new EL0 accessible register FPMR use to configure the FP8 related features added to the architecture at the same time. Detect support for this register and context switch it for EL0 when present. Due to the sharing of responsibility for saving floating point state between the

Re: [PATCH] selftests: Move KTAP bash helpers to selftests common folder

2024-01-22 Thread Rob Herring
On Tue, Jan 02, 2024 at 03:15:28PM +0100, Laura Nao wrote: > Move bash helpers for outputting in KTAP format to the common selftests > folder. This allows kselftests other than the dt one to source the file > and make use of the helper functions. > Define pass, fail and skip codes in the same file

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-22 Thread Reinette Chatre
Hi Maciej, On 1/21/2024 11:56 PM, Maciej Wieczór-Retman wrote: > Hi! > > On 2024-01-19 at 08:39:31 -0800, Reinette Chatre wrote: >> Hi Maciej, >> >> On 1/18/2024 11:37 PM, Maciej Wieczór-Retman wrote: >>> On 2024-01-18 at 09:15:46 -0800, Reinette Chatre wrote: On 1/18/2024 4:02 AM, Maciej

[PATCH v4 13/14] KVM: arm64: selftests: Document feature registers added in 2023 extensions

2024-01-22 Thread Mark Brown
The 2023 architecture extensions allocated some previously usused feature registers, add comments mapping the names in get-reg-list as we do for the other allocated registers. Signed-off-by: Mark Brown --- tools/testing/selftests/kvm/aarch64/get-reg-list.c | 4 ++-- 1 file changed, 2

[PATCH v4 12/14] KVM: arm64: Support FEAT_FPMR for guests

2024-01-22 Thread Mark Brown
FEAT_FPMR introduces a new system register FPMR which allows configuration of floating point behaviour, currently for FP8 specific features. Allow use of this in guests, disabling the trap while guests are running and saving and restoring the value along with the rest of the floating point state.

[PATCH v4 10/14] KVM: arm64: Share all userspace hardened thread data with the hypervisor

2024-01-22 Thread Mark Brown
As part of the lazy FPSIMD state transitioning done by the hypervisor we currently share the userpsace FPSIMD state in thread->uw.fpsimd_state with the host. Since this struct is non-extensible userspace ABI we have to keep the definition as is but the addition of FPMR in the 2023 dpISA means that

[PATCH v4 09/14] kselftest/arm64: Add 2023 DPISA hwcap test coverage

2024-01-22 Thread Mark Brown
Add the hwcaps added for the 2023 DPISA extensions to the hwcaps test program. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/abi/hwcap.c | 217 ++ 1 file changed, 217 insertions(+) diff --git a/tools/testing/selftests/arm64/abi/hwcap.c

[PATCH v4 07/14] kselftest/arm64: Handle FPMR context in generic signal frame parser

2024-01-22 Thread Mark Brown
Teach the generic signal frame parsing code about the newly added FPMR frame, avoiding warnings every time one is generated. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/testcases/testcases.c | 8 tools/testing/selftests/arm64/signal/testcases/testcases.h | 1 + 2

[PATCH v4 06/14] arm64/hwcap: Define hwcaps for 2023 DPISA features

2024-01-22 Thread Mark Brown
The 2023 architecture extensions include a large number of floating point features, most of which simply add new instructions. Add hwcaps so that userspace can enumerate these features. Signed-off-by: Mark Brown --- Documentation/arch/arm64/elf_hwcaps.rst | 49 +

[PATCH v4 05/14] arm64/ptrace: Expose FPMR via ptrace

2024-01-22 Thread Mark Brown
Add a new regset to expose FPMR via ptrace. It is not added to the FPSIMD registers since that structure is exposed elsewhere without any allowance for extension we don't add there. Signed-off-by: Mark Brown --- arch/arm64/kernel/ptrace.c | 42 ++

[PATCH v4 04/14] arm64/signal: Add FPMR signal handling

2024-01-22 Thread Mark Brown
Expose FPMR in the signal context on systems where it is supported. The kernel validates the exact size of the FPSIMD registers so we can't readily add it to fpsimd_context without disruption. Signed-off-by: Mark Brown --- arch/arm64/include/uapi/asm/sigcontext.h | 8 +

[PATCH v4 02/14] arm64/fpsimd: Enable host kernel access to FPMR

2024-01-22 Thread Mark Brown
FEAT_FPMR provides a new generally accessible architectural register FPMR. This is only accessible to EL0 and EL1 when HCRX_EL2.EnFPM is set to 1, do this when the host is running. The guest part will be done along with context switching the new register and exposing it via guest management.

[PATCH v4 01/14] arm64/cpufeature: Hook new identification registers up to cpufeature

2024-01-22 Thread Mark Brown
The 2023 architecture extensions have defined several new ID registers, hook them up to the cpufeature code so we can add feature checks and hwcaps based on their contents. Signed-off-by: Mark Brown --- arch/arm64/include/asm/cpu.h | 3 +++ arch/arm64/kernel/cpufeature.c | 28

[PATCH v2 2/2] kselftest/seccomp: Report each expectation we assert as a KTAP test

2024-01-22 Thread Mark Brown
The seccomp benchmark test makes a number of checks on the performance it measures and logs them to the output but does so in a custom format which none of the automated test runners understand meaning that the chances that anyone is paying attention are slim. Let's additionally log each result in

Re: [PATCH v2] kselftest: dt: Stop relying on dirname to improve performance

2024-01-22 Thread Rob Herring
On Mon, Jan 22, 2024 at 11:29:18AM -0300, Nícolas F. R. A. Prado wrote: > When walking directory trees, instead of looking for specific files and > running dirname to get the parent folder, traverse all folders and > ignore the ones not containing the desired files. This avoids the need > to call

[PATCH v2] kselftest/clone3: Make test names for set_tid test stable

2024-01-22 Thread Mark Brown
The test results reported for the clone3_set_tid tests interact poorly with automation for running kselftest since the reported test names include TIDs dynamically allocated at runtime. A lot of automation for running kselftest will compare runs by looking at the test name to identify if the same

[PATCH v2 1/2] kselftest/seccomp: Use kselftest output functions for benchmark

2024-01-22 Thread Mark Brown
In preparation for trying to output the test results themselves in TAP format rework all the prints in the benchmark to use the kselftest output functions. The uses of system() all produce single line output so we can avoid having to deal with fully managing the child process and continue to use

[PATCH v2 0/2] kselftest/seccomp: Convert to KTAP output

2024-01-22 Thread Mark Brown
Currently the seccomp benchmark selftest produces non-standard output, meaning that while it makes a number of checks of the performance it observes this has to be parsed by humans. This means that automated systems running this suite of tests are almost certainly ignoring the results which isn't

Re: [PATCH v7 0/4] Introduce mseal()

2024-01-22 Thread Theo de Raadt
Regarding these pieces > The PROT_SEAL bit in prot field of mmap(). When present, it marks > the map sealed since creation. OpenBSD won't be doing this. I had PROT_IMMUTABLE as a draft. In my research I found basically zero circumstances when you userland does that. The most common

[PATCH v7 3/4] selftest mm/mseal memory sealing

2024-01-22 Thread jeffxu
From: Jeff Xu selftest for memory sealing change in mmap() and mseal(). Signed-off-by: Jeff Xu --- tools/testing/selftests/mm/.gitignore |1 + tools/testing/selftests/mm/Makefile |1 + tools/testing/selftests/mm/mseal_test.c | 1997 +++ 3 files changed, 1999

[PATCH v7 4/4] mseal:add documentation

2024-01-22 Thread jeffxu
From: Jeff Xu Add documentation for mseal(). Signed-off-by: Jeff Xu --- Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/mseal.rst | 183 ++ 2 files changed, 184 insertions(+) create mode 100644 Documentation/userspace-api/mseal.rst diff

[PATCH v7 2/4] mseal: add mseal syscall

2024-01-22 Thread jeffxu
From: Jeff Xu The new mseal() is an syscall on 64 bit CPU, and with following signature: int mseal(void addr, size_t len, unsigned long flags) addr/len: memory range. flags: reserved. mseal() blocks following operations for the given memory range. 1> Unmapping, moving to another location, and

[PATCH v7 0/4] Introduce mseal()

2024-01-22 Thread jeffxu
From: Jeff Xu This patchset proposes a new mseal() syscall for the Linux kernel. In a nutshell, mseal() protects the VMAs of a given virtual memory range against modifications, such as changes to their permission bits. Modern CPUs support memory permissions, such as the read/write (RW) and

[PATCH v7 1/4] mseal: Wire up mseal syscall

2024-01-22 Thread jeffxu
From: Jeff Xu Wire up mseal syscall for all architectures. Signed-off-by: Jeff Xu --- arch/alpha/kernel/syscalls/syscall.tbl | 1 + arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++

Re: [RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-01-22 Thread Michal Koutný
Hello Waiman. On Wed, Jan 17, 2024 at 11:35:03AM -0500, Waiman Long wrote: > This patch series is based on the RFC patch from Frederic [1]. Instead > of offering RCU_NOCB as a separate option, it is now lumped into a > root-only cpuset.cpus.isolation_full flag that will enable all the >

[PATCH v2] kselftest: dt: Stop relying on dirname to improve performance

2024-01-22 Thread Nícolas F . R . A . Prado
/devices -type d); do + [ ! -f "${dev_dir}"/uevent ] && continue + [ ! -d "${dev_dir}"/driver ] && continue + + grep '^OF_FULLNAME=' "${dev_dir}"/uevent | sed -e 's|OF_FULLNAME=||' done ) --- b

Re: [PATCH v2] selftests: mm: fix map_hugetlb failure on 64K page size systems

2024-01-22 Thread Nico Pache
Hi Andrew, No, I think it's always been broken-- I don't think the test was written with 512M huge page sizes in mind. -- Nico On Sat, Jan 20, 2024 at 9:39 PM Andrew Morton wrote: > > On Fri, 19 Jan 2024 06:14:29 -0700 Nico Pache wrote: > > > On systems with 64k page size and 512M huge page

Re: [PATCH v14] exec: Fix dead-lock in de_thread with ptrace_attach

2024-01-22 Thread Oleg Nesterov
I'll try to read your email later, just one note for now... On 01/22, Bernd Edlinger wrote: > > > I didn't say that t is a group leader. I said it can be a zombie sub-thread > > with ->exit_state != 0. > > the condition here is > > (t != tsk->group_leader || !t->exit_state) > > so in other words,

Re: [PATCH v14] exec: Fix dead-lock in de_thread with ptrace_attach

2024-01-22 Thread Bernd Edlinger
On 1/17/24 17:38, Oleg Nesterov wrote: > On 01/17, Bernd Edlinger wrote: >> Yes. but the tracer has to do its job, and that is ptrace_attach the >> remaining treads, it does not know that it would avoid a dead-lock >> when it calls wait(), instead of ptrace_attach. It does not know >> that the

Re: [PATCH v5 02/12] KVM: arm64: selftests: Data type cleanup for arch_timer test

2024-01-22 Thread Haibo Xu
On Mon, Jan 22, 2024 at 8:21 PM Andrew Jones wrote: > > On Mon, Jan 22, 2024 at 05:58:32PM +0800, Haibo Xu wrote: > > Change signed type to unsigned in test_args struct which > > only make sense for unsigned value. > > > > Suggested-by: Andrew Jones > > Signed-off-by: Haibo Xu > > --- > >

Re: [PATCH v6 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2024-01-22 Thread Marcos Paulo de Souza
On Fri, 2024-01-19 at 14:19 +0100, Alexander Gordeev wrote: > On Fri, Jan 19, 2024 at 02:11:01PM +0100, Alexander Gordeev wrote: > > FWIW, for s390 part: > > > > Alexander Gordeev > > Acked-by: Alexander Gordeev Thanks Alexandre and Joe for testing and supporting the change. Shuah, now that

Re: [PATCH v5 02/12] KVM: arm64: selftests: Data type cleanup for arch_timer test

2024-01-22 Thread Andrew Jones
On Mon, Jan 22, 2024 at 05:58:32PM +0800, Haibo Xu wrote: > Change signed type to unsigned in test_args struct which > only make sense for unsigned value. > > Suggested-by: Andrew Jones > Signed-off-by: Haibo Xu > --- > tools/testing/selftests/kvm/aarch64/arch_timer.c | 12 ++-- > 1

[PATCH v1] selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory

2024-01-22 Thread Ryan Roberts
ksm_tests was previously mmapping a region of memory, aligning the returned pointer to a PMD boundary, then setting MADV_HUGEPAGE, but was setting it past the end of the mmapped area due to not taking the pointer alignment into consideration. Fix this behaviour. Up until commit efa7df3e3bb5 ("mm:

[PATCH] papr_vpd.c: calling devfd before get_system_loc_code

2024-01-22 Thread R Nageswara Sastry
Calling get_system_loc_code before checking devfd and errno - fails the test when the device is not available, expected a SKIP. Change the order of 'SKIP_IF_MSG' correctly SKIP when the /dev/papr-vpd device is not available. with out patch: Test FAILED on line 271 with patch: [SKIP] Test skipped

Re: [PATCH] kunit: Mark filter_glob param as rw

2024-01-22 Thread Krzysztofik, Janusz
On Friday, 19 January 2024 00:29:33 CET Lucas De Marchi wrote: > On Thu, Jan 18, 2024 at 05:23:33PM -0500, Rae Moar wrote: > >On Thu, Jan 11, 2024 at 7:13 PM Lucas De Marchi > > wrote: > >> > >> By allowing the filter_glob parameter to be written to, it's possible to > >> tweak the testsuites that

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Ryan Roberts
On 22/01/2024 08:46, Muhammad Usama Anjum wrote: > On 1/19/24 9:09 PM, Ryan Roberts wrote: >> Hi Muhammad, >> >> Afraid this patch is causing a regression on our CI system when it turned up >> in >> linux-next today. Additionally, 2 of thetests you have added are failing >> because >> the

[PATCH v5 12/12] KVM: riscv: selftests: Add sstc timer test

2024-01-22 Thread Haibo Xu
Add a KVM selftests to validate the Sstc timer functionality. The test was ported from arm64 arch timer test. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/aarch64/arch_timer.c| 12 +-

[PATCH v5 11/12] KVM: riscv: selftests: Change vcpu_has_ext to a common function

2024-01-22 Thread Haibo Xu
Move vcpu_has_ext to the processor.c and rename it to __vcpu_has_ext so that other test cases can use it for vCPU extension check. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/include/riscv/processor.h | 2 ++

[PATCH v5 10/12] KVM: riscv: selftests: Add guest helper to get vcpu id

2024-01-22 Thread Haibo Xu
Add guest_get_vcpuid() helper to simplify accessing to per-cpu private data. The sscratch CSR was used to store the vcpu id. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/include/aarch64/processor.h | 4

[PATCH v5 09/12] KVM: riscv: selftests: Add exception handling support

2024-01-22 Thread Haibo Xu
Add the infrastructure for guest exception handling in riscv selftests. Customized handlers can be enabled by vm_install_exception_handler(vector) or vm_install_interrupt_handler(). The code is inspired from that of x86/arm64. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones ---

[PATCH v5 08/12] KVM: riscv: selftests: Switch to use macro from csr.h

2024-01-22 Thread Haibo Xu
Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/include/riscv/processor.h | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/kvm/include/riscv/processor.h

[PATCH v5 07/12] tools: riscv: Add header file vdso/processor.h

2024-01-22 Thread Haibo Xu
Borrow the cpu_relax() definitions from kernel's arch/riscv/include/asm/vdso/processor.h to tools/ for riscv. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/arch/riscv/include/asm/vdso/processor.h | 32 +++ 1 file changed, 32 insertions(+) create mode 100644

[PATCH v5 06/12] tools: riscv: Add header file csr.h

2024-01-22 Thread Haibo Xu
Borrow the csr definitions and operations from kernel's arch/riscv/include/asm/csr.h to tools/ for riscv. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/arch/riscv/include/asm/csr.h | 541 + 1 file changed, 541 insertions(+) create mode 100644

[PATCH v5 05/12] KVM: selftests: Add CONFIG_64BIT definition for the build

2024-01-22 Thread Haibo Xu
Since only 64bit KVM selftests were supported on all architectures, add the CONFIG_64BIT definition in kvm/Makefile to ensure only 64bit definitions were available in the corresponding included files. Suggested-by: Andrew Jones Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones ---

[PATCH v5 04/12] KVM: arm64: selftests: Split arch_timer test code

2024-01-22 Thread Haibo Xu
Split the arch-neutral test code out of aarch64/arch_timer.c and put them into a common arch_timer.c. This is a preparation to share timer test codes in riscv. Suggested-by: Andrew Jones Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/Makefile | 3

[PATCH v5 03/12] KVM: arm64: selftests: Enable tuning of error margin in arch_timer test

2024-01-22 Thread Haibo Xu
There are intermittent failures occurred when stressing the arch-timer test in a Qemu VM: Guest assert failed, vcpu 0; stage; 4; iter: 3 Test Assertion Failure aarch64/arch_timer.c:196: config_iter + 1 == irq_iter pid=4048 tid=4049 errno=4 - Interrupted system call 1

[PATCH v5 02/12] KVM: arm64: selftests: Data type cleanup for arch_timer test

2024-01-22 Thread Haibo Xu
Change signed type to unsigned in test_args struct which only make sense for unsigned value. Suggested-by: Andrew Jones Signed-off-by: Haibo Xu --- tools/testing/selftests/kvm/aarch64/arch_timer.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v5 01/12] selftests/kvm: Fix issues with $(SPLIT_TESTS)

2024-01-22 Thread Haibo Xu
From: Paolo Bonzini The introduction of $(SPLIT_TESTS) also introduced a warning when building selftests on architectures that include get-reg-lists: make: Entering directory '/root/kvm/tools/testing/selftests/kvm' Makefile:272: warning: overriding recipe for target

[PATCH v5 00/12] RISCV: Add kvm Sstc timer selftests

2024-01-22 Thread Haibo Xu
The RISC-V arch_timer selftests is used to validate Sstc timer functionality in a guest, which sets up periodic timer interrupts and check the basic interrupt status upon its receipt. This KVM selftests was ported from aarch64 arch_timer and tested with Linux v6.7-rc8 on a Qemu riscv64 virt

[PATCH net] selftests/net/lib: update busywait timeout value

2024-01-22 Thread Hangbin Liu
The busywait timeout value is a millisecond, not a second. So the current setting 2 is meaningless. Let's copy the WAIT_TIMEOUT from forwarding/lib.sh and set a BUSYWAIT_TIMEOUT here. Signed-off-by: Hangbin Liu --- Not sure if the default WAIT_TIMEOUT 20s is too large. But since we usually don't

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Muhammad Usama Anjum
On 1/19/24 9:09 PM, Ryan Roberts wrote: > Hi Muhammad, > > Afraid this patch is causing a regression on our CI system when it turned up > in > linux-next today. Additionally, 2 of thetests you have added are failing > because > the scripts are not exported correctly... Andrew has dropped this

  1   2   >