[RFC PATCH] kunit: Add a macro to wrap a deferred action function

2023-09-14 Thread David Gow
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*. While this is probably dodgy enough to be on the wrong side

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Suren Baghdasaryan
On Fri, Sep 15, 2023 at 4:04 AM Nadav Amit wrote: > > > > > On Sep 14, 2023, at 8:28 PM, Suren Baghdasaryan wrote: > > > > On Thu, Sep 14, 2023 at 2:57 PM Nadav Amit wrote: > >> > >> > >>> On Sep 14, 2023, at 8:26 AM, Suren Baghdasaryan wrote: > >>> > >>> + if

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Nadav Amit
> On Sep 14, 2023, at 8:28 PM, Suren Baghdasaryan wrote: > > On Thu, Sep 14, 2023 at 2:57 PM Nadav Amit wrote: >> >> >>> On Sep 14, 2023, at 8:26 AM, Suren Baghdasaryan wrote: >>> >>> + if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), >>> + orig_src_pte)) >>> +

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Suren Baghdasaryan
On Thu, Sep 14, 2023 at 2:57 PM Nadav Amit wrote: > > > > On Sep 14, 2023, at 8:26 AM, Suren Baghdasaryan wrote: > > > > + if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), > > + orig_src_pte)) > > + BUG_ON(1); > > Just a minor detail regarding these few

[PATCH 4/8] mm/damon/core-test: add a unit test for damon_moving_sum()

2023-09-14 Thread SeongJae Park
Add a simple unit test for the pseudo moving-sum function (damon_moving_sum()). Signed-off-by: SeongJae Park --- mm/damon/core-test.h | 16 1 file changed, 16 insertions(+) diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index 6cc8b245586d..c539f0e8377e 100644 ---

[PATCH 0/8] mm/damon: provide pseudo-moving sum based access rate

2023-09-14 Thread SeongJae Park
Changes from RFC (https://lore.kernel.org/damon/20230909033711.55794-1...@kernel.org/) - Rebase on latest mm-unstable - Minor wordsmithing of coverletter DAMON checks the access to each region for every sampling interval, increase the access rate counter of the region, namely nr_accesses, if the

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-14 Thread Yafang Shao
On Wed, Sep 13, 2023 at 8:30 PM Luis Gerhorst wrote: > > This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. > > To mitigate Spectre v1, the verifier relies on static analysis to deduct > constant pointer bounds, which can then be enforced by rewriting pointer > arithmetic [1] or index

[RFC PATCH 9/9] iov_iter: Add benchmarking kunit tests for UBUF/IOVEC

2023-09-14 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

[RFC PATCH 7/9] iov_iter: Add extract kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-14 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

[RFC PATCH 5/9] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests

2023-09-14 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.

[RFC PATCH 4/9] iov_iter: Consolidate bvec pattern checking

2023-09-14 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

[RFC PATCH 6/9] iov_iter: Add copy kunit tests for ITER_UBUF and ITER_IOVEC

2023-09-14 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

[RFC PATCH 8/9] iov_iter: Add benchmarking kunit tests

2023-09-14 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

[RFC PATCH 2/9] iov_iter: Consolidate some of the repeated code into helpers

2023-09-14 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:

[RFC PATCH 3/9] iov_iter: Consolidate the test vector struct in the kunit tests

2023-09-14 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

[RFC PATCH 1/9] iov_iter: Fix some checkpatch complaints in kunit tests

2023-09-14 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

[RFC PATCH 0/9] iov_iter: kunit: Cleanup, abstraction and more tests

2023-09-14 Thread David Howells
Hi Al, Linus, These patches make some changes to the kunit tests previously added for iov_iter testing, in particular adding support for testing UBUF/IOVEC iterators: (1) Clean up a couple of checkpatch style complaints. (2) Consolidate some repeated bits of code into helper functions and use

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Nadav Amit
> On Sep 14, 2023, at 8:26 AM, Suren Baghdasaryan wrote: > > + if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), > + orig_src_pte)) > + BUG_ON(1); Just a minor detail regarding these few lines: Besides the less-than-ideal use of BUG_ON() here, I think

[PATCH 2/2] kunit: tool: add attributes output to kunit.py

2023-09-14 Thread Rae Moar
Output attributes in kunit.py results. Example of format: [21:33:23] === example (7 subtests) === [21:33:23] module: kunit_example_test [21:33:23] [PASSED] example_simple_test ... [21:33:23] [PASSED] example_slow_test [21:33:23] speed: slow [21:33:23]

[PATCH 1/2] kunit: tool: add parsing of test attributes

2023-09-14 Thread Rae Moar
Add parsing of attributes as diagnostic data. Fixes issue with test plan being parsed incorrectly as diagnostic data when located after suite-level attributes. Note that if there does not exist a test plan line, the diagnostic lines between the suite header and the first result will be saved in

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Suren Baghdasaryan
On Thu, Sep 14, 2023 at 12:28 PM Jann Horn wrote: > > On Thu, Sep 14, 2023 at 5:26 PM Suren Baghdasaryan wrote: > > > > From: Andrea Arcangeli > > > > This implements the uABI of UFFDIO_REMAP. > > > > Notably one mode bitflag is also forwarded (and in turn known) by the > > lowlevel remap_pages

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-14 Thread Alexei Starovoitov
On Thu, Sep 14, 2023 at 10:24 AM Daniel Borkmann wrote: > > On 9/14/23 6:20 PM, Alexei Starovoitov wrote: > > On Wed, Sep 13, 2023 at 5:30 AM Luis Gerhorst wrote: > >> > >> This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. > >> > >> To mitigate Spectre v1, the verifier relies on

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Jann Horn
On Thu, Sep 14, 2023 at 5:26 PM Suren Baghdasaryan wrote: > > From: Andrea Arcangeli > > This implements the uABI of UFFDIO_REMAP. > > Notably one mode bitflag is also forwarded (and in turn known) by the > lowlevel remap_pages method. > > Signed-off-by: Andrea Arcangeli > Signed-off-by: Suren

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Suren Baghdasaryan
On Thu, Sep 14, 2023 at 11:47 AM David Hildenbrand wrote: > > On 14.09.23 17:26, Suren Baghdasaryan wrote: > > From: Andrea Arcangeli > > > > This implements the uABI of UFFDIO_REMAP. > > > > Notably one mode bitflag is also forwarded (and in turn known) by the > > lowlevel remap_pages method. >

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread David Hildenbrand
On 14.09.23 17:26, Suren Baghdasaryan wrote: From: Andrea Arcangeli This implements the uABI of UFFDIO_REMAP. Notably one mode bitflag is also forwarded (and in turn known) by the lowlevel remap_pages method. Sorry to say, but these functions are unacceptably long. Please find ways to

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread David Hildenbrand
On 14.09.23 20:43, David Hildenbrand wrote: On 14.09.23 20:11, Matthew Wilcox wrote: On Thu, Sep 14, 2023 at 08:26:12AM -0700, Suren Baghdasaryan wrote: +++ b/include/linux/userfaultfd_k.h @@ -93,6 +93,23 @@ extern int mwriteprotect_range(struct mm_struct *dst_mm, extern long

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread David Hildenbrand
On 14.09.23 20:11, Matthew Wilcox wrote: On Thu, Sep 14, 2023 at 08:26:12AM -0700, Suren Baghdasaryan wrote: +++ b/include/linux/userfaultfd_k.h @@ -93,6 +93,23 @@ extern int mwriteprotect_range(struct mm_struct *dst_mm, extern long uffd_wp_range(struct vm_area_struct *vma,

Re: [PATCH 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-09-14 Thread Suren Baghdasaryan
On Thu, Sep 14, 2023 at 10:56 AM Matthew Wilcox wrote: > > On Thu, Sep 14, 2023 at 08:26:11AM -0700, Suren Baghdasaryan wrote: > > From: Andrea Arcangeli > > > > As far as the rmap code is concerned, UFFDIO_REMAP only alters the > > page->mapping and page->index. It does it while holding the

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Matthew Wilcox
On Thu, Sep 14, 2023 at 08:26:12AM -0700, Suren Baghdasaryan wrote: > +++ b/include/linux/userfaultfd_k.h > @@ -93,6 +93,23 @@ extern int mwriteprotect_range(struct mm_struct *dst_mm, > extern long uffd_wp_range(struct vm_area_struct *vma, > unsigned long start, unsigned

Re: [PATCH 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-09-14 Thread Matthew Wilcox
On Thu, Sep 14, 2023 at 08:26:11AM -0700, Suren Baghdasaryan wrote: > From: Andrea Arcangeli > > As far as the rmap code is concerned, UFFDIO_REMAP only alters the > page->mapping and page->index. It does it while holding the page folio->mapping and folio->index. It does it while holding the

Re: [PATCH 1/5] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-14 Thread Reinette Chatre
Hi Ilpo, On 9/14/2023 10:05 AM, Ilpo Järvinen wrote: > On Thu, 14 Sep 2023, Reinette Chatre wrote: >> On 9/14/2023 3:16 AM, Ilpo Järvinen wrote: >>> On Wed, 13 Sep 2023, Reinette Chatre wrote: On 9/13/2023 3:01 AM, Ilpo Järvinen wrote: > On Tue, 12 Sep 2023, Reinette Chatre wrote: >>

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-14 Thread Daniel Borkmann
On 9/14/23 6:20 PM, Alexei Starovoitov wrote: On Wed, Sep 13, 2023 at 5:30 AM Luis Gerhorst wrote: This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. To mitigate Spectre v1, the verifier relies on static analysis to deduct constant pointer bounds, which can then be enforced by

Re: [PATCH 1/5] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-14 Thread Ilpo Järvinen
On Thu, 14 Sep 2023, Reinette Chatre wrote: > On 9/14/2023 3:16 AM, Ilpo Järvinen wrote: > > On Wed, 13 Sep 2023, Reinette Chatre wrote: > >> On 9/13/2023 3:01 AM, Ilpo Järvinen wrote: > >>> On Tue, 12 Sep 2023, Reinette Chatre wrote: > On 9/11/2023 4:19 AM, Ilpo Järvinen wrote: > >

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-14 Thread Alexei Starovoitov
On Wed, Sep 13, 2023 at 5:30 AM Luis Gerhorst wrote: > > This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. > > To mitigate Spectre v1, the verifier relies on static analysis to deduct > constant pointer bounds, which can then be enforced by rewriting pointer > arithmetic [1] or index

[PATCH 3/4] tools/nolibc: don't define new syscall number

2023-09-14 Thread Thomas Weißschuh
All symbols created by nolibc are also visible to user code. Syscall constants are expected to come from the kernel headers and should not be made up by nolibc. Refactor the logic to avoid defining syscall numbers. Also the new code is easier to understand. Signed-off-by: Thomas Weißschuh ---

[PATCH 4/4] tools/nolibc: automatically detect necessity to use pselect6

2023-09-14 Thread Thomas Weißschuh
We can automatically detect if pselect6 is needed or not from the kernel headers. This removes the need to manually specify it. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/arch-aarch64.h | 3 --- tools/include/nolibc/arch-loongarch.h | 4 +--- tools/include/nolibc/arch-riscv.h

[PATCH 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks

2023-09-14 Thread Thomas Weißschuh
The ENOSYS fallback code does not use its functions parameters. This can lead to compiler warnings about unused parameters. Explicitly avoid these warnings. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 31 +++ 1 file changed, 31 insertions(+)

[PATCH 1/4] selftests/nolibc: allow building i386 with multiarch compiler

2023-09-14 Thread Thomas Weißschuh
When building with a multiarch-capable compiler, like those provided by common distributions the -m32 argument is required to build 32bit code. Wrap it in cc-option in case the compiler is not multiarch-capable. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 1 +

[PATCH 0/4] tools/nolibc: cleanups for syscall fallbacks

2023-09-14 Thread Thomas Weißschuh
+ 5 files changed, 38 insertions(+), 15 deletions(-) --- base-commit: 3f79a57865b33f49fdae6655510bd27c8e6610e0 change-id: 20230914-nolibc-syscall-nr-9a5f544c8494 Best regards, -- Thomas Weißschuh

Re: [PATCH RESEND v3 1/2] selftests/resctrl: Fix schemata write error check

2023-09-14 Thread Reinette Chatre
Hi Maciej, On 9/13/2023 11:01 PM, Maciej Wieczór-Retman wrote: > On 2023-09-13 at 11:49:19 -0700, Reinette Chatre wrote: >> On 9/12/2023 10:59 PM, Maciej Wieczór-Retman wrote: >>> On 2023-09-12 at 09:00:28 -0700, Reinette Chatre wrote: On 9/11/2023 11:32 PM, Maciej Wieczór-Retman wrote:

[PATCH 3/3] selftests/mm: add UFFDIO_REMAP ioctl test

2023-09-14 Thread Suren Baghdasaryan
Add a test for new UFFDIO_REMAP ioctl which uses uffd to remaps source into destination buffer while checking the contents of both after remapping. After the operation the content of the destination buffer should match the original source buffer's content while the source buffer should be zeroed.

[PATCH 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-09-14 Thread Suren Baghdasaryan
From: Andrea Arcangeli As far as the rmap code is concerned, UFFDIO_REMAP only alters the page->mapping and page->index. It does it while holding the page lock. However folio_referenced() is doing rmap walks without taking the folio lock first, so folio_lock_anon_vma_read() must be updated to

[PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Suren Baghdasaryan
From: Andrea Arcangeli This implements the uABI of UFFDIO_REMAP. Notably one mode bitflag is also forwarded (and in turn known) by the lowlevel remap_pages method. Signed-off-by: Andrea Arcangeli Signed-off-by: Suren Baghdasaryan --- fs/userfaultfd.c | 49 +++

[PATCH 0/3] userfaultfd remap option

2023-09-14 Thread Suren Baghdasaryan
This patch series introduces UFFDIO_REMAP feature to userfaultfd, which has long been implemented and maintained by Andrea in his local tree [1], but was not upstreamed due to lack of use cases where this approach would be better than allocating a new page and copying the contents. UFFDIO_COPY

Re: [PATCH net-next v3 3/6] net: bridge: Track and limit dynamically learned FDB entries

2023-09-14 Thread Nikolay Aleksandrov
On 9/5/23 14:47, Johannes Nixdorf wrote: A malicious actor behind one bridge port may spam the kernel with packets with a random source MAC address, each of which will create an FDB entry, each of which is a dynamic allocation in the kernel. There are roughly 2^48 different MAC addresses,

Re: [PATCH 1/5] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-14 Thread Reinette Chatre
Hi Ilpo, On 9/14/2023 3:16 AM, Ilpo Järvinen wrote: > On Wed, 13 Sep 2023, Reinette Chatre wrote: >> On 9/13/2023 3:01 AM, Ilpo Järvinen wrote: >>> On Tue, 12 Sep 2023, Reinette Chatre wrote: On 9/11/2023 4:19 AM, Ilpo Järvinen wrote: > Unmounting resctrl FS has been moved into the per

Re: [PATCH 2/5] selftests/resctrl: Remove duplicate feature check from CMT test

2023-09-14 Thread Reinette Chatre
Hi Ilpo, On 9/14/2023 2:58 AM, Ilpo Järvinen wrote: > On Wed, 13 Sep 2023, Reinette Chatre wrote: >> On 9/13/2023 4:11 AM, Ilpo Järvinen wrote: >>> On Tue, 12 Sep 2023, Reinette Chatre wrote: On 9/11/2023 4:19 AM, Ilpo Järvinen wrote: > The test runner run_cmt_test() in resctrl_tests.c

Re: [PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-14 Thread kernel test robot
Hi Jinjie, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on next-20230914] [cannot apply to v6.6-rc1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use

Re: [PATCH 2/2] drm/tests: Flag slow tests as such

2023-09-14 Thread Maxime Ripard
Hi Sima, (For some reason, it looks like your mailer sets up the headers to reply to every recipient but you) On Tue, Sep 12, 2023 at 09:36:12AM +0200, Daniel Vetter wrote: > On Mon, Sep 11, 2023 at 11:51:06AM +0200, Maxime Ripard wrote: > > Kunit recently gained a speed attribute that allows to

Re: [PATCH 1/3] Revert "selftests/bpf: Add selftest for allow_ptr_leaks"

2023-09-14 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf.git (master) by Daniel Borkmann : On Wed, 13 Sep 2023 12:25:15 + you wrote: > This reverts commit 0072e3624b463636c842ad8e261f1dc91deb8c78. > > The test tests behavior which can not be permitted because of Spectre > v1. See the following commit > >

[PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-14 Thread Jinjie Ruan
If kunit_filter_suites() succeeds, not only copy but also filtered_suite and filtered_suite->test_cases should be freed. So use kunit_free_suite_set() to free the filtered_suite, filtered_suite->test_cases and copy as kunit_module_exit() and kunit_run_all_tests() do it. Fixes: e5857d396f35

[PATCH 3/4] kunit: Fix possible memory leak in kunit_filter_suites()

2023-09-14 Thread Jinjie Ruan
If the outer layer for loop is iterated more than once and it fails not in the first iteration, the filtered_suite and filtered_suite->test_cases allocated in the last kunit_filter_attr_tests() in last inner for loop is leaked. So add a new free_filtered_suite err label and free the

[PATCH 2/4] kunit: Fix the wrong kfree of copy for kunit_filter_suites()

2023-09-14 Thread Jinjie Ruan
If the outer layer for loop is iterated more than once and it fails not in the first iteration, the copy pointer has been moved. So it should free the original copy's backup copy_start. Fixes: abbf73816b6f ("kunit: fix possible memory leak in kunit_filter_suites()") Signed-off-by: Jinjie Ruan

[PATCH 1/4] kunit: Fix missed memory release in kunit_free_suite_set()

2023-09-14 Thread Jinjie Ruan
modprobe cpumask_kunit and rmmod cpumask_kunit, kmemleak detect a suspected memory leak as below. If kunit_filter_suites() in kunit_module_init() succeeds, the suite_set.start will not be NULL and the kunit_free_suite_set() in kunit_module_exit() should free all the memory which has not been

[PATCH 0/4] kunit: Fix some bugs in kunit

2023-09-14 Thread Jinjie Ruan
The test_cases is not freed in kunit_free_suite_set(). And the copy pointer may be moved in kunit_filter_suites(). The filtered_suite and filtered_suite->test_cases allocated in the last kunit_filter_attr_tests() in last inner for loop may be leaked if kunit_filter_suites() fails. If

Re: [PATCH 3/5] selftests/resctrl: Refactor feature check to use resource and feature name

2023-09-14 Thread Ilpo Järvinen
On Wed, 13 Sep 2023, Reinette Chatre wrote: > On 9/13/2023 4:02 AM, Ilpo Järvinen wrote: > > On Tue, 12 Sep 2023, Reinette Chatre wrote: > >> On 9/11/2023 4:19 AM, Ilpo Järvinen wrote: > >>> Feature check in validate_resctrl_feature_request() takes in the test > >>> name string and maps that to

Re: [PATCH 1/5] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-09-14 Thread Ilpo Järvinen
On Wed, 13 Sep 2023, Reinette Chatre wrote: > On 9/13/2023 3:01 AM, Ilpo Järvinen wrote: > > On Tue, 12 Sep 2023, Reinette Chatre wrote: > >> On 9/11/2023 4:19 AM, Ilpo Järvinen wrote: > >>> Unmounting resctrl FS has been moved into the per test functions in > >>> resctrl_tests.c by commit

Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 10:52:15AM +0100, Conor Dooley wrote: > On Thu, Sep 14, 2023 at 11:36:01AM +0200, Andrew Jones wrote: > > > +static inline void cpu_relax(void) > > > +{ > > > +#ifdef __riscv_zihintpause > > > + asm volatile("pause" ::: "memory"); > > > +#else > > > + /* Encoding of the

Re: [PATCH 2/5] selftests/resctrl: Remove duplicate feature check from CMT test

2023-09-14 Thread Ilpo Järvinen
On Wed, 13 Sep 2023, Reinette Chatre wrote: > On 9/13/2023 4:11 AM, Ilpo Järvinen wrote: > > On Tue, 12 Sep 2023, Reinette Chatre wrote: > >> On 9/11/2023 4:19 AM, Ilpo Järvinen wrote: > >>> The test runner run_cmt_test() in resctrl_tests.c checks for CMT > >>> feature and does not run

Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test

2023-09-14 Thread Conor Dooley
On Thu, Sep 14, 2023 at 11:36:01AM +0200, Andrew Jones wrote: > > +static inline void cpu_relax(void) > > +{ > > +#ifdef __riscv_zihintpause > > + asm volatile("pause" ::: "memory"); > > +#else > > + /* Encoding of the pause instruction */ > > + asm volatile(".4byte 0x10F" ::: "memory");

Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:37:03AM +0800, Haibo Xu wrote: > Add a KVM selftests to validate the Sstc timer functionality. > The test was ported from arm64 arch timer test. I just tried this test out. Running it over and over again on QEMU I see it works sometimes, but it frequently fails with the

Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:37:03AM +0800, Haibo Xu wrote: > Add a KVM selftests to validate the Sstc timer functionality. > The test was ported from arm64 arch timer test. > > Signed-off-by: Haibo Xu > --- > tools/testing/selftests/kvm/Makefile | 1 + >

Re: [PATCH v2 2/2] Documentation: Add debugfs docs with run after boot

2023-09-14 Thread David Gow
On Sat, 9 Sept 2023 at 05:32, Rae Moar wrote: > > Expand the documentation on the KUnit debugfs filesystem on the > run_manual.rst page. > > Add section describing how to access results using debugfs. > > Add section describing how to run tests after boot using debugfs. > > Signed-off-by: Rae

Re: [PATCH v2 1/2] kunit: add ability to run tests after boot using debugfs

2023-09-14 Thread David Gow
On Sat, 9 Sept 2023 at 05:31, Rae Moar wrote: > > Add functionality to run built-in tests after boot by writing to a > debugfs file. > > Add a new debugfs file labeled "run" for each test suite to use for > this purpose. > > As an example, write to the file using the following: > > echo "any

Re: [PATCH v3 8/9] KVM: riscv: selftests: Change vcpu_has_ext to a common function

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:37:02AM +0800, Haibo Xu wrote: > Move vcpu_has_ext to the processor.c and rename it to __vcpu_has_ext > so that other test cases can use it for vCPU extension check. > > Signed-off-by: Haibo Xu > --- > .../selftests/kvm/include/riscv/processor.h | 2 ++ >

Re: [PATCH v3 5/9] KVM: riscv: selftests: Switch to use macro from csr.h

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:36:59AM +0800, Haibo Xu wrote: > Signed-off-by: Haibo Xu > --- > tools/testing/selftests/kvm/include/riscv/processor.h | 8 +--- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/tools/testing/selftests/kvm/include/riscv/processor.h >

Re: [PATCH v3 2/9] KVM: selftests: Unify the makefile rule for split targets

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:36:56AM +0800, Haibo Xu wrote: > A separate makefile rule was used for split targets which was added > in patch(KVM: arm64: selftests: Split get-reg-list test code). This > could be avoided by minor changes to the recipes of current rule. > > Signed-off-by: Haibo Xu >

Re: [PATCH v3 3/9] KVM: arm64: selftests: Split arch_timer test code

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:36:57AM +0800, Haibo Xu wrote: > Split the arch-neutral test code out of aarch64/arch_timer.c > and put them into a common arch_timer.c. This is a preparation > to share timer test codes in riscv. > > Suggested-by: Andrew Jones > Signed-off-by: Haibo Xu > --- >

Re: [PATCH v3 4/9] tools: riscv: Add header file csr.h

2023-09-14 Thread Andrew Jones
On Thu, Sep 14, 2023 at 09:36:58AM +0800, Haibo Xu wrote: > Borrow the csr definitions and operations from kernel's > arch/riscv/include/asm/csr.h to tools/ for riscv. Since > only 64bit was supported for RISC-V KVM selftests, add > CONFIG_64BIT definition in kvm/Makefile to ensure only > 64bit

Re: [PATCH RESEND v3 1/2] selftests/resctrl: Fix schemata write error check

2023-09-14 Thread Maciej Wieczór-Retman
Hi, On 2023-09-13 at 11:49:19 -0700, Reinette Chatre wrote: >Hi Maciej, > >On 9/12/2023 10:59 PM, Maciej Wieczór-Retman wrote: >> On 2023-09-12 at 09:00:28 -0700, Reinette Chatre wrote: >>> Hi Maciej, >>> >>> On 9/11/2023 11:32 PM, Maciej Wieczór-Retman wrote: On 2023-09-11 at 09:59:06