Re: [PATCH RFC 3/3] selftests/nolibc: migrate vfprintf tests to new harness

2023-11-15 Thread Willy Tarreau
On Wed, Nov 15, 2023 at 10:08:21PM +0100, Thomas Weißschuh wrote: > Migrate part of nolibc-test.c to the new test harness. > > Signed-off-by: Thomas Weißschuh > --- > tools/testing/selftests/nolibc/nolibc-test.c | 74 > +++- > 1 file changed, 28 insertions(+), 46 deletio

Re: [PATCH RFC 2/3] selftests/nolibc: migrate startup tests to new harness

2023-11-15 Thread Willy Tarreau
On Wed, Nov 15, 2023 at 10:08:20PM +0100, Thomas Weißschuh wrote: > Migrate part of nolibc-test.c to the new test harness. > > Signed-off-by: Thomas Weißschuh A few points, mostly questions and food for thoughts. > -static void putcharn(char c, size_t n) > -{ > - char buf[64]; > - > - m

Re: [PATCH RFC 1/3] selftests/nolibc: add custom test harness

2023-11-15 Thread Willy Tarreau
Hi Thomas, On Wed, Nov 15, 2023 at 10:08:19PM +0100, Thomas Weißschuh wrote: > The harness provides a framework to write unit tests for nolibc itself > and kernel selftests using nolibc. > > Advantages over the current harness: > * Makes it possible to emit KTAP for integration into kselftests. >

Re: [RFC 7/7] vfio: Add vfio_register_pasid_iommu_dev()

2023-11-15 Thread Cao, Yahui
On 10/9/2023 4:51 PM, Yi Liu wrote: From: Kevin Tian This adds vfio_register_pasid_iommu_dev() for device driver to register virtual devices which are isolated per PASID in physical IOMMU. The major usage is for the SIOV devices which allows device driver to tag the DMAs out of virtual device

Re: [PATCH v3 01/10] iov_iter: Fix some checkpatch complaints in kunit tests

2023-11-15 Thread Joe Perches
On Wed, 2023-11-15 at 15:49 +, David Howells wrote: > Fix some checkpatch complaints in the new iov_iter kunit tests: > > (1) Some lines had eight spaces instead of a tab at the start. > > (2) Checkpatch doesn't like (void*)(unsigned long)0xnULL, so switch to > using POISON_POINTER

[PATCH v4 5/5] cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask

2023-11-15 Thread Waiman Long
To make CPUs in isolated cpuset partition closer in isolation to the boot time isolated CPUs specified in the "isolcpus" boot command line option, we need to take those CPUs out of the workqueue unbound cpumask so that work functions from the unbound workqueues won't run on those CPUs. Otherwise,

[PATCH v4 4/5] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-11-15 Thread Waiman Long
Add a new internal isolated_cpus mask to keep track of the CPUs that are in isolated partitions. Expose that new cpumask as a new root-only control file "cpuset.cpus.isolated". Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 190 +++-- 1 file changed,

[PATCH v4 3/5] selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh

2023-11-15 Thread Waiman Long
Minor cleanup of test matrix and relocation of test_isolated() function to prepare for the next patch. There is no functional change. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 142 +- 1 file changed, 71 insertions(+), 71 deletions(-) diff --g

[PATCH v4 0/5] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-11-15 Thread Waiman Long
v4: - Update patch 1 to move apply_wqattrs_lock() and apply_wqattrs_unlock() down into CONFIG_SYSFS block to avoid compilation warnings. v3: - Break out a separate patch to make workqueue_set_unbound_cpumask() static and move it down to the CONFIG_SYSFS section. - Remove the "__DEBUG__."

[PATCH v4 2/5] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-11-15 Thread Waiman Long
When the "isolcpus" boot command line option is used to add a set of isolated CPUs, those CPUs will be excluded automatically from wq_unbound_cpumask to avoid running work functions from unbound workqueues. Recently cpuset has been extended to allow the creation of partitions of isolated CPUs dyna

[PATCH v4 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread Waiman Long
The workqueue_set_unbound_cpumask() function is only used inside workqueue.c with CONFIG_SYSFS. Make it static and move it down to within the ifdef CONFIG_SYSFS block. Also move apply_wqattrs_lock() and apply_wqattrs_unlock() down as all their callers are within the CONFIG_SYSFS block. Also mark w

[PATCH bpf-next 4/4] selftests/bpf: Replaces the usage of CHECK calls for ASSERTs in vmlinux

2023-11-15 Thread Yuran Pereira
vmlinux.c uses the `CHECK` calls even though the use of ASSERT_ series of macros is preferred in the bpf selftests. This patch replaces all `CHECK` calls for equivalent `ASSERT_` macro calls. Signed-off-by: Yuran Pereira --- tools/testing/selftests/bpf/prog_tests/vmlinux.c | 16

[PATCH bpf-next 3/4] selftests/bpf: Replaces the usage of CHECK calls for ASSERTs in bpf_obj_id

2023-11-15 Thread Yuran Pereira
bpf_obj_id uses the `CHECK` calls even though the use of ASSERT_ series of macros is preferred in the bpf selftests. This patch replaces all `CHECK` calls for equivalent `ASSERT_` macro calls. Signed-off-by: Yuran Pereira --- .../selftests/bpf/prog_tests/bpf_obj_id.c | 204 +++--

[PATCH bpf-next 2/4] selftests/bpf: Replaces the usage of CHECK calls for ASSERTs in bind_perm

2023-11-15 Thread Yuran Pereira
bind_perm uses the `CHECK` calls even though the use of ASSERT_ series of macros is preferred in the bpf selftests. This patch replaces all `CHECK` calls for equivalent `ASSERT_` macro calls. Signed-off-by: Yuran Pereira --- tools/testing/selftests/bpf/prog_tests/bind_perm.c | 6 ++ 1 file

[PATCH bpf-next 1/4] selftests/bpf: Replaces the usage of CHECK calls for ASSERTs in bpf_tcp_ca

2023-11-15 Thread Yuran Pereira
bpf_tcp_ca uses the `CHECK` calls even though the use of ASSERT_ series of macros is preferred in the bpf selftests. This patch replaces all `CHECK` calls for equivalent `ASSERT_` macro calls. Signed-off-by: Yuran Pereira --- .../selftests/bpf/prog_tests/bpf_tcp_ca.c | 48 +-

[PATCH bpf-next 0/4] selftests/bpf: Update multiple prog_tests to use ASSERT_ macros

2023-11-15 Thread Yuran Pereira
Multiple files/programs in `tools/testing/selftests/bpf/prog_tests/` still heavily use the `CHECK` macro, even when better `ASSERT_` alternatives are available. As it was already pointed out by Yonghong Song [1] in the bpf selftests the use of the ASSERT_* series of macros is preferred over the CH

Re: [PATCH v1 12/23] KVM: VMX: Handle FRED event data

2023-11-15 Thread Chao Gao
>> >> >+default: >> >> >+WARN_ON(event_data != 0); >> >> >> >> I am not sure if this WARN_ON() can be triggeded by nested VMX. It is >> >> legitimate for L1 VMM to inject any event w/ an event_data. >> >> >> >> FRED spec says: >> >> >> >> Sect

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-11-15 Thread Liu, Jing2
Hi Jason, On 11/15/2023 9:58 PM, Jason Gunthorpe wrote: On Wed, Nov 15, 2023 at 01:17:06PM +0800, Liu, Jing2 wrote: This is the right way to approach it, I learned that there was discussion about using io_uring to get the page fault without eventfd notification in [1], and I am n

Re: [PATCH RFC RFT v2 2/5] fork: Add shadow stack support to clone3()

2023-11-15 Thread Edgecombe, Rick P
On Wed, 2023-11-15 at 18:43 +, Mark Brown wrote: > > end marker token (0) needs it i guess. > > x86 doesn't currently have end markers.  Actually, that's a point - > should we add a flag for specifying the use of end markers here? > There's code in my map_shadow_stack() implementation for arm6

Re: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-11-15 Thread Dan Carpenter
On Mon, Nov 06, 2023 at 02:58:12PM +0100, mrip...@kernel.org wrote: > > But a similar thing is happening here where we have so many bogus > > warnings that we missed a real bug. > > IIRC, there was a similar discussion for lockdep issues. IMO, any > (unintended) warning should trigger a test failu

Re: [PATCH v1 06/23] KVM: VMX: Defer enabling FRED MSRs save/load until after set CPUID

2023-11-15 Thread Sean Christopherson
On Tue, Nov 14, 2023, Xin3 Li wrote: > > Implement what in a different way? The VMCS fields and FRED are > > architectural. > > The internal layout of the VMCS is uarch specific, but the encodings and > > semantics > > absolutely cannot change without breaking software. And if Intel does > > s

Re: [PATCH v3 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread Waiman Long
-20231115] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Waiman-Long/work

[PATCH RFC 1/3] selftests/nolibc: add custom test harness

2023-11-15 Thread Thomas Weißschuh
The harness provides a framework to write unit tests for nolibc itself and kernel selftests using nolibc. Advantages over the current harness: * Makes it possible to emit KTAP for integration into kselftests. * Provides familiarity with the kselftest harness and google test. * It is nicer to write

[PATCH RFC 2/3] selftests/nolibc: migrate startup tests to new harness

2023-11-15 Thread Thomas Weißschuh
Migrate part of nolibc-test.c to the new test harness. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 106 ++- 1 file changed, 56 insertions(+), 50 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing

[PATCH RFC 0/3] selftests/nolibc: introduce new test harness

2023-11-15 Thread Thomas Weißschuh
This series introduces a new test harness for nolibc. It is similar to kselftest-harness and google test. More information in patch 1. This is an RFC to gather feedback, especially if it can be integrated with the original kselftest-harness somehow. Note: When run under qemu-loongarch64 8.1.2 th

[PATCH RFC 3/3] selftests/nolibc: migrate vfprintf tests to new harness

2023-11-15 Thread Thomas Weißschuh
Migrate part of nolibc-test.c to the new test harness. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 74 +++- 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing

Re: [PATCH 1/3] MAINTAINERS: Introduce V: field for required tests

2023-11-15 Thread Konstantin Ryabitsev
On Wed, Nov 15, 2023 at 07:43:49PM +0200, Nikolai Kondrashov wrote: > Introduce a new tag, 'Tested-with:', documented in the > Documentation/process/submitting-patches.rst file. The tag is expected > to reference the documented test suites, similarly to the 'V:' field, > and to certify that the sub

Re: [PATCH 1/3] MAINTAINERS: Introduce V: field for required tests

2023-11-15 Thread Mark Brown
On Wed, Nov 15, 2023 at 07:43:49PM +0200, Nikolai Kondrashov wrote: > Introduce a new tag, 'Tested-with:', documented in the > Documentation/process/submitting-patches.rst file. The tag is expected > to reference the documented test suites, similarly to the 'V:' field, > and to certify that the su

Re: [PATCH 1/3] MAINTAINERS: Introduce V: field for required tests

2023-11-15 Thread Mark Brown
On Wed, Nov 15, 2023 at 10:31:21AM -0800, Joe Perches wrote: > On Wed, 2023-11-15 at 19:43 +0200, Nikolai Kondrashov wrote: > > Introduce a new 'V:' ("Verify") field to MAINTAINERS. The field accepts > > a name of a test suite which is required to be executed for each > > contribution to the subsys

Re: [PATCH v3 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread kernel test robot
Hi Waiman, kernel test robot noticed the following build warnings: [auto build test WARNING on shuah-kselftest/next] [also build test WARNING on shuah-kselftest/fixes linus/master v6.7-rc1] [cannot apply to tj-cgroup/for-next tj-wq/for-next next-20231115] [If your patch is applied to the wrong

Re: [PATCH 2/3] MAINTAINERS: Require kvm-xfstests smoke for ext4

2023-11-15 Thread Darrick J. Wong
On Wed, Nov 15, 2023 at 07:43:50PM +0200, Nikolai Kondrashov wrote: > Signed-off-by: Nikolai Kondrashov > --- > Documentation/process/tests.rst | 32 > MAINTAINERS | 1 + > 2 files changed, 33 insertions(+) > > diff --git a/Documentation/proc

Re: [PATCH RFC RFT v2 2/5] fork: Add shadow stack support to clone3()

2023-11-15 Thread Mark Brown
On Wed, Nov 15, 2023 at 04:20:12PM +, szabolcs.n...@arm.com wrote: > The 11/15/2023 12:36, Mark Brown wrote: > > On Wed, Nov 15, 2023 at 12:45:45AM +, Edgecombe, Rick P wrote: > > > On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote: > > > > + if (size < 8) > > > > +

Re: [PATCH 1/3] MAINTAINERS: Introduce V: field for required tests

2023-11-15 Thread Joe Perches
On Wed, 2023-11-15 at 19:43 +0200, Nikolai Kondrashov wrote: > Introduce a new 'V:' ("Verify") field to MAINTAINERS. The field accepts > a name of a test suite which is required to be executed for each > contribution to the subsystem. Perhaps this is simply too much overhead process requirements f

[PATCH 3/3] MAINTAINERS: Require kunit core tests for framework changes

2023-11-15 Thread Nikolai Kondrashov
Signed-off-by: Nikolai Kondrashov --- Documentation/process/tests.rst | 13 + MAINTAINERS | 1 + 2 files changed, 14 insertions(+) diff --git a/Documentation/process/tests.rst b/Documentation/process/tests.rst index 9a9ea3fe65c37..56a7911f69031 100644 --- a/Docum

[PATCH 1/3] MAINTAINERS: Introduce V: field for required tests

2023-11-15 Thread Nikolai Kondrashov
Introduce a new 'V:' ("Verify") field to MAINTAINERS. The field accepts a name of a test suite which is required to be executed for each contribution to the subsystem. Each referenced test suite is expected to be documented in the new Documentation/process/tests.rst file, which must have enough st

[PATCH 2/3] MAINTAINERS: Require kvm-xfstests smoke for ext4

2023-11-15 Thread Nikolai Kondrashov
Signed-off-by: Nikolai Kondrashov --- Documentation/process/tests.rst | 32 MAINTAINERS | 1 + 2 files changed, 33 insertions(+) diff --git a/Documentation/process/tests.rst b/Documentation/process/tests.rst index 907311e91ec45..9a9ea3fe65c37

[RFC PATCH 0/3] MAINTAINERS: Introduce V: field for required tests

2023-11-15 Thread Nikolai Kondrashov
The idea of this RFC is to introduce a way to catalogue and document any tests that should be executed for changes to a subsystem, as well as to make checkpatch.pl require a tag in commit messages certifying they were, plus hopefully make it easier to discover and run them. This is following a dis

[PATCH v3 2/5] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-11-15 Thread Waiman Long
When the "isolcpus" boot command line option is used to add a set of isolated CPUs, those CPUs will be excluded automatically from wq_unbound_cpumask to avoid running work functions from unbound workqueues. Recently cpuset has been extended to allow the creation of partitions of isolated CPUs dyna

[PATCH v3 4/5] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-11-15 Thread Waiman Long
Add a new internal isolated_cpus mask to keep track of the CPUs that are in isolated partitions. Expose that new cpumask as a new root-only control file "cpuset.cpus.isolated". Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 190 +++-- 1 file changed,

[PATCH v3 5/5] cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask

2023-11-15 Thread Waiman Long
To make CPUs in isolated cpuset partition closer in isolation to the boot time isolated CPUs specified in the "isolcpus" boot command line option, we need to take those CPUs out of the workqueue unbound cpumask so that work functions from the unbound workqueues won't run on those CPUs. Otherwise,

[PATCH v3 3/5] selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh

2023-11-15 Thread Waiman Long
Minor cleanup of test matrix and relocation of test_isolated() function to prepare for the next patch. There is no functional change. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 142 +- 1 file changed, 71 insertions(+), 71 deletions(-) diff --g

[PATCH v3 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread Waiman Long
The workqueue_set_unbound_cpumask() function is only used inside workqueue.c with CONFIG_SYSFS. Make it static and move it down to within the ifdef CONFIG_SYSFS block. Also mark workqueue_apply_unbound_cpumask() as __maybe_unused for now as it will be used by another function introduced in a later

[PATCH v3 0/5] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-11-15 Thread Waiman Long
v3: - Break out a separate patch to make workqueue_set_unbound_cpumask() static and move it down to the CONFIG_SYSFS section. - Remove the "__DEBUG__." prefix and the CFTYPE_DEBUG flag from the new root only cpuset.cpus.isolated control files and update the test accordingly. v2: - Add

Re: [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-11-15 Thread Linus Torvalds
On Wed, 15 Nov 2023 at 11:39, David Howells wrote: > > I was trying to make it possible to do these tests before starting userspace > as there's a good chance that if the UBUF/IOVEC iterators don't work right > then your system can't be booted. Oh, I don't think that any unit test should bother t

Re: [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-11-15 Thread David Howells
Linus Torvalds wrote: > From a quick look, what you were doing was checking that the patterns > you set up in user space came through ok. Dammit, what's wrong with > just using read()/write() on a pipe, or splice, or whatever. It will > test exactly the same iov_iter thing. I was trying to make

Re: [PATCH v3 08/10] iov_iter: Add benchmarking kunit tests

2023-11-15 Thread Linus Torvalds
On Wed, 15 Nov 2023 at 10:50, David Howells wrote: > > Add kunit tests to benchmark 256MiB copies to a KVEC iterator, a BVEC > iterator, an XARRAY iterator and to a loop that allocates 256-page BVECs > and fills them in (similar to a maximal bio struct being set up). I see *zero* advantage of doi

Re: [PATCH RFC RFT v2 2/5] fork: Add shadow stack support to clone3()

2023-11-15 Thread szabolcs.n...@arm.com
The 11/15/2023 12:36, Mark Brown wrote: > On Wed, Nov 15, 2023 at 12:45:45AM +, Edgecombe, Rick P wrote: > > On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote: > > > > + if (size < 8) > > > + return (unsigned long)ERR_PTR(-EINVAL); > > > What is the intenti

Re: [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-11-15 Thread Linus Torvalds
On Wed, 15 Nov 2023 at 10:50, David Howells wrote: > > This requires access to otherwise unexported core symbols: mm_alloc(), > vm_area_alloc(), insert_vm_struct() arch_pick_mmap_layout() and > anon_inode_getfile_secure(), which I've exported _GPL. > > [?] Would it be better if this were done in c

Re: [PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests

2023-11-15 Thread Linus Torvalds
On Wed, 15 Nov 2023 at 10:50, David Howells wrote: > > (3) Add a function to set up a userspace VM, attach the VM to the kunit > testing thread, create an anonymous file, stuff some pages into the > file and map the file into the VM to act as a buffer that can be used > with UBUF/I

Re: [PATCH 1/3] kunit: Add a macro to wrap a deferred action function

2023-11-15 Thread Daniel Vetter
On Wed, 15 Nov 2023 at 16:51, Maxime Ripard wrote: > > On Sat, 11 Nov 2023 04:08:26 +0800, David Gow wrote: > > KUnit's deferred action API accepts a void(*)(void *) function pointer > > which is called when the test is exited. However, we very frequently > > want to use existing functions which a

Re: [PATCH 1/3] kunit: Add a macro to wrap a deferred action function

2023-11-15 Thread Maxime Ripard
On Sat, 11 Nov 2023 04:08:26 +0800, David Gow wrote: > KUnit's deferred action API accepts a void(*)(void *) function pointer > which is called when the test is exited. However, we very frequently > want to use existing functions which accept a single pointer, but which > may not be of type void*.

[PATCH v3 10/10] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-11-15 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a UBUF iterator and an IOVEC iterator. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc

[PATCH v3 09/10] iov_iter: Add kunit to benchmark decanting of xarray to bvec

2023-11-15 Thread David Howells
Add a kunit test to benchmark an xarray containing 256MiB of data getting decanted into 256-page BVEC iterators that get copied from - modelling bufferage being drawn from the pagecache and batched up for I/O. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axb

Re: [PATCH 2/3] drm/tests: Use KUNIT_DEFINE_ACTION_WRAPPER()

2023-11-15 Thread Maxime Ripard
Hi David, On Sat, Nov 11, 2023 at 04:08:27AM +0800, David Gow wrote: > In order to pass functions to kunit_add_action(), they need to be of the > kunit_action_t type. While casting the function pointer can work, it > will break control-flow integrity. > > drm_kunit_helpers already defines wrapper

[PATCH v3 07/10] iov_iter: Add extract kunit tests for ITER_UBUF and ITER_IOVEC

2023-11-15 Thread David Howells
Add extraction kunit tests for ITER_UBUF- and ITER_IOVEC-type iterators. This attaches a userspace VM with a mapped file in it temporarily to the test thread. [!] Note that this requires the kernel thread running the test to obtain and deploy an mm_struct so that a user-side buffer can be created

[PATCH v3 08/10] iov_iter: Add benchmarking kunit tests

2023-11-15 Thread David Howells
Add kunit tests to benchmark 256MiB copies to a KVEC iterator, a BVEC iterator, an XARRAY iterator and to a loop that allocates 256-page BVECs and fills them in (similar to a maximal bio struct being set up). Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axbo

[PATCH v3 06/10] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC

2023-11-15 Thread David Howells
Add copy kunit tests for ITER_UBUF- and ITER_IOVEC-type iterators. This attaches a userspace VM with a mapped file in it temporarily to the test thread. Signed-off-by: David Howells cc: Andrew Morton cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: Matthew Wilcox

[PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-11-15 Thread David Howells
Create a function to set up a userspace VM for the kunit testing thread and set up a buffer within it such that ITER_UBUF and ITER_IOVEC tests can be performed. Note that this requires current->mm to point to a sufficiently set up mm_struct. This is done by partially mirroring what execve does.

[PATCH v3 04/10] iov_iter: Consolidate bvec pattern checking

2023-11-15 Thread David Howells
Make the BVEC-testing functions use the consolidated pattern checking functions to reduce the amount of duplicated code. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David

[PATCH v3 03/10] iov_iter: Consolidate the test vector struct in the kunit tests

2023-11-15 Thread David Howells
Consolidate the test vector struct in the kunit tests so that the bvec pattern check helpers can share with the kvec check helpers. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins

[PATCH v3 02/10] iov_iter: Consolidate some of the repeated code into helpers

2023-11-15 Thread David Howells
Consolidate some of the repeated code snippets into helper functions to reduce the line count. Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest@v

[PATCH v3 01/10] iov_iter: Fix some checkpatch complaints in kunit tests

2023-11-15 Thread David Howells
Fix some checkpatch complaints in the new iov_iter kunit tests: (1) Some lines had eight spaces instead of a tab at the start. (2) Checkpatch doesn't like (void*)(unsigned long)0xnULL, so switch to using POISON_POINTER_DELTA plus an offset instead. Reported-by: Johannes Thumshirn Sig

[PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests

2023-11-15 Thread David Howells
Hi Christian, Can you take this through the filesystem tree? These patches make some changes to the kunit tests previously added for iov_iter testing, in particular adding testing of UBUF/IOVEC iterators and some benchmarking: (1) Clean up a couple of checkpatch style complaints. (2) Consolid

Re: [PATCH v2] KVM: arm64: selftests: Clean up the GIC[D,R]_BASE_GPA

2023-11-15 Thread Oliver Upton
On Wed, Nov 15, 2023 at 10:34:48AM -0500, Shaoqin Huang wrote: > The GIC[D,R]_BASE_GPA has been defined in multiple files with the same > value, define it in one place to make the code clean. > > Signed-off-by: Shaoqin Huang Colton already posted a fix for this as part of his selftests series h

Re: selftests: gpio: crash on arm64

2023-11-15 Thread Naresh Kamboju
On Wed, 15 Nov 2023 at 07:12, wrote: > > Tue, Nov 07, 2023 at 07:21:32PM +0530, Naresh Kamboju kirjoitti: > > On Tue, 20 Jun 2023 at 22:11, Andy Shevchenko > > wrote: > > > On Tue, Apr 11, 2023 at 10:57:28AM +0200, Linus Walleij wrote: > > > > On Mon, Apr 10, 2023 at 11:16 AM Naresh Kamboju > > >

Re: [PATCH] selftests/memfd: fix a memleak

2023-11-15 Thread Mathieu Desnoyers
On 2023-11-15 00:45, zhujun2 wrote: The memory allocated within a function should be released before the function return,otherwise memleak will occur. [...] --- a/tools/testing/selftests/memfd/fuse_test.c +++ b/tools/testing/selftests/memfd/fuse_test.c @@ -205,6 +205,7 @@ static pid_t spawn_s

Re: [PATCH RFC RFT v2 1/5] mm: Introduce ARCH_HAS_USER_SHADOW_STACK

2023-11-15 Thread Deepak Gupta
On Tue, Nov 14, 2023 at 08:05:54PM +, Mark Brown wrote: Since multiple architectures have support for shadow stacks and we need to select support for this feature in several places in the generic code provide a generic config option that the architectures can select. Suggested-by: David Hild

[PATCH v2] KVM: arm64: selftests: Clean up the GIC[D,R]_BASE_GPA

2023-11-15 Thread Shaoqin Huang
The GIC[D,R]_BASE_GPA has been defined in multiple files with the same value, define it in one place to make the code clean. Signed-off-by: Shaoqin Huang --- v1->v2: - Clean up the vpmu_counter_access.c. --- tools/testing/selftests/kvm/aarch64/arch_timer.c | 3 --- tools/testing/sel

Re: [PATCH] selftests/media_tests: fix a resource leak

2023-11-15 Thread Mathieu Desnoyers
On 2023-11-14 04:38, zhujun2 wrote: The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by code reading Fixing resource leaks for one-off test cases (processes execute and then immediately exit) seems to be something that would fit in

Re: [PATCH] KVM: arm64: selftests: Clean up the GIC[D,R]_BASE_GPA

2023-11-15 Thread Shaoqin Huang
On 11/15/23 18:47, Shaoqin Huang wrote: The GIC[D,R]_BASE_GPA has been defined in multiple files with the same value, define it in one place to make the code clean. Signed-off-by: Shaoqin Huang --- tools/testing/selftests/kvm/aarch64/arch_timer.c | 3 --- tools/testing/selftests/kvm/aar

Re: [PATCH 1/3] kunit: Add a macro to wrap a deferred action function

2023-11-15 Thread Nathan Chancellor
Hi David, On Sat, Nov 11, 2023 at 04:08:26AM +0800, David Gow wrote: > KUnit's deferred action API accepts a void(*)(void *) function pointer > which is called when the test is exited. However, we very frequently > want to use existing functions which accept a single pointer, but which > may not b

Re: [PATCH RFC RFT v2 1/5] mm: Introduce ARCH_HAS_USER_SHADOW_STACK

2023-11-15 Thread David Hildenbrand
On 14.11.23 21:05, Mark Brown wrote: Since multiple architectures have support for shadow stacks and we need to select support for this feature in several places in the generic code provide a generic config option that the architectures can select. Suggested-by: David Hildenbrand Signed-off-by:

Re: [PATCH RFC RFT v2 1/5] mm: Introduce ARCH_HAS_USER_SHADOW_STACK

2023-11-15 Thread Mark Brown
On Tue, Nov 14, 2023 at 11:22:16PM +, Edgecombe, Rick P wrote: > On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote: > > +config ARCH_HAS_USER_SHADOW_STACK > > +   bool > > +   help > > + The architecture has hardware support for userspace shadow > > call > > +  stacks

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

2023-11-15 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 t

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-11-15 Thread Jason Gunthorpe
On Wed, Nov 15, 2023 at 01:17:06PM +0800, Liu, Jing2 wrote: > This is the right way to approach it, > >I learned that there was discussion about using io_uring to get the >page fault without > >eventfd notification in [1], and I am new at io_uring and studying the >man page of >

Re: [PATCH RFC RFT v2 5/5] kselftest/clone3: Test shadow stack support

2023-11-15 Thread Mark Brown
On Tue, Nov 14, 2023 at 11:11:58PM +, Edgecombe, Rick P wrote: > On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote: > > +   shadow_stack = syscall(__NR_map_shadow_stack, 0, > > getpagesize(), 0); > Hmm, x86 fails this call if user shadow stack is not supported in the > HW or the kernel,

Re: [PATCH RFC RFT v2 2/5] fork: Add shadow stack support to clone3()

2023-11-15 Thread Mark Brown
On Wed, Nov 15, 2023 at 12:45:45AM +, Edgecombe, Rick P wrote: > On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote: > > +   if (size < 8) > > +   return (unsigned long)ERR_PTR(-EINVAL); > What is the intention here? The check in map_shadow_stack is to leave >

[PATCH] KVM: arm64: selftests: Clean up the GIC[D,R]_BASE_GPA

2023-11-15 Thread Shaoqin Huang
The GIC[D,R]_BASE_GPA has been defined in multiple files with the same value, define it in one place to make the code clean. Signed-off-by: Shaoqin Huang --- tools/testing/selftests/kvm/aarch64/arch_timer.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_irq.c | 3 --- tools/testing/self

Re: [Discuss] Seeking advice on net selftests netns naming method

2023-11-15 Thread Hangbin Liu
On Wed, Nov 15, 2023 at 10:10:38AM +0100, Paolo Abeni wrote: > > Thanks, this is a good idea. I reviewed all the test cases and it should > > works > > for most of them. Only the SRv6 tests are a little complex as they use 2 id > > number for netns name. e.g. the setup_hs() in > > srv6_end_dt46_l3

Re: [Discuss] Seeking advice on net selftests netns naming method

2023-11-15 Thread Paolo Abeni
On Wed, 2023-11-15 at 15:51 +0800, Hangbin Liu wrote: > On Tue, Nov 14, 2023 at 12:02:00PM +0100, Paolo Abeni wrote: > > I personally would like sort of both :) e.g. lib function(s) to > > automatically create and dispose netns, and retain a script- > > specific/related name prefix.  > > > > The l