Re: [RFC PATCH v4 3/4] selftest mm/mseal memory sealing

2024-01-08 Thread Muhammad Usama Anjum
You have used ksft_print_msg() only. Can you please udpate the test to use more TAP macros for increased readability and printing test output. We don't want to terminate the test if one test fails because of assert. We want the sub-tests to get executed indepdendent of other tests. ksft_test_resul

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-08 Thread Yi Liu
On 2024/1/8 12:07, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Friday, January 5, 2024 10:45 PM On Fri, Jan 05, 2024 at 02:52:50AM +, Tian, Kevin wrote: but in reality the relation could be identified in an easy way due to a SIOV restriction which we discussed before - shared PASID spac

Re: [PATCH v2] Documentation: KUnit: Update the instructions on how to test static functions

2024-01-08 Thread David Gow
> - Link to v1: > https://lore.kernel.org/r/20240108-kunit-doc-export-v1-1-119368df0...@riseup.net > --- Thanks very much: I think we definitely should be recommending VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT more. I do wonder, though, whether we should also keep the conditional ``#

Re: [PATCH v2 4/4] kselftest/alsa - conf: Stringify the printed errno in sysfs_get()

2024-01-08 Thread Mirsad Goran Todorovac
On 1/8/2024 6:37 PM, Mark Brown wrote: On Sun, Jan 07, 2024 at 06:37:08PM +0100, Mirsad Todorovac wrote: GCC 13.2.0 reported the warning of the print format specifier: Acked-by: Mark Brown Thank you very much for the review. I guess now patchwork will do the rest required. Thanks, Mirsad

[GIT PULL] nolibc changes for Linux 6.8-rc1

2024-01-08 Thread Shuah Khan
Hi Linus, Please pull the nolibc update for Linux 6.8-rc1. This nolibc update for Linux 6.8-rc1 consists of: * Support for PIC mode on MIPS. * Support for getrlimit()/setrlimit(). * Replace some custom declarations with UAPI includes. * A new script "run-tests.sh" to run the testsuite over diff

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

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > Add tests for both L2 and L3 CAT to verify the return values > generated by writing non-contiguous CBMs don't contradict the > reported non-contiguous support information. > > Use a logical XOR to confirm return value of write_schem

Re: [PATCH v2 3/4] selftests/resctrl: Split validate_resctrl_feature_request()

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > validate_resctrl_feature_request() is used to test both if a resource is > present in the info directory, and if a passed monitoring feature is > present in the mon_features file. There exists a different way to > represent feature s

Re: [PATCH v2 2/4] selftests/resctrl: Add helpers for the non-contiguous test

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > The CAT non-contiguous selftests have to read the file responsible for > reporting support of non-contiguous CBMs in Intel CAT. Then the test "in Intel CAT" -> "in kernel (resctrl)" > compares if that information matches what is re

Re: [PATCH v2 1/4] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT

2024-01-08 Thread Reinette Chatre
Hi Maciej, On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > From: Ilpo Järvinen > > To select test to run -t parameter can be used. However, -t cat > currently maps to L3 CAT test which is confusing after more CAT related > tests are added. > > Allow selecting tests as groups and call L3 C

[PATCH bpf-next v2 15/15] selftests/bpf: states pruning checks for scalar vs STACK_{MISC,ZERO}

2024-01-08 Thread Maxim Mikityanskiy
From: Eduard Zingerman Check that stacksafe() considers the following old vs cur stack spill state combinations equivalent: - spill of unbound scalar vs combination of STACK_{MISC,ZERO,INVALID} - STACK_MISC vs spill of unbound scalar - spill of scalar 0 vs STACK_ZERO - STACK_ZERO vs spill of scal

[PATCH bpf-next v2 14/15] bpf: Optimize state pruning for spilled scalars

2024-01-08 Thread Maxim Mikityanskiy
From: Eduard Zingerman Changes for scalar ID tracking of spilled unbound scalars lead to certain verification performance regression. This commit mitigates the regression by exploiting the following properties maintained by check_stack_read_fixed_off(): - a mix of STACK_MISC, STACK_ZERO and STACK

[PATCH bpf-next v2 13/15] selftests/bpf: Add test cases for narrowing fill

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy The previous commit allowed to preserve boundaries and track IDs of scalars on narrowing fills. Add test cases for that pattern. Signed-off-by: Maxim Mikityanskiy Acked-by: Eduard Zingerman --- .../selftests/bpf/progs/verifier_spill_fill.c | 108 ++ 1

[PATCH bpf-next v2 12/15] bpf: Preserve boundaries and track scalars on narrowing fill

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy When the width of a fill is smaller than the width of the preceding spill, the information about scalar boundaries can still be preserved, as long as it's coerced to the right width (done by coerce_reg_to_size). Even further, if the actual value fits into the fill width,

[PATCH bpf-next v2 11/15] selftests/bpf: Test tracking spilled unbounded scalars

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy The previous commit added tracking for unbounded scalars on spill. Add the test case to check the new functionality. Signed-off-by: Maxim Mikityanskiy Acked-by: Eduard Zingerman --- .../selftests/bpf/progs/verifier_spill_fill.c | 27 +++ 1 file changed

[PATCH bpf-next v2 10/15] bpf: Track spilled unbounded scalars

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy Support the pattern where an unbounded scalar is spilled to the stack, then boundary checks are performed on the src register, after which the stack frame slot is refilled into a register. Before this commit, the verifier didn't treat the src register and the stack slot

[PATCH bpf-next v2 09/15] selftests/bpf: Test assigning ID to scalars on spill

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy The previous commit implemented assigning IDs to registers holding scalars before spill. Add the test cases to check the new functionality. Signed-off-by: Maxim Mikityanskiy Acked-by: Eduard Zingerman --- .../selftests/bpf/progs/verifier_spill_fill.c | 133 +++

[PATCH bpf-next v2 08/15] bpf: Assign ID to scalars on spill

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy Currently, when a scalar bounded register is spilled to the stack, its ID is preserved, but only if was already assigned, i.e. if this register was MOVed before. Assign an ID on spill if none is set, so that equal scalars could be tracked if a register is spilled to the

[PATCH bpf-next v2 07/15] bpf: Add the get_reg_width function

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy Put calculation of the register value width into a dedicated function. This function will also be used in a following commit. Signed-off-by: Maxim Mikityanskiy --- kernel/bpf/verifier.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel

[PATCH bpf-next v2 06/15] bpf: Add the assign_scalar_id_before_mov function

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy Extract the common code that generates a register ID for src_reg before MOV if needed into a new function. This function will also be used in a following commit. Signed-off-by: Maxim Mikityanskiy Acked-by: Eduard Zingerman --- kernel/bpf/verifier.c | 33 ++

[PATCH bpf-next v2 05/15] selftests/bpf: Add a test case for 32-bit spill tracking

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy When a range check is performed on a register that was 32-bit spilled to the stack, the IDs of the two instances of the register are the same, so the range should also be the same. Signed-off-by: Maxim Mikityanskiy Acked-by: Eduard Zingerman --- .../selftests/bpf/prog

[PATCH bpf-next v2 04/15] bpf: Make bpf_for_each_spilled_reg consider narrow spills

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy Adjust the check in bpf_get_spilled_reg to take into account spilled registers narrower than 64 bits. That allows find_equal_scalars to properly adjust the range of all spilled registers that have the same ID. Before this change, it was possible for a register and a spill

[PATCH bpf-next v2 03/15] selftests/bpf: check if imprecise stack spills confuse infinite loop detection

2024-01-08 Thread Maxim Mikityanskiy
From: Eduard Zingerman Verify that infinite loop detection logic separates states with identical register states but different imprecise scalars spilled to stack. Signed-off-by: Eduard Zingerman --- .../selftests/bpf/progs/verifier_loops1.c | 24 +++ 1 file changed, 24 inse

[PATCH bpf-next v2 02/15] bpf: make infinite loop detection in is_state_visited() exact

2024-01-08 Thread Maxim Mikityanskiy
From: Eduard Zingerman Current infinite loops detection mechanism is speculative: - first, states_maybe_looping() check is done which simply does memcmp for R1-R10 in current frame; - second, states_equal(..., exact=false) is called. With exact=false states_equal() would compare scalars for e

[PATCH bpf-next v2 01/15] selftests/bpf: Fix the u64_offset_to_skb_data test

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy The u64_offset_to_skb_data test is supposed to make a 64-bit fill, but instead makes a 16-bit one. Fix the test according to its intention and update the comments accordingly (umax is no longer 0x). The 16-bit fill is covered by u16_offset_to_skb_data. Signed-off-by:

[PATCH bpf-next v2 00/15] Improvements for tracking scalars in the BPF verifier

2024-01-08 Thread Maxim Mikityanskiy
From: Maxim Mikityanskiy The goal of this series is to extend the verifier's capabilities of tracking scalars when they are spilled to stack, especially when the spill or fill is narrowing. It also contains a fix by Eduard for infinite loop detection and a state pruning optimization by Eduard tha

[PATCH v2] Documentation: KUnit: Update the instructions on how to test static functions

2024-01-08 Thread Arthur Grillo
Now that we have the VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT macros, update the instructions to stop recommending including .c files. Signed-off-by: Arthur Grillo --- Changes in v2: - Fix #if condition - Link to v1: https://lore.kernel.org/r/20240108-kunit-doc-export-v1-1-119368df0

[PATCH] Documentation: KUnit: Update the instructions on how to test static functions

2024-01-08 Thread Arthur Grillo
-Only Code --- base-commit: eeb8e8d9f124f279e80ae679f4ba6e822ce4f95f change-id: 20240108-kunit-doc-export-eec1f910ab67 Best regards, -- Arthur Grillo

Re: [PATCH bpf-next v3 0/3] Annotate kfuncs in .BTF_ids section

2024-01-08 Thread Daniel Xu
Hi Lorenz, On Mon, Jan 08, 2024 at 10:15:45AM +0100, Lorenz Bauer wrote: > On Sat, Jan 6, 2024 at 7:25 PM Daniel Xu wrote: > > > > === Description === > > > > This is a bpf-treewide change that annotates all kfuncs as such inside > > .BTF_ids. This annotation eventually allows us to automatically

Re: [PATCH v2 4/4] kselftest/alsa - conf: Stringify the printed errno in sysfs_get()

2024-01-08 Thread Mark Brown
On Sun, Jan 07, 2024 at 06:37:08PM +0100, Mirsad Todorovac wrote: > GCC 13.2.0 reported the warning of the print format specifier: Acked-by: Mark Brown signature.asc Description: PGP signature

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

2024-01-08 Thread Marcos Paulo de Souza
On Wed, 2024-01-03 at 15:09 -0700, Shuah Khan wrote: > On 1/2/24 15:31, Joe Lawrence wrote: > > On Wed, Dec 20, 2023 at 01:53:12PM -0300, 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 us

Re: [PATCH v2 3/4] kselftest/alsa - mixer-test: Fix the print format specifier warning

2024-01-08 Thread Mark Brown
On Sun, Jan 07, 2024 at 06:37:06PM +0100, Mirsad Todorovac wrote: > GCC 13.2.0 compiler issued the following warning: Acked-by: Mark Brown signature.asc Description: PGP signature

Re: [RFC PATCH v4 2/4] mseal: add mseal syscall

2024-01-08 Thread Jeff Xu
On Sun, Jan 7, 2024 at 10:42 AM Linus Torvalds wrote: > > One comment: > > On Thu, 4 Jan 2024 at 10:51, wrote: > > > > diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c > > index 9a846439b36a..02280199069b 100644 > > --- a/kernel/sys_ni.c > > +++ b/kernel/sys_ni.c > > @@ -193,6 +193,7 @@ COND_SYSCAL

[PATCH] selftests: add eventfd selftests

2024-01-08 Thread wenyang . linux
From: Wen Yang This adds the promised selftest for eventfd. It will verify the flags of eventfd2, including EFD_CLOEXEC, EFD_NONBLOCK and EFD_SEMAPHORE. Signed-off-by: Wen Yang Cc: Shuah Khan Cc: Javier Martinez Canillas Cc: Andrew Morton Cc: Christian Brauner Cc: Pengfei Xu Cc: Miklos Sz

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-08 Thread Jason Gunthorpe
On Mon, Jan 08, 2024 at 04:07:12AM +, Tian, Kevin wrote: > > > In concept w/o vSVA it's still possible to assign sibling vdev's to > > > a same VM as each vdev is allocated with a unique pasid to mark vRID > > > so can be differentiated from each other in the fault/error path. > > > > I though

Re: [RFC PATCH v2 00/10] MAINTAINERS: Introduce V: entry for tests

2024-01-08 Thread Nikolai Kondrashov
On 12/5/23 20:02, Nikolai Kondrashov wrote: Alright, here's a second version, attempting to address as many concerns as possible. It's likely I've missed something, though. Happy New Year, everyone! Hope your holidays went smoothly and peacefully. Is anyone still interested in this effort? Any

Re: [PATCH bpf-next v3 0/3] Annotate kfuncs in .BTF_ids section

2024-01-08 Thread Lorenz Bauer
On Sat, Jan 6, 2024 at 7:25 PM Daniel Xu wrote: > > === Description === > > This is a bpf-treewide change that annotates all kfuncs as such inside > .BTF_ids. This annotation eventually allows us to automatically generate > kfunc prototypes from bpftool. > > We store this metadata inside a yet-unu

Re: [PATCH v6 3/6] iommu: Add iommu_copy_struct_from_user_array helper

2024-01-08 Thread Binbin Wu
On 11/17/2023 9:07 PM, Yi Liu wrote: + +/** + * iommu_copy_struct_from_user_array - Copy iommu driver specific user space + * data from an iommu_user_data_array + * @kdst: Pointer to an iommu driver specific user data that is defined in + *include/ua