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
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
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.
>
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
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
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,
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,
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
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__."
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
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
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
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 +++--
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
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 +-
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
>> >> >+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
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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)
> > > > +
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
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
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
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
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
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
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,
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,
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
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
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
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
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
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
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
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
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
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
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*.
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
> > >
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
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
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
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
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
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
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:
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
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
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
>
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,
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
>
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
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
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
80 matches
Mail list logo