Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-10 Thread David Coe
Well, well! This is a promising start to the weekend. Thank you both, Suravee and Paul. Results for AMD Ryzen 4 2400G running Ubuntu 21.04β kernel 5.11.0-13 and Windows 10 2H2 under KVM $ sudo dmesg | grep IOMMU [0.557725] pci :00:00.2: AMD-Vi: IOMMU performance counters supported

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-09 Thread Shuah Khan
ource management"), there was a HW bug where the counters could not be accessed. The result was reading of the counter always return zero. At the time, the suggested workaround was to add a test logic prior to initializing the PMC feature to check if the counters can be programmed and read back the

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-09 Thread David Coe
bug where the counters could not be accessed. The result was reading of the counter always return zero. At the time, the suggested workaround was to add a test logic prior to initializing the PMC feature to check if the counters can be programmed and read back the same value. This has been working

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-09 Thread Shuah Khan
bug where the counters could not be accessed. The result was reading of the counter always return zero. At the time, the suggested workaround was to add a test logic prior to initializing the PMC feature to check if the counters can be programmed and read back the same value. This has been working

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-09 Thread Shuah Khan
ource management"), there was a HW bug where the counters could not be accessed. The result was reading of the counter always return zero. At the time, the suggested workaround was to add a test logic prior to initializing the PMC feature to check if the counters can be programmed and read back the

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-09 Thread Shuah Khan
bug where the counters could not be accessed. The result was reading of the counter always return zero. At the time, the suggested workaround was to add a test logic prior to initializing the PMC feature to check if the counters can be programmed and read back the same value. This has been working

Re: [PATCH v4] lib: add basic KUnit test for lib/math

2021-04-09 Thread Daniel Latypov
On Fri, Apr 9, 2021 at 8:30 AM Andy Shevchenko wrote: > > On Thu, Apr 08, 2021 at 06:40:01PM -0700, Daniel Latypov wrote: > > Add basic test coverage for files that don't require any config options: > > * gcd.c > > * lcm.c > > * int_sqrt.c > > * reciprocal_div

Re: [RFC PATCH 2/3] mm: Return bool from pagebit test functions

2021-04-09 Thread David Howells
David Howells wrote: > add/remove: 2/2 grow/shrink: 15/16 up/down: 408/-599 (-191) > Function old new delta > iomap_write_end_inline - 128+128 I can get rid of the iomap_write_end_inline() increase for my config by

Re: [PATCH v4] lib: add basic KUnit test for lib/math

2021-04-09 Thread Andy Shevchenko
On Thu, Apr 08, 2021 at 06:40:01PM -0700, Daniel Latypov wrote: > Add basic test coverage for files that don't require any config options: > * gcd.c > * lcm.c > * int_sqrt.c > * reciprocal_div.c > (Ignored int_pow.c since it's a simple textbook algorithm.) What about adding math

Re: [RFC PATCH 2/3] mm: Return bool from pagebit test functions

2021-04-09 Thread David Howells
Matthew Wilcox wrote: > iirc i looked at doing this as part of the folio work, and it ended up > increasing the size of the kernel. Did you run bloat-o-meter on the > result of doing this? add/remove: 2/2 grow/shrink: 15/16 up/down: 408/-599 (-191) Function

Re: [RFC PATCH 2/3] mm: Return bool from pagebit test functions

2021-04-09 Thread David Howells
Matthew Wilcox wrote: > On Fri, Apr 09, 2021 at 11:59:17AM +0100, David Howells wrote: > > Make functions that test page bits return a bool, not an int. This means > > that the value is definitely 0 or 1 if they're used in arithmetic, rather > > than rely on test_bit()

Re: [RFC PATCH 2/3] mm: Return bool from pagebit test functions

2021-04-09 Thread Matthew Wilcox
On Fri, Apr 09, 2021 at 11:59:17AM +0100, David Howells wrote: > Make functions that test page bits return a bool, not an int. This means > that the value is definitely 0 or 1 if they're used in arithmetic, rather > than rely on test_bit() and friends to return this (though they probably

[RFC PATCH 2/3] mm: Return bool from pagebit test functions

2021-04-09 Thread David Howells
Make functions that test page bits return a bool, not an int. This means that the value is definitely 0 or 1 if they're used in arithmetic, rather than rely on test_bit() and friends to return this (though they probably should). Signed-off-by: David Howells cc: Linus Torvalds cc: Matthew

[PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-09 Thread Suravee Suthikulpanit
as reading of the counter always return zero. At the time, the suggested workaround was to add a test logic prior to initializing the PMC feature to check if the counters can be programmed and read back the same value. This has been working fine until the more recent desktop/mobile platforms star

[PATCH 0/2] iommu/amd: Revert and remove failing PMC test

2021-04-09 Thread Suravee Suthikulpanit
This has prevented PMC to work on more recent desktop/mobile platforms, where the PMC power-gating is normally enabled. After consulting with HW designers and IOMMU maintainer, we have decide to remove the legacy test altogether to avoid future PMC enabling issues. Thanks the community

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-09 Thread Brendan Higgins
r look over from Brendan or > > > >> David. > > > >> Any ETA on that, folks? :) > > > >> > > > >> So if you don't want to get blocked on that for now, I think it's fine > > > >> to add: > > > >> #ifdef CONFI

[PATCH v4] lib: add basic KUnit test for lib/math

2021-04-08 Thread Daniel Latypov
Add basic test coverage for files that don't require any config options: * gcd.c * lcm.c * int_sqrt.c * reciprocal_div.c (Ignored int_pow.c since it's a simple textbook algorithm.) These tests aren't particularly interesting, but they * provide short and simple examples of parameterized tests

[PATCH 7/9] userfaultfd/selftests: reinitialize test context in each test

2021-04-08 Thread Axel Rasmussen
Currently, the context (fds, mmap-ed areas, etc.) are global. Each test mutates this state in some way, in some cases really "clobbering it" (e.g., the events test mremap-ing area_dst over the top of area_src, or the minor faults tests overwriting the count_verify values in the test area

[PATCH 5/9] userfaultfd/selftests: use memfd_create for shmem test type

2021-04-08 Thread Axel Rasmussen
This is a preparatory commit. In the future, we want to be able to setup alias mappings for area_src and area_dst in the shmem test, like we do in the hugetlb_shared test. With a VMA obtained via mmap(MAP_ANONYMOUS | MAP_SHARED), it isn't clear how to do this. So, mmap() with an fd, so we can

[PATCH 6/9] userfaultfd/selftests: create alias mappings in the shmem test

2021-04-08 Thread Axel Rasmussen
, we'll leverage this setup to exercise minor fault handling support for shmem, just like we do in the hugetlb_shared test. Signed-off-by: Axel Rasmussen --- tools/testing/selftests/vm/userfaultfd.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tools

[PATCH 5/5] srcu: Early test SRCU polling start

2021-04-08 Thread Frederic Weisbecker
Test early calls to start_poll_synchronize_srcu(), mixed within the early test to call_srcu(), and make sure that poll_state_synchronize_srcu() correctly see the expired grace periods after the srcu_barrier() on late initcall. Normally srcu_barrier() doesn't wait for callback-less grace periods

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-08 Thread Daniel Latypov
moment, it's just waiting another look over from Brendan or David. > > >> Any ETA on that, folks? :) > > >> > > >> So if you don't want to get blocked on that for now, I think it's fine > > >> to add: > > >> #ifdef CONFIG_SLUB_KUNIT_TEST

[PATCH v4 10/10] perf test: Add basic stress test for sigtrap handling

2021-04-08 Thread Marco Elver
Add basic stress test for sigtrap handling as a perf tool built-in test. This allows sanity checking the basic sigtrap functionality from within the perf tool. Note: A more elaborate kselftest version of this test can also be found in tools/testing/selftests/perf_events/sigtrap_threads.c. Signed

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-08 Thread Marco Elver
>> add: > >> #ifdef CONFIG_SLUB_KUNIT_TEST > >> int errors; > >> #endif > > > > Until kunit fixes setting current->kunit_test, a cleaner workaround > > that would allow to do the patch with kunit_resource, is to just have > > an .ini

Re: [PATCH] proc: smoke test lseek()

2021-04-07 Thread Alexey Dobriyan
On Wed, Apr 07, 2021 at 08:58:09PM +0100, Matthew Wilcox wrote: > On Wed, Apr 07, 2021 at 10:55:14PM +0300, Alexey Dobriyan wrote: > > Now that ->proc_lseek has been made mandatory it would be nice to test > > that nothing has been forgotten. > > > @@ -45,6 +45,8

Re: [PATCH] proc: smoke test lseek()

2021-04-07 Thread Matthew Wilcox
On Wed, Apr 07, 2021 at 10:55:14PM +0300, Alexey Dobriyan wrote: > Now that ->proc_lseek has been made mandatory it would be nice to test > that nothing has been forgotten. > @@ -45,6 +45,8 @@ static void f_reg(DIR *d, const char *filename) > fd = openat(dirfd(d), fil

[PATCH] proc: smoke test lseek()

2021-04-07 Thread Alexey Dobriyan
Now that ->proc_lseek has been made mandatory it would be nice to test that nothing has been forgotten. Signed-off-by: Alexey Dobriyan --- May want to fold into proc-mandate-proc_lseek-in-struct-proc_ops.patch tools/testing/selftests/proc/read.c |4 +++- 1 f

[PATCH v10 8/9] kselftests: Add test to check for rlimit changes in different user namespaces

2021-04-07 Thread Alexey Gladkov
XITSTATUS(wstatus[i])); + else if (WIFSIGNALED(wstatus[i])) + warnx("(pid=%d): pid %d killed by signal %d", + pid, -child[i], WTERMSIG(wstatus[i])); + + if (WIFSIGNALED(wstatus[i]) && WTERMSIG(wstatus[i]) == SIGUSR1) + continue; + + warnx("(pid=%d): Test failed", pid); + exit(EXIT_FAILURE); + } + + warnx("(pid=%d): Test passed", pid); + exit(EXIT_SUCCESS); +} -- 2.29.3

[PATCH v4 3/4] crypto: add rsa pss test vector

2021-04-07 Thread Hongbo Li
This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 90 2 files changed, 97 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 10c5b3b

drivers/nvdimm/../../tools/testing/nvdimm/test/iomap.c:76:15: warning: no previous prototype for function '__wrap_devm_ioremap'

2021-04-07 Thread kernel test robot
fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/nvdimm/../../tools/testing/nvdimm/test/iomap.c:65:15: warning: no previous prototype for function '__nfit_test_ioremap' [-Wmissing-prototypes] void _

[PATCH v3 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-07 Thread John Garry
The pmu-events parsing test does not handle metric reuse at all. Introduce some simple handling to resolve metrics who reference other metrics. Tested-by: Paul A. Clarke Signed-off-by: John Garry Reviewed-by: Kajol Jain --- tools/perf/tests/pmu-events.c | 81

[PATCH v3 3/4] crypto: add rsa pss test vector

2021-04-06 Thread Hongbo Li
This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 90 2 files changed, 97 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 10c5b3b

[PATCH v2 3/4] crypto: add rsa pss test vector

2021-04-06 Thread Hongbo Li
This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 90 2 files changed, 97 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 10c5b3b

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread John Garry
On 06/04/2021 14:34, Jiri Olsa wrote: } So once we evaluate a pmu_event in pctx->ids in @pe, @all is set false, and we would loop again in the do-while loop, regardless of what expr__find_other() does (apart from erroring), and so call hashmap__for_each_entry_safe(>ids, ) again. ah ok, so it

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread Jiri Olsa
On Tue, Apr 06, 2021 at 02:21:11PM +0100, John Garry wrote: > On 06/04/2021 13:55, Jiri Olsa wrote: > > > > > So expr__find_other() may add a new item to pctx->ids, and we always > > > > > iterate > > > > > again, and try to lookup any pmu_events, *, above. If none exist, > > > > > then we > > >

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread John Garry
On 06/04/2021 13:55, Jiri Olsa wrote: So expr__find_other() may add a new item to pctx->ids, and we always iterate again, and try to lookup any pmu_events, *, above. If none exist, then we hm, I don't see that.. so, what you do is: hashmap__for_each_entry_safe((>ids) ) {

[PATCH 3/5] crypto: add rsa pss test vector

2021-04-06 Thread Hongbo Li
From: Hongbo Li This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 87 2 files changed, 94 insertions(+) diff --git a/crypto/testmgr.c b/crypto

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread Jiri Olsa
On Tue, Apr 06, 2021 at 01:43:09PM +0100, John Garry wrote: > On 06/04/2021 13:17, Jiri Olsa wrote: > > > > > + ref = >metric_ref; > > > > > + ref->metric_name = pe->metric_name; > > > > > + ref->metric_expr = pe->metric_expr; > > > > > +

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread John Garry
On 06/04/2021 13:17, Jiri Olsa wrote: + ref = >metric_ref; + ref->metric_name = pe->metric_name; + ref->metric_expr = pe->metric_expr; + list_add_tail(>list, compound_list); + + rc =

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread Jiri Olsa
On Tue, Apr 06, 2021 at 12:00:27PM +0100, John Garry wrote: > On 01/04/2021 14:49, Jiri Olsa wrote: > > On Thu, Mar 25, 2021 at 06:33:14PM +0800, John Garry wrote: > > > > SNIP > > > > > +struct metric { > > > + struct list_head list; > > > + struct metric_ref metric_ref; > > > +}; > > > + > > >

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-06 Thread John Garry
On 01/04/2021 14:49, Jiri Olsa wrote: On Thu, Mar 25, 2021 at 06:33:14PM +0800, John Garry wrote: SNIP +struct metric { + struct list_head list; + struct metric_ref metric_ref; +}; + +static int resolve_metric_simple(struct expr_parse_ctx *pctx, +

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-06 Thread Vlastimil Babka
ks? :) >> >> So if you don't want to get blocked on that for now, I think it's fine to >> add: >> #ifdef CONFIG_SLUB_KUNIT_TEST >> int errors; >> #endif > > Until kunit fixes setting current->kunit_test, a cleaner workaround > that woul

Re: [PATCH v2] soundwire: intel_init: test link->cdns

2021-04-05 Thread Vinod Koul
On 06-04-21, 09:01, Bard Liao wrote: > intel_link_probe() could return error and dev_get_drvdata() will return > null in such case. So we have to test link->cdns after > link->cdns = dev_get_drvdata(>auxdev.dev); > Otherwise, we will meet the "kernel NULL pointer de

Re: [PATCH v6 00/10] KVM: selftests: some improvement and a new test for kvm page table

2021-04-05 Thread wangyanan (Y)
appropriate for all architectures. Besides, a helper that can get granularity of different backing src types(anonumous/thp/hugetlb) is added, so that we can use the accurate backing src granularity for kinds of alignment or guest memory accessing of vcpus. In the second part, a new test is added: This test

[PATCH v2] soundwire: intel_init: test link->cdns

2021-04-05 Thread Bard Liao
intel_link_probe() could return error and dev_get_drvdata() will return null in such case. So we have to test link->cdns after link->cdns = dev_get_drvdata(>auxdev.dev); Otherwise, we will meet the "kernel NULL pointer dereference" error. Signed-off-by: Bard Liao Reviewed-by

[PATCH 1/2] kselftest: introduce new epoll test case

2021-04-05 Thread Davidlohr Bueso
..65ede506305c 100644 --- a/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +++ b/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c @@ -3449,4 +3449,48 @@ TEST(epoll63) close(sfd[1]); } +/* + *t0t1 + * (ew) \ / (ew) + * e0 + *| (lt

Re: [PATCH AUTOSEL 4.19 6/8] radix tree test suite: Fix compilation

2021-04-05 Thread Matthew Wilcox
On Mon, Apr 05, 2021 at 12:05:13PM -0400, Sasha Levin wrote: > From: "Matthew Wilcox (Oracle)" > > [ Upstream commit dd841a749d1ded8e2e5facc4242ee0b6779fc0cb ] > > Introducing local_lock broke compilation; fix it all up. I don't think local_lock has been backported to 4.19?

[PATCH 07/10] staging: rtl8723bs: place constant on the right side of the test

2021-04-05 Thread Fabio Aiuto
fix following post-hook checkpatch issue: WARNING: Comparisons should place the constant on the right side of the test 85: FILE: drivers/staging/rtl8723bs/hal/sdio_halinit.c:676: + if (_FAIL == ret) Suggested-by: Joe Perches Signed-off-by: Fabio Aiuto --- drivers/staging/rtl8723bs/hal

[PATCH AUTOSEL 5.4 10/13] idr test suite: Take RCU read lock in idr_find_test_1

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 703586410da69eb40062e64d413ca33bd735917a ] When run on a single CPU, this test would frequently access already-freed memory. Due to timing, this bug never showed up on multi-CPU tests. Reported-by: Chris von Recklinghausen

[PATCH AUTOSEL 5.4 09/13] radix tree test suite: Register the main thread with the RCU library

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 1bb4bd266cf39fd2fa711f2d265c558b92df1119 ] Several test runners register individual worker threads with the RCU library, but neglect to register the main thread, which can lead to objects being freed while the main thread is in wh

[PATCH AUTOSEL 5.4 11/13] idr test suite: Create anchor before launching throbber

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 094ffbd1d8eaa27ed426feb8530cb1456348b018 ] The throbber could race with creation of the anchor entry and cause the IDR to have zero entries in it, which would cause the test to fail. Signed-off-by: Matthew Wilcox (Oracle) Signed-off

[PATCH AUTOSEL 4.19 6/8] radix tree test suite: Fix compilation

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit dd841a749d1ded8e2e5facc4242ee0b6779fc0cb ] Introducing local_lock broke compilation; fix it all up. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Sasha Levin --- tools/testing/radix-tree/linux/compiler_types.h | 0 1 file changed, 0

[PATCH AUTOSEL 5.4 07/13] radix tree test suite: Fix compilation

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit dd841a749d1ded8e2e5facc4242ee0b6779fc0cb ] Introducing local_lock broke compilation; fix it all up. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Sasha Levin --- tools/testing/radix-tree/linux/compiler_types.h | 0 1 file changed, 0

[PATCH AUTOSEL 5.10 17/22] idr test suite: Create anchor before launching throbber

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 094ffbd1d8eaa27ed426feb8530cb1456348b018 ] The throbber could race with creation of the anchor entry and cause the IDR to have zero entries in it, which would cause the test to fail. Signed-off-by: Matthew Wilcox (Oracle) Signed-off

[PATCH AUTOSEL 5.10 16/22] idr test suite: Take RCU read lock in idr_find_test_1

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 703586410da69eb40062e64d413ca33bd735917a ] When run on a single CPU, this test would frequently access already-freed memory. Due to timing, this bug never showed up on multi-CPU tests. Reported-by: Chris von Recklinghausen

[PATCH AUTOSEL 5.10 15/22] radix tree test suite: Register the main thread with the RCU library

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 1bb4bd266cf39fd2fa711f2d265c558b92df1119 ] Several test runners register individual worker threads with the RCU library, but neglect to register the main thread, which can lead to objects being freed while the main thread is in wh

[PATCH AUTOSEL 5.10 13/22] radix tree test suite: Fix compilation

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 7487de534dcbe143e6f41da751dd3ffcf93b00ee ] Commit 4bba4c4bb09a added tools/include/linux/compiler_types.h which includes linux/compiler-gcc.h. Unfortunately, we had our own (empty) compiler_types.h which overrode the one added by that commit,

[PATCH AUTOSEL 5.11 16/22] idr test suite: Take RCU read lock in idr_find_test_1

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 703586410da69eb40062e64d413ca33bd735917a ] When run on a single CPU, this test would frequently access already-freed memory. Due to timing, this bug never showed up on multi-CPU tests. Reported-by: Chris von Recklinghausen

[PATCH AUTOSEL 5.11 17/22] idr test suite: Create anchor before launching throbber

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 094ffbd1d8eaa27ed426feb8530cb1456348b018 ] The throbber could race with creation of the anchor entry and cause the IDR to have zero entries in it, which would cause the test to fail. Signed-off-by: Matthew Wilcox (Oracle) Signed-off

[PATCH AUTOSEL 5.11 13/22] radix tree test suite: Fix compilation

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 7487de534dcbe143e6f41da751dd3ffcf93b00ee ] Commit 4bba4c4bb09a added tools/include/linux/compiler_types.h which includes linux/compiler-gcc.h. Unfortunately, we had our own (empty) compiler_types.h which overrode the one added by that commit,

[PATCH AUTOSEL 5.11 15/22] radix tree test suite: Register the main thread with the RCU library

2021-04-05 Thread Sasha Levin
From: "Matthew Wilcox (Oracle)" [ Upstream commit 1bb4bd266cf39fd2fa711f2d265c558b92df1119 ] Several test runners register individual worker threads with the RCU library, but neglect to register the main thread, which can lead to objects being freed while the main thread is in wh

[PATCH v4 26/30] staging: rtl8723bs: place constant on the right side of the test in core/rtw_ioctl_set.c

2021-04-04 Thread Fabio Aiuto
fix posst-commit hook checkpatch issues: WARNING: Comparisons should place the constant on the right side of the test 40: FILE: drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:71: + if (_SUCCESS != ret) WARNING: Comparisons should place the constant on the right side

[PATCH v3 26/30] staging: rtl8723bs: place constant on the right side of the test in core/rtw_ioctl_set.c

2021-04-03 Thread Fabio Aiuto
fix posst-commit hook checkpatch issues: WARNING: Comparisons should place the constant on the right side of the test 40: FILE: drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:71: + if (_SUCCESS != ret) WARNING: Comparisons should place the constant on the right side

test

2021-04-02 Thread Abbas Maheryar
this is a test

[PATCH v2 26/30] staging: rtl8723bs: place constant on the right side of the test

2021-04-02 Thread Fabio Aiuto
fix posst-commit checkpatch issues: WARNING: Comparisons should place the constant on the right side of the test 40: FILE: drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:71: + if (_SUCCESS != ret) WARNING: Comparisons should place the constant on the right side of the test

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-02 Thread Brendan Higgins
On Thu, Apr 1, 2021 at 12:04 PM 'Daniel Latypov' via KUnit Development wrote: > > On Thu, Apr 1, 2021 at 2:16 AM 'Marco Elver' via KUnit Development > wrote: [...] > > #else > > static inline bool slab_add_kunit_errors(void) { return false; } > > #endif > > > > And

[PATCH V6 10/10] x86/pks: Add PKS test code

2021-04-01 Thread ira . weiny
From: Ira Weiny The core PKS functionality provides an interface for kernel users to reserve keys to their domains set up the page tables with those keys and control access to those domains when needed. Define test code which exercises the core functionality of PKS via a debugfs entry. Basic

[PATCH v4 1/3] lkdtm/heap: Add vmalloc linear overflow test

2021-04-01 Thread Kees Cook
Similar to the existing slab overflow and stack exhaustion tests, add VMALLOC_LINEAR_OVERFLOW (and rename the slab test SLAB_LINEAR_OVERFLOW). Signed-off-by: Kees Cook --- drivers/misc/lkdtm/core.c | 3 ++- drivers/misc/lkdtm/heap.c | 21

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-01 Thread Marco Elver
> > > > struct kmem_cache_node *node[MAX_NUMNODES]; > > > + > > > + int errors; /* Number of errors in cache */ > > > > So, I think it's bad design to add a new field 'errors', just for the > > test. This will increase kmem_cac

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-01 Thread Daniel Latypov
er replacement for it. > > > > Try changing byte in redzone after allocation and changing > > pointer to next free node, first byte, 50th byte and redzone > > byte. Check if validation finds errors. > > > > There are several differences from the original resiliency

Re: [PATCH] soundwire: intel_init: test link->cdns

2021-04-01 Thread Pierre-Louis Bossart
On 4/1/21 2:21 AM, Vinod Koul wrote: On 31-03-21, 09:02, Bard Liao wrote: intel_link_probe() could return error and dev_get_drvdata() will return null in such case. So we have to test link->cdns after link->cdns = dev_get_drvdata(>auxdev.dev); Otherwise, we will meet the "kerne

Re: [PATCH v2 2/6] perf test: Handle metric reuse in pmu-events parsing test

2021-04-01 Thread Jiri Olsa
On Thu, Mar 25, 2021 at 06:33:14PM +0800, John Garry wrote: SNIP > +struct metric { > + struct list_head list; > + struct metric_ref metric_ref; > +}; > + > +static int resolve_metric_simple(struct expr_parse_ctx *pctx, > + struct list_head *compound_list, >

[PATCH 6/9] kselftest: Add test for core sched prctl interface

2021-04-01 Thread Peter Zijlstra
// SPDX-License-Identifier: GPL-2.0-only +/* + * Use the core scheduling prctl() to test core scheduling cookies control. + * + * Copyright (c) 2021 Oracle and/or its affiliates. + * Author: Chris Hyser + * + * + * This library is free software; you can redistribute it and/or modify it + * under th

Re: [PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-04-01 Thread Emanuele Giuseppe Esposito
ere seems to be borrowed from get_cpuid_test.c, I think we can either put it to a library or (my preference) just merge these two selftests together. 'get_cpuid_test' name is generic enough to be used for KVM_GET_EMULATED_CPUID too. Yes it is identical. I agree with you, I will merge the test in get_cpuid_test.c Emanuele

Re: [PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-04-01 Thread Vitaly Kuznetsov
Emanuele Giuseppe Esposito writes: > Introduce a new selftest for the KVM_GET_EMULATED_CPUID > ioctl. Since the behavior and functionality is similar to > get_cpuid_test, the test checks: > > 1) checks for corner case in the nent field of the struct kvm_cpuid2. > 2) sets an

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-01 Thread Marco Elver
e, 50th byte and redzone > byte. Check if validation finds errors. > > There are several differences from the original resiliency test: > Tests create own caches with known state instead of corrupting > shared kmalloc caches. > > The corruption of freepointer uses correct offs

Re: [PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-04-01 Thread Vlastimil Babka
byte in redzone after allocation and changing > pointer to next free node, first byte, 50th byte and redzone > byte. Check if validation finds errors. > > There are several differences from the original resiliency test: > Tests create own caches with known state instead o

Re: [PATCH] soundwire: intel_init: test link->cdns

2021-04-01 Thread Vinod Koul
On 31-03-21, 09:02, Bard Liao wrote: > intel_link_probe() could return error and dev_get_drvdata() will return > null in such case. So we have to test link->cdns after > link->cdns = dev_get_drvdata(>auxdev.dev); > Otherwise, we will meet the "kernel NULL pointer deref

[PATCH V5 10/10] x86/pks: Add PKS test code

2021-03-31 Thread ira . weiny
From: Ira Weiny The core PKS functionality provides an interface for kernel users to reserve keys to their domains set up the page tables with those keys and control access to those domains when needed. Define test code which exercises the core functionality of PKS via a debugfs entry. Basic

[PATCH v2 4/4] selftests: kvm: add get_emulated_cpuid test

2021-03-31 Thread Emanuele Giuseppe Esposito
Introduce a new selftest for the KVM_GET_EMULATED_CPUID ioctl. Since the behavior and functionality is similar to get_cpuid_test, the test checks: 1) checks for corner case in the nent field of the struct kvm_cpuid2. 2) sets and gets it as cpuid from the guest VM Signed-off-by: Emanuele Giuseppe

[PATCH v3 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-03-31 Thread glittao
byte, 50th byte and redzone byte. Check if validation finds errors. There are several differences from the original resiliency test: Tests create own caches with known state instead of corrupting shared kmalloc caches. The corruption of freepointer uses correct offset, the original resiliency test

Re: [PATCH v2 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-03-30 Thread Dan Carpenter
Hi, url: https://github.com/0day-ci/linux/commits/glittao-gmail-com/kunit-add-a-KUnit-test-for-SLUB-debugging-functionality/20210330-200635 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1e43c377a79f9189fea8f2711b399d4e8b4e609b config: i386-randconfig-m021

[PATCH] soundwire: intel_init: test link->cdns

2021-03-30 Thread Bard Liao
intel_link_probe() could return error and dev_get_drvdata() will return null in such case. So we have to test link->cdns after link->cdns = dev_get_drvdata(>auxdev.dev); Otherwise, we will meet the "kernel NULL pointer dereference" error. Signed-off-by: Bard Liao Reviewed-by

Re: [PATCH net-next] tc-testing: add simple action change test

2021-03-30 Thread patchwork-bot+netdevbpf
counting to ensure that the case when netlink message has > NLM_F_REPLACE flag set but action with specified index doesn't exist is > handled correctly. > > Signed-off-by: Vlad Buslov > > [...] Here is the summary with links: - [net-next] tc-testing: add simple a

[PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-03-30 Thread Emanuele Giuseppe Esposito
Introduce a new selftest for the KVM_GET_EMULATED_CPUID ioctl. Since the behavior and functionality is similar to get_cpuid_test, the test checks: 1) checks for corner case in the nent field of the struct kvm_cpuid2. 2) sets and gets it as cpuid from the guest VM Signed-off-by: Emanuele Giuseppe

Re: [PATCH v2 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-03-30 Thread kernel test robot
Hi, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.12-rc5] [cannot apply to hnaz-linux-mm/master next-20210330] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we

[PATCH v2 1/2] kunit: add a KUnit test for SLUB debugging functionality

2021-03-30 Thread glittao
byte, 50th byte and redzone byte. Check if validation finds errors. There are several differences from the original resiliency test: Tests create own caches with known state instead of corrupting shared kmalloc caches. The corruption of freepointer uses correct offset, the original resiliency test

[PATCH net-next] tc-testing: add simple action change test

2021-03-30 Thread Vlad Buslov
Use act_simple to verify that action created with 'tc actions change' command exists after command returns. The goal is to verify internal action API reference counting to ensure that the case when netlink message has NLM_F_REPLACE flag set but action with specified index doesn't exist is handled

[PATCH v6 10/10] KVM: selftests: Add a test for kvm page table code

2021-03-30 Thread Yanan Wang
This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some improvement for kvm. The function guest_code() can cover the conditions where a single vcpu or multiple vcpus access guest pages wit

[PATCH v6 00/10] KVM: selftests: some improvement and a new test for kvm page table

2021-03-30 Thread Yanan Wang
the accurate backing src granularity for kinds of alignment or guest memory accessing of vcpus. In the second part, a new test is added: This test is added to serve as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), it gives guidance for the people trying to make s

[PATCH v2] ARM: kprobes: test-thumb: fix for LLVM_IAS=1

2021-03-29 Thread Nick Desaulniers
/ORNS: https://reviews.llvm.org/D99538 * RSB/RSBS: https://reviews.llvm.org/D99542 I'd have expected the Arm ARM to use curly braces to denote optional operands (see also "F5.1.167 RSB, RSBS (register)" for an example). arch/arm/probes/kprobes/test-thumb.c | 10 +- 1 file

Re: [PATCH v2] ARM: kprobes: rewrite test-[arm|thumb].c in UAL

2021-03-29 Thread Nick Desaulniers
On Fri, Jan 29, 2021 at 1:40 AM Ard Biesheuvel wrote: > > On Fri, 29 Jan 2021 at 01:22, Nick Desaulniers > wrote: > > > > > On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers > > > wrote: > > > > + TEST_RX("tbh[pc, r",7, (9f-(1f+4))>>1,", lsl #1]", > > > > > > > On Thu, Jan 28, 2021 at

Re: [RFC PATCH v5 10/10] KVM: selftests: Add a test for kvm page table code

2021-03-29 Thread wangyanan (Y)
Hi Drew, Thanks for having a look. On 2021/3/29 19:38, Andrew Jones wrote: On Tue, Mar 23, 2021 at 09:52:31PM +0800, Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make s

Re: [RFC PATCH v5 10/10] KVM: selftests: Add a test for kvm page table code

2021-03-29 Thread Andrew Jones
On Tue, Mar 23, 2021 at 09:52:31PM +0800, Yanan Wang wrote: > This test serves as a performance tester and a bug reproducer for > kvm page table code (GPA->HPA mappings), so it gives guidance for > people trying to make some improvement for kvm. > > The function gues

[PATCH 5.11 254/254] selftest/bpf: Add a test to check trampoline freeing logic.

2021-03-29 Thread Greg Kroah-Hartman
From: Alexei Starovoitov commit eddbe8e6521401003e37e7848ef72e75c10ee2aa upstream. Add a selftest for commit e21aa341785c ("bpf: Fix fexit trampoline.") to make sure that attaching fexit prog to a sleeping kernel function will trigger appropriate trampoline and program destruction.

[PATCH v3 19/27] perf tests: Add hybrid cases for 'Parse event definition strings' test

2021-03-29 Thread Jin Yao
Add basic hybrid test cases for 'Parse event definition strings' test. # ./perf test 6 6: Parse event definition strings : Ok Signed-off-by: Jin Yao --- v3: - Use PERF_TYPE_RAW for cpu_core/cycles/ tools/perf/tests/parse-events.c | 170

[PATCH v3 24/27] perf tests: Support 'Session topology' test for hybrid

2021-03-29 Thread Jin Yao
Force to create one event "cpu_core/cycles/" by default, otherwise in evlist__valid_sample_type, the checking of 'if (evlist->core.nr_entries == 1)' would be failed. # ./perf test 41 41: Session topology: Ok Signed-off-by: Ji

[PATCH v3 25/27] perf tests: Support 'Convert perf time to TSC' test for hybrid

2021-03-29 Thread Jin Yao
Since for "cycles:u' on hybrid platform, it creates two "cycles". So the second evsel in evlist also needs initialization. With this patch, # ./perf test 71 71: Convert perf time to TSC: Ok Signed-off-by: Jin Yao --- v3: - No fu

[PATCH v3 22/27] perf tests: Support 'Track with sched_switch' test for hybrid

2021-03-29 Thread Jin Yao
Since for "cycles:u' on hybrid platform, it creates two "cycles". So the number of events in evlist is not expected in next test steps. Now we just use one event "cpu_core/cycles:u/" for hybrid. # ./perf test 35 35: Track with sched_switch

[PATCH v3 23/27] perf tests: Support 'Parse and process metrics' test for hybrid

2021-03-29 Thread Jin Yao
Some events are not supported. Only pick up some cases for hybrid. # ./perf test 67 67: Parse and process metrics : Ok Signed-off-by: Jin Yao --- v3: - No functional change. tools/perf/tests/parse-metric.c | 10 -- 1 file changed, 8

<    1   2   3   4   5   6   7   8   9   10   >