[PATCH] KVM: selftests: Add 'malloc' failure check in config_name

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call in config_name function, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons. Signed-off-by: Kunwu Chan --- tools/testing/selftests/kvm/get-reg-list.c | 1 + 1 fil

[PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call in test_vmx_nested_state function, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons. Signed-off-by: Kunwu Chan --- tools/testing/selftests/kvm/x86_64/vmx_set_ne

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-23 Thread David Woodhouse
On Mon, 2024-04-22 at 15:02 -0700, Chen, Zide wrote: > > > On 4/20/2024 9:03 AM, David Woodhouse wrote: > > On Fri, 2024-04-19 at 16:54 -0700, Chen, Zide wrote: > > > > > > However, the selftest hangs: > > > > > > [Apr19 16:15] kselftest: Running tests in kvm > > > [Apr19 16:16] rcu: INFO: rcu_

Re: [PATCH v4 2/2] kunit: avoid memory leak on device register error

2024-04-23 Thread David Gow
On Fri, 19 Apr 2024 at 22:11, Wander Lairson Costa wrote: > > On Fri, Apr 19, 2024 at 11:03 AM Greg Kroah-Hartman > wrote: > > > > On Fri, Apr 19, 2024 at 10:25:02AM -0300, Wander Lairson Costa wrote: > > > If the device register fails, free the allocated memory before > > > returning. > > > > >

[PATCH] kselftest: arm64: Add a null pointer check

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons. Signed-off-by: Kunwu Chan --- tools/testing/selftests/arm64/tags/tags_test.c | 4 1 file changed, 4 inse

Re: [PATCH v1 5/5] selftests/mm: soft-dirty should fail if a testcase fails

2024-04-23 Thread Ryan Roberts
On 22/04/2024 10:33, David Hildenbrand wrote: > On 19.04.24 09:43, Ryan Roberts wrote: >> Previously soft-dirty was unconditionally exiting with success, even if >> one of it's testcases failed. Let's fix that so that failure can be >> reported to automated systems properly. >> >> Signed-off-by: Ry

Re: [PATCH] kselftest: arm64: Add a null pointer check

2024-04-23 Thread Muhammad Usama Anjum
On 4/23/24 1:21 PM, Kunwu Chan wrote: > There is a 'malloc' call, which can be unsuccessful. > This patch will add the malloc failure checking > to avoid possible null dereference and give more information > about test fail reasons. LGTM Reviewed-by: Muhammad Usama Anjum > > Signed-off-by: Kunw

Re: [PATCH v1 5/5] selftests/mm: soft-dirty should fail if a testcase fails

2024-04-23 Thread Muhammad Usama Anjum
On 4/23/24 1:24 PM, Ryan Roberts wrote: > On 22/04/2024 10:33, David Hildenbrand wrote: >> On 19.04.24 09:43, Ryan Roberts wrote: >>> Previously soft-dirty was unconditionally exiting with success, even if >>> one of it's testcases failed. Let's fix that so that failure can be >>> reported to autom

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-23 Thread Ryan Roberts
On 19/04/2024 18:12, David Hildenbrand wrote: > On 19.04.24 18:30, Mike Rapoport wrote: >> On Fri, Apr 19, 2024 at 11:45:14AM +0200, David Hildenbrand wrote: >>> On 19.04.24 10:33, Shivansh Vij wrote: > On 19/04/2024 08:43, Ryan Roberts wrote: >> Hi All, >> >> This series adds uffd

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Muhammad Usama Anjum
On 4/23/24 12:39 PM, Kunwu Chan wrote: > There is a 'malloc' call in test_vmx_nested_state function, which can > be unsuccessful. This patch will add the malloc failure checking > to avoid possible null dereference and give more information > about test fail reasons. LGTM Reviewed-by: Muhammad Usa

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in config_name

2024-04-23 Thread Muhammad Usama Anjum
On 4/23/24 12:37 PM, Kunwu Chan wrote: > There is a 'malloc' call in config_name function, which can > be unsuccessful. This patch will add the malloc failure checking > to avoid possible null dereference and give more information > about test fail reasons. > > Signed-off-by: Kunwu Chan LGTM Rev

Re: [PATCH v2 0/4] A new selftests/ directory for arm compatibility testing

2024-04-23 Thread Muhammad Usama Anjum
On 4/22/24 10:21 PM, Will Deacon wrote: > On Mon, Apr 22, 2024 at 12:37:13PM +0530, Dev Jain wrote: >> This series introduces the selftests/arm directory, which tests 32 and 64-bit >> kernel compatibility with 32-bit ELFs running on the Aarch platform. >> The need for this bucket of tests is that 3

Re: [PATCH v8 17/24] KVM: riscv: selftests: Move sbi definitions to its own header file

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > The SBI definitions will continue to grow. Move the sbi related > definitions to its own header file from processor.h > > Suggested-by: Andrew Jones > Reviewed-by: Andrew Jones > Signed-off-by: Atish Patra LGTM Reviewed-by: Muhammad Usama Anjum > ---

Re: [PATCH v8 18/24] KVM: riscv: selftests: Add helper functions for extension checks

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > __vcpu_has_ext can check both SBI and ISA extensions when the first > argument is properly converted to SBI/ISA extension IDs. Introduce > two helper functions to make life easier for developers so they > don't have to worry about the conversions. > > Repla

Re: [PATCH v8 19/24] KVM: riscv: selftests: Add Sscofpmf to get-reg-list test

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > The KVM RISC-V allows Sscofpmf extension for Guest/VM so let us > add this extension to get-reg-list test. > > Reviewed-by: Anup Patel > Reviewed-by: Andrew Jones > Signed-off-by: Atish Patra LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testi

Re: [PATCH v8 20/24] KVM: riscv: selftests: Add SBI PMU extension definitions

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > The SBI PMU extension definition is required for upcoming SBI PMU > selftests. > > Reviewed-by: Andrew Jones > Reviewed-by: Anup Patel > Signed-off-by: Atish Patra LGTM Reviewed-by: Muhammad Usama Anjum > --- > .../testing/selftests/kvm/include/riscv

Re: [PATCH v8 21/24] KVM: riscv: selftests: Add SBI PMU selftest

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > This test implements basic sanity test and cycle/instret event > counting tests. > > Reviewed-by: Anup Patel > Reviewed-by: Andrew Jones > Signed-off-by: Atish Patra LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/kvm/Makefile

Re: [PATCH v8 22/24] KVM: riscv: selftests: Add a test for PMU snapshot functionality

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > Verify PMU snapshot functionality by setting up the shared memory > correctly and reading the counter values from the shared memory > instead of the CSR. > > Reviewed-by: Andrew Jones > Reviewed-by: Anup Patel > Signed-off-by: Atish Patra LGTM Reviewed-

Re: [PATCH v8 23/24] KVM: riscv: selftests: Add a test for counter overflow

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > Add a test for verifying overflow interrupt. Currently, it relies on > overflow support on cycle/instret events. This test works for cycle/ > instret events which support sampling via hpmcounters on the platform. > There are no ISA extensions to detect if a

Re: [PATCH] kselftest: arm64: Add a null pointer check

2024-04-23 Thread Markus Elfring
… > This patch will add the malloc failure checking … * Please use a corresponding imperative wording for the change description. * Would you like to add the tag “Fixes” accordingly? Regards, Markus

Re: [PATCH v8 24/24] KVM: riscv: selftests: Add commandline option for SBI PMU test

2024-04-23 Thread Muhammad Usama Anjum
On 4/20/24 8:17 PM, Atish Patra wrote: > SBI PMU test comprises of multiple tests and user may want to run > only a subset depending on the platform. The most common case would > be to run all to validate all the tests. However, some platform may > not support all events or all ISA extensions. > >

[PATCH] kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option

2024-04-23 Thread David Gow
The NULL dereference tests in kunit_fault deliberately trigger a kernel BUG(), and therefore print the associated stack trace, even when the test passes. This is both annoying (as it bloats the test output), and can confuse some test harnesses, which assume any BUG() is a failure. Allow these test

[PATCH bpf-next v5 0/2] Add F_SETFL for fcntl in test_sockmap

2024-04-23 Thread Geliang Tang
From: Geliang Tang v5: - add a new patch "Check recv lengths in test_sockmap" instead of using "continue" in msg_loop. v4: - address Martin's comments for v3. (thanks.) - add Yonghong's "Acked-by" tags. (thanks.) - update subject-prefix from "bpf-next" to "bpf". Patch 1, v3 of "selftests

[PATCH bpf-next v5 1/2] selftests/bpf: Check recv lengths in test_sockmap

2024-04-23 Thread Geliang Tang
From: Geliang Tang The values of recv and recvp in msg_loop may be negative, so it's necessary to check if they are positive before using them. Fixes: 16962b2404ac ("bpf: sockmap, add selftests") Fixes: 753fb2ee0934 ("bpf: sockmap, add msg_peek tests to test_sockmap") Signed-off-by: Geliang Tang

[PATCH bpf-next v5 2/2] selftests/bpf: Add F_SETFL for fcntl in test_sockmap

2024-04-23 Thread Geliang Tang
From: Geliang Tang Incorrect arguments are passed to fcntl() in test_sockmap.c when invoking it to set file status flags. If O_NONBLOCK is used as 2nd argument and passed into fcntl, -EINVAL will be returned (See do_fcntl() in fs/fcntl.c). The correct approach is to use F_SETFL as 2nd argument, a

[PATCH bpf-next v2 0/5] use network helpers, part 2

2024-04-23 Thread Geliang Tang
From: Geliang Tang This patchset uses more network helpers in test_sock_addr.c, but first of all, patch 2 is needed to make network_helpers.c independent of test_progs.c. Then network_helpers.h can be included into test_sock_addr.c without compile errors. Patch 1 and patch 2 address Martin's com

[PATCH bpf-next v2 2/5] selftests/bpf: Use log_err in open_netns/close_netns

2024-04-23 Thread Geliang Tang
From: Geliang Tang ASSERT helpers defined in test_progs.h shouldn't be used in public functions like open_netns() and close_netns(). Since they depend on test__fail() which defined in test_progs.c. Public functions may be used not only in test_progs.c, but in other tests like test_sock_addr.c in

[PATCH bpf-next v2 1/5] selftests/bpf: Fix a fd leak in error paths in open_netns

2024-04-23 Thread Geliang Tang
From: Geliang Tang As Martin mentioned in review comment, there is an existing bug that orig_netns_fd will be leaked in the later "goto fail;" case after open("/proc/self/ns/net") in open_netns() in network_helpers.c. This patch adds "close(token->orig_netns_fd);" before "free(token);" to fix it.

[PATCH bpf-next v2 3/5] selftests/bpf: Use start_server_addr in test_sock_addr

2024-04-23 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in test_sock_addr.c, use the newly added public helper start_server_addr() instead of the local defined function start_server(). This can avoid duplicate code. In order to use functions defined in network_helpers.c in test_sock_addr.c, Makefile needs

[PATCH bpf-next v2 4/5] selftests/bpf: Use connect_to_addr in test_sock_addr

2024-04-23 Thread Geliang Tang
From: Geliang Tang This patch uses public network helper connect_to_addr() exported in network_helpers.h instead of the local defined function connect_to_server() in test_sock_addr.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/test_sock_addr.c |

[PATCH bpf-next v2 5/5] selftests/bpf: Use make_sockaddr in test_sock_addr

2024-04-23 Thread Geliang Tang
From: Geliang Tang This patch uses public helper make_sockaddr() exported in network_helpers.h instead of the local defined function mk_sockaddr() in test_sock_addr.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/test_sock_addr.c | 64 +

Re: [PATCH bpf-next 0/5] use network helpers, part 2

2024-04-23 Thread Geliang Tang
Superseded. v2 has just been sent out. Thanks, -Geliang On Sat, 2024-04-20 at 19:55 +0800, Geliang Tang wrote: > From: Geliang Tang > > This patchset uses more network helpers in test_sock_addr.c, but > first of all, patch 2 is needed to make network_helpers.c independent > of test_progs.c.

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Markus Elfring
… > This patch will add the malloc failure checking … * Please use a corresponding imperative wording for the change description. * Would you like to add the tag “Fixes” accordingly? … > +++ b/tools/testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c > @@ -91,6 +91,7 @@ void test_vmx_neste

Re: [PATCH v8 24/24] KVM: riscv: selftests: Add commandline option for SBI PMU test

2024-04-23 Thread Andrew Jones
On Tue, Apr 23, 2024 at 02:03:29PM +0500, Muhammad Usama Anjum wrote: ... > > + pr_info("Usage: %s [-h] [-d ]\n", name); > A little weird that we have pr_info named helper to print logs when it is a > userspace application, not kernel code. I'll check it in the source who > added it to the KVM te

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in config_name

2024-04-23 Thread Markus Elfring
… > This patch will add the malloc failure checking … * Please use a corresponding imperative wording for the change description. * Would you like to add the tag “Fixes” accordingly? … > +++ b/tools/testing/selftests/kvm/get-reg-list.c > @@ -66,6 +66,7 @@ static const char *config_name(struct v

Re: [PATCH] kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option

2024-04-23 Thread Guenter Roeck
On Tue, Apr 23, 2024 at 05:08:06PM +0800, David Gow wrote: > The NULL dereference tests in kunit_fault deliberately trigger a kernel > BUG(), and therefore print the associated stack trace, even when the > test passes. This is both annoying (as it bloats the test output), and > can confuse some tes

[PATCH v3 00/11] Add support for a few Zc* extensions as well as Zcmop

2024-04-23 Thread Clément Léger
Add support for (yet again) more RVA23U64 missing extensions. Add support for Zcmop, Zca, Zcf, Zcd and Zcb extensions isa string parsing, hwprobe and kvm support. Zce, Zcmt and Zcmp extensions have been left out since they target microcontrollers/embedded CPUs and are not needed by RVA23U64. Since

[PATCH v3 01/11] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-04-23 Thread Clément Léger
Add description for Zca, Zcf, Zcd and Zcb extensions which are part the Zc* standard extensions for code size reduction. Additional validation rules are added since Zcb depends on Zca, Zcf, depends on Zca and F, Zcd depends on Zca and D and finally, Zcf can not be present on rv64. Signed-off-by: C

[PATCH v3 02/11] riscv: add ISA extensions validation

2024-04-23 Thread Clément Léger
Since a few extensions (Zicbom/Zicboz) already needs validation and future ones will need it as well (Zc*) add a validate() callback to struct riscv_isa_ext_data. This require to rework the way extensions are parsed and split it in two phases. First phase is isa string or isa extension list parsing

[PATCH v3 03/11] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-23 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger --- a

[PATCH v3 04/11] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-04-23 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files changed, 28 insertions(+) diff

[PATCH v3 05/11] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-04-23 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c

[PATCH v3 06/11] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-04-23 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions(

[PATCH v3 08/11] riscv: add ISA extension parsing for Zcmop

2024-04-23 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit b854a709c00 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/i

[PATCH v3 09/11] riscv: hwprobe: export Zcmop ISA extension

2024-04-23 Thread Clément Léger
Export Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.r

[PATCH v3 10/11] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-04-23 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files cha

[PATCH v3 11/11] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-04-23 Thread Clément Léger
The KVM RISC-V allows Zcmop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/se

[PATCH v3 07/11] dt-bindings: riscv: add Zcmop ISA extension description

2024-04-23 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml| 12

[PATCH 0/3] kselftest: Add test to report device log errors

2024-04-23 Thread Nícolas F . R . A . Prado
Log errors are the most widely used mechanism for reporting issues in the kernel. When an error is logged using the device helpers, eg dev_err(), it gets metadata attached that identifies the subsystem and device where the message is coming from. This series makes use of that metadata in a new test

[PATCH 1/3] kselftest: devices: Move discoverable devices test to subdirectory

2024-04-23 Thread Nícolas F . R . A . Prado
Move the discoverable devices test to a subdirectory to allow other related tests to be added to the devices directory. Signed-off-by: Nícolas F. R. A. Prado --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/devices/{ => probe}/Makefile

[PATCH 2/3] kselftest: Move ksft helper module to common directory

2024-04-23 Thread Nícolas F . R . A . Prado
Move the ksft python module, which provides generic helpers for kselftests, to a common directory so it can be more easily shared between different tests. Signed-off-by: Nícolas F. R. A. Prado --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/d

[PATCH 3/3] kselftest: devices: Add test to detect device error logs

2024-04-23 Thread Nícolas F . R . A . Prado
Log errors are the most widely used mechanism for reporting issues in the kernel. When an error is logged using the device helpers, eg dev_err(), it gets metadata attached that identifies the subsystem and device where the message is coming from. Introduce a new test that makes use of that metadata

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Sean Christopherson
+others On Tue, Apr 23, 2024, Markus Elfring wrote: > … > > This patch will add the malloc failure checking > … > > * Please use a corresponding imperative wording for the change description. > > * Would you like to add the tag “Fixes” accordingly? Nah, don't bother with Fixes. OOM will cause

Re: [PATCH v4 01/10] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-04-23 Thread Rob Herring
On Mon, 22 Apr 2024 16:23:54 -0700, Stephen Boyd wrote: > Add test managed wrappers for of_overlay_apply() that automatically > removes the overlay when the test is finished. This API is intended for > use by KUnit tests that test code which relies on 'struct device_node's > and of_*() APIs. > >

Re: [PATCH v4 04/10] of: Add a KUnit test for overlays and test managed APIs

2024-04-23 Thread Rob Herring
On Mon, 22 Apr 2024 16:23:57 -0700, Stephen Boyd wrote: > Test the KUnit test managed overlay APIs. Confirm that platform devices > are created and destroyed properly. This provides us confidence that the > test managed APIs work correctly and can be relied upon to provide tests > with fake platf

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Andrew Jones
On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > +others > > On Tue, Apr 23, 2024, Markus Elfring wrote: > > … > > > This patch will add the malloc failure checking > > … > > > > * Please use a corresponding imperative wording for the change description. > > > > * Would you

Improving the testing quality of the kernel

2024-04-23 Thread Muhammad Usama Anjum
Hi, I've been working with colleagues at Collabora to improve the testing quality overall for kselftests since several months. We had identified following key points to improve: * Make non-TAP conformant tests, TAP conformant to catch the bugs/failures in the CI and non-CI environment. Without cle

[PATCH] selftests/nolibc: run-tests.sh: use -Werror by default

2024-04-23 Thread Thomas Weißschuh
+158,7 @@ test_arch() { exit 1 esac printf '%-15s' "$arch:" - swallow_output "${MAKE[@]}" "$test_target" V=1 + swallow_output "${MAKE[@]}" CFLAGS_EXTRA="$CFLAGS_EXTRA" "$test_target" V=1 cp run.out run.out."${arch}" "${MAKE[@]}" report | grep passed } --- base-commit: 0adab2b6b7336fb6ee3c6456a432dad3b1d25647 change-id: 20240423-nolibc-werror-cde7b371a2ed Best regards, -- Thomas Weißschuh

Re: [PATCH 2/5] riscv: add ISA extension parsing for Zimop

2024-04-23 Thread Conor Dooley
On Thu, Apr 04, 2024 at 12:32:48PM +0200, Clément Léger wrote: > Add parsing for Zimop ISA extension which was ratified in commit > 58220614a5f of the riscv-isa-manual. > > Signed-off-by: Clément Léger Reviewed-by: Conor Dooley > --- > arch/riscv/include/asm/hwcap.h | 1 + > arch/riscv/kernel

Re: [PATCH] kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option

2024-04-23 Thread Mickaël Salaün
On Tue, Apr 23, 2024 at 05:08:06PM +0800, David Gow wrote: > The NULL dereference tests in kunit_fault deliberately trigger a kernel > BUG(), and therefore print the associated stack trace, even when the > test passes. This is both annoying (as it bloats the test output), and > can confuse some tes

Re: [PATCH net-next 0/4] netdev: support dumping a single netdev in qstats

2024-04-23 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Fri, 19 Apr 2024 19:35:38 -0700 you wrote: > I was writing a test for page pool which depended on qstats, > and got tired of having to filter dumps in user space. > Add support for dumping stats for a single netde

Re: [PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

2024-04-23 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Fri, 19 Apr 2024 19:52:30 -0700 you wrote: > Hi! > > Implement support for tests which require access to a remote system / > endpoint which can generate traffic. > This series concludes the "groundwork" for upstr

Re: [PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

2024-04-23 Thread Willem de Bruijn
Willem de Bruijn wrote: > Jakub Kicinski wrote: > > Hi! > > > > Implement support for tests which require access to a remote system / > > endpoint which can generate traffic. > > This series concludes the "groundwork" for upstream driver tests. > > > > I wanted to support the three models which c

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-23 Thread Chen, Zide
On 4/23/2024 12:49 AM, David Woodhouse wrote: >> If I restored the KVM_REQ_GLOBAL_CLOCK_UPDATE request from >> kvm_arch_vcpu_load(), the selftest works for me, and I ran the test for >> 1000+ iterations, w/ or w/o TSC scaling, the TEST_ASSERT(delta_corrected >>  <= ±1) never got hit. This is awe

[PATCH] kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER

2024-04-23 Thread Ivan Orlov
Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and 'string_stream_destroy' wrappers for kunit_add_action. Signed-off-by: Ivan Orlov --- lib/kunit/string-stream-test.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/kunit/string-stream-test.c b/l

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Sean Christopherson
On Tue, Apr 23, 2024, Andrew Jones wrote: > On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > > +others > > > > On Tue, Apr 23, 2024, Markus Elfring wrote: > > > … > > > > This patch will add the malloc failure checking > > > … > > > > > > * Please use a corresponding imperat

[PATCH v1 0/1] branch prediction hint

2024-04-23 Thread jeffxu
From: Jeff Xu This is followup patch on discussion happened during mseal v10 discussion [1] Add branch perdiction hint to mseal code. Please apply on top of mseal v10 patch (which already in mm-unstable) [1] https://lore.kernel.org/lkml/cajucfpflwjg4n7wppt+u9vc4xhole_bppz0tdkf7w45hgky...@mail

[PATCH v1 1/1] mseal: Add branch prediction hint.

2024-04-23 Thread jeffxu
From: Jeff Xu It is unlikely that application calls mm syscall, such as mprotect, on already sealed mappings, adding branch prediction hint. Signed-off-by: Jeff Xu Suggested-by: Pedro Falcato --- mm/madvise.c | 2 +- mm/mmap.c | 4 ++-- mm/mprotect.c | 2 +- mm/mremap.c | 4 ++-- mm/ms

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-23 Thread Shivansh Vij
Hey All,   >On 19/04/2024 18:12, David Hildenbrand wrote: >> On 19.04.24 18:30, Mike Rapoport wrote: >>> On Fri, Apr 19, 2024 at 11:45:14AM +0200, David Hildenbrand wrote: On 19.04.24 10:33, Shivansh Vij wrote: >> On 19/04/2024 08:43, Ryan Roberts wrote: >>> Hi All, >>> >>> Thi

Re: [PATCH v8 09/24] drivers/perf: riscv: Implement SBI PMU snapshot function

2024-04-23 Thread Atish Kumar Patra
On Mon, Apr 22, 2024 at 9:06 AM Samuel Holland wrote: > > Hi Atish, > > On 2024-04-20 10:17 AM, Atish Patra wrote: > > SBI v2.0 SBI introduced PMU snapshot feature which adds the following > > features. > > > > 1. Read counter values directly from the shared memory instead of > > csr read. > > 2.

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-23 Thread David Hildenbrand
We further recently added a new UFFD_FEATURE_WP_ASYNC feature as part of [2], because getting soft-dirty return reliable results in some cases turned out rather hard to fix. But it sounds like the current soft-dirty semantic is sufficient for CRIU on other arches? If I understood correctly f

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-23 Thread David Hildenbrand
Shivansh, do you speak for CRIU? Are you able to comment on whether CRIU supports checkpointing an app that uses uffd? I do not speak for CRIU - I'm just a user (and hopefully a future contributor), but not a maintainer or owner. I can however comment on whether CRIU supports checkpointing an

Re: [PATCH 2/2] KVM: selftests: Add KVM/PV clock selftest to prove timer drift correction

2024-04-23 Thread David Woodhouse
On 23 April 2024 18:59:21 BST, "Chen, Zide" wrote: > > >On 4/23/2024 12:49 AM, David Woodhouse wrote: >>> If I restored the KVM_REQ_GLOBAL_CLOCK_UPDATE request from >>> kvm_arch_vcpu_load(), the selftest works for me, and I ran the test for >>> 1000+ iterations, w/ or w/o TSC scaling, the TEST_ASS

Re: [PATCH] kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option

2024-04-23 Thread Rae Moar
On Tue, Apr 23, 2024 at 5:08 AM David Gow wrote: > > The NULL dereference tests in kunit_fault deliberately trigger a kernel > BUG(), and therefore print the associated stack trace, even when the > test passes. This is both annoying (as it bloats the test output), and > can confuse some test harne

Re: [PATCH] kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER

2024-04-23 Thread Rae Moar
On Tue, Apr 23, 2024 at 2:27 PM Ivan Orlov wrote: > > Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and > 'string_stream_destroy' wrappers for kunit_add_action. > > Signed-off-by: Ivan Orlov Hello! This looks like a good use of the macro. Thanks! Reviewed-by: Rae Moar Thanks! -

Re: [PATCH bpf-next v3 07/11] bpf: Fix a false rejection caused by AND operation

2024-04-23 Thread Yonghong Song
On 4/20/24 1:33 AM, Xu Kuohai wrote: On 4/20/2024 7:00 AM, Eduard Zingerman wrote: On Thu, 2024-04-11 at 20:27 +0800, Xu Kuohai wrote: From: Xu Kuohai With lsm return value check, the no-alu32 version test_libbpf_get_fd_by_id_opts is rejected by the verifier, and the log says:    0: R1=c

[PATCH] selftests/nolibc: disable brk()/sbrk() tests on musl

2024-04-23 Thread Thomas Weißschuh
E_TEST(chdir_dot); EXPECT_SYSZR(1, chdir(".")); break; CASE_TEST(chdir_blah);EXPECT_SYSER(1, chdir("/blah"), -1, ENOENT); break; --- base-commit: 0adab2b6b7336fb6ee3c6456a432dad3b1d25647 change-id: 20240423-nolibc-musl-brk-7784add29801 Best regards, -- Thomas Weißschuh

Re: [PATCH 1/6] Add GHCB with setters and getters

2024-04-23 Thread Sean Christopherson
On Tue, Apr 09, 2024, Peter Gonda wrote: > Move the GHCB definitions from svm.h to the tools/ copy. This allows the > SEV-ES selftest to use GHCBs which are required for non-trival VMs to > paravirtualize NonAutomaticExits (NAEs) when SEV-ES is enabled. GHCB > getters/setters have a warning with ad

[PATCH v21 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-04-23 Thread Vincent Donnefort
This test maps a ring-buffer and validate the meta-page after reset and after emitting few events. Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Acked-by: Muhammad Usama Anjum Signed-off-by: Vincent Donnefort diff --git a/tools/testing/selftests/ring-buffer/.gitignore b/t

Re: [PATCH 6/6] Add ability for SEV-ES guests to use ucalls via GHCB

2024-04-23 Thread Sean Christopherson
On Tue, Apr 09, 2024, Peter Gonda wrote: > Modifies ucall handling for SEV-ES VMs. Please follow the preferred changelog style as described in Documentation/process/maintainer-kvm-x86.rst > Instead of using an out instruction and storing the ucall pointer in RDI, > SEV-ES guests use a outsb VMGE

Re: [PATCH] kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER

2024-04-23 Thread David Gow
On Wed, 24 Apr 2024 at 02:27, Ivan Orlov wrote: > > Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and > 'string_stream_destroy' wrappers for kunit_add_action. > > Signed-off-by: Ivan Orlov > --- Acked-by: David Gow Thanks, -- David smime.p7s Description: S/MIME Cryptographic Si

Re: [PATCH 4/6] Add GHCB allocations and helpers

2024-04-23 Thread Sean Christopherson
On Tue, Apr 09, 2024, Peter Gonda wrote: > Add GHCB management functionality similar to the ucall management. > Allows for selftest vCPUs to acquire GHCBs for their usage. Do we actually need a dedicated pool of GHCBs? The conundrum with ucalls is that we have no place in the guest to store the

Re: [PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

2024-04-23 Thread Jakub Kicinski
On Tue, 23 Apr 2024 13:57:45 -0400 Willem de Bruijn wrote: > Only possible non-obvious observation is that some kselftests expect > as root, and the ssh remote logic extends that to expecting ssh > root access to the remote host. > > Would it make sense to explicitly add sudo for all privileged >

Re: [PATCH v2 0/4] A new selftests/ directory for arm compatibility testing

2024-04-23 Thread Mark Brown
On Tue, Apr 23, 2024 at 01:55:07PM +0500, Muhammad Usama Anjum wrote: > On 4/22/24 10:21 PM, Will Deacon wrote: > > Isn't this going to be difficult to maintain if we have two divergent copies > > of the same stuff? From a very quick skim, a bunch of the signals stuff is > > idential to what we ha

[PATCH bpf-next 0/4] Add some 'malloc' failure checks

2024-04-23 Thread Kunwu Chan
The "malloc" call may not be successful.Add the malloc failure checking to avoid possible null dereference. Kunwu Chan (4): selftests/bpf: Add some null pointer checks selftests/bpf/sockopt: Add a null pointer check for the run_test selftests/bpf: Add a null pointer check for the load_btf_s

[PATCH bpf-next 1/4] selftests/bpf: Add some null pointer checks

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/test_progs.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/bpf/t

[PATCH bpf-next 2/4] selftests/bpf/sockopt: Add a null pointer check for the run_test

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call, which can be unsuccessful. Add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/prog_tests/sockopt.c | 6 ++ 1 file changed, 6 insertions(+) d

[PATCH bpf-next 3/4] selftests/bpf: Add a null pointer check for the load_btf_spec

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call, which can be unsuccessful. Add the malloc failure checking to avoid possible null dereference. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/test_verifier.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/

[PATCH bpf-next 4/4] selftests/bpf: Add a null pointer check for the serial_test_tp_attach_query

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call, which can be unsuccessful. Add the malloc failure checking to avoid possible null dereference. Signed-off-by: Kunwu Chan --- tools/testing/selftests/bpf/prog_tests/tp_attach_query.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/bpf/prog_

Re: [PATCH bpf-next v3 07/11] bpf: Fix a false rejection caused by AND operation

2024-04-23 Thread Xu Kuohai
On 4/24/2024 5:55 AM, Yonghong Song wrote: On 4/20/24 1:33 AM, Xu Kuohai wrote: On 4/20/2024 7:00 AM, Eduard Zingerman wrote: On Thu, 2024-04-11 at 20:27 +0800, Xu Kuohai wrote: From: Xu Kuohai With lsm return value check, the no-alu32 version test_libbpf_get_fd_by_id_opts is rejected by th

Re: [PATCH] selftests/nolibc: disable brk()/sbrk() tests on musl

2024-04-23 Thread Willy Tarreau
On Wed, Apr 24, 2024 at 12:15:33AM +0200, Thomas Weißschuh wrote: > On musl calls to brk() and sbrk() always fail with ENOMEM. > Detect this and skip the tests on musl. > > Tested on glibc 2.39 and musl 1.2.5 in addition to nolibc. > > Signed-off-by: Thomas Weißschuh > --- > tools/testing/selft

Re: [PATCH bpf-next v2 09/16] bpf: allow struct bpf_wq to be embedded in arraymaps and hashmaps

2024-04-23 Thread Alexei Starovoitov
On Sat, Apr 20, 2024 at 2:09 AM Benjamin Tissoires wrote: > > > -static void htab_map_free_timers(struct bpf_map *map) > +static void htab_map_free_timers_and_wq(struct bpf_map *map) > { > struct bpf_htab *htab = container_of(map, struct bpf_htab, map); > > - /* We only free timer o

Re: [PATCH bpf-next v2 11/16] bpf: wq: add bpf_wq_init

2024-04-23 Thread Alexei Starovoitov
On Sat, Apr 20, 2024 at 2:10 AM Benjamin Tissoires wrote: > > We need to teach the verifier about the second argument which is declared > as void * but which is of type KF_ARG_PTR_TO_MAP. We could have dropped > this extra case if we declared the second argument as struct bpf_map *, > but that mea

Re: [PATCH bpf-next v2 13/16] bpf: wq: add bpf_wq_set_callback_impl

2024-04-23 Thread Alexei Starovoitov
On Sat, Apr 20, 2024 at 2:10 AM Benjamin Tissoires wrote: > @@ -11018,6 +11027,7 @@ enum special_kfunc_type { > KF_bpf_percpu_obj_drop_impl, > KF_bpf_throw, > KF_bpf_iter_css_task_new, > + KF_bpf_wq_set_callback_impl, > }; > > BTF_SET_START(special_kfunc_set) > @@ -

Re: [PATCH bpf-next v2 10/16] selftests/bpf: add bpf_wq tests

2024-04-23 Thread Alexei Starovoitov
On Sat, Apr 20, 2024 at 2:10 AM Benjamin Tissoires wrote: > > + > +SEC("tc") > +/* test that workqueues can be used from an array > + */ > +__retval(0) > +long test_call_array_sleepable(void *ctx) > +{ > + int key = 0; > + > + return test_elem_callback(&array, &key); > +} > + > +SEC("s

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Kunwu Chan
Thanks all for the reply. On 2024/4/24 03:15, Sean Christopherson wrote: On Tue, Apr 23, 2024, Andrew Jones wrote: On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: +others On Tue, Apr 23, 2024, Markus Elfring wrote: … This patch will add the malloc failure checking … *

Re: [PATCH bpf-next v2 00/16] Introduce bpf_wq

2024-04-23 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov : On Sat, 20 Apr 2024 11:09:00 +0200 you wrote: > This is a followup of sleepable bpf_timer[0]. > > When discussing sleepable bpf_timer, it was thought that we should give > a try to bpf_wq, as the 2 APIs are simil

Re: [PATCH] selftests/nolibc: run-tests.sh: use -Werror by default

2024-04-23 Thread Willy Tarreau
On Tue, Apr 23, 2024 at 06:26:06PM +0200, Thomas Weißschuh wrote: > run-tests.sh hides the output from the compiler unless the compilation > fails. To recognize newly introduced warnings use -Werror by default. > > Also add a switch to disable -Werror in case the warnings are expected. > > Signed

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Dan Carpenter
On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: > On Tue, Apr 23, 2024, Andrew Jones wrote: > > On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > > > +others > > > > > > On Tue, Apr 23, 2024, Markus Elfring wrote: > > > > … > > > > > This patch will add th